修改
This commit is contained in:
parent
1cc163587f
commit
a1e5989c5e
@ -48,19 +48,6 @@ func ReadOrientation(filename string) (direct int, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
// 旋转90度
|
||||
func Rotate90(m image.Image) image.Image {
|
||||
rotate90 := image.NewRGBA(image.Rect(0, 0, m.Bounds().Dy(), m.Bounds().Dx()))
|
||||
// 矩阵旋转
|
||||
for x := m.Bounds().Min.Y; x < m.Bounds().Max.Y; x++ {
|
||||
for y := m.Bounds().Max.X - 1; y >= m.Bounds().Min.X; y-- {
|
||||
// 设置像素点
|
||||
rotate90.Set(m.Bounds().Max.Y-x, y, m.At(y, x))
|
||||
}
|
||||
}
|
||||
return rotate90
|
||||
}
|
||||
|
||||
// 旋转90度
|
||||
func rotate90(m image.Image) image.Image {
|
||||
rotate90 := image.NewRGBA(image.Rect(0, 0, m.Bounds().Dy(), m.Bounds().Dx()))
|
||||
|
Loading…
Reference in New Issue
Block a user