diff options
author | Christopher Speller <crspeller@gmail.com> | 2017-08-17 17:19:06 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-17 17:19:06 -0700 |
commit | 96eab1202717e073782ec399a4e0820cae15b1bb (patch) | |
tree | 011012982be971c7e9ef91466f026bc0956ac9a2 /vendor/github.com/disintegration/imaging/transform_test.go | |
parent | 2c895ee66eed626721135acfcc48254c6e3f3b29 (diff) | |
download | chat-96eab1202717e073782ec399a4e0820cae15b1bb.tar.gz chat-96eab1202717e073782ec399a4e0820cae15b1bb.tar.bz2 chat-96eab1202717e073782ec399a4e0820cae15b1bb.zip |
Updating server dependancies. (#7246)
Diffstat (limited to 'vendor/github.com/disintegration/imaging/transform_test.go')
-rw-r--r-- | vendor/github.com/disintegration/imaging/transform_test.go | 164 |
1 files changed, 164 insertions, 0 deletions
diff --git a/vendor/github.com/disintegration/imaging/transform_test.go b/vendor/github.com/disintegration/imaging/transform_test.go index 3772225a3..447dd1ea0 100644 --- a/vendor/github.com/disintegration/imaging/transform_test.go +++ b/vendor/github.com/disintegration/imaging/transform_test.go @@ -406,6 +406,170 @@ func TestRotate(t *testing.T) { }, }, }, + { + "Rotate -360*10", + &image.NRGBA{ + Rect: image.Rect(-1, -1, 0, 1), + Stride: 1 * 4, + Pix: []uint8{ + 0x00, 0xff, 0x00, 0xff, + 0xff, 0x00, 0x00, 0xff, + }, + }, + -360 * 10, + color.Black, + &image.NRGBA{ + Rect: image.Rect(0, 0, 1, 2), + Stride: 1 * 4, + Pix: []uint8{ + 0x00, 0xff, 0x00, 0xff, + 0xff, 0x00, 0x00, 0xff, + }, + }, + }, + { + "Rotate -360*10 + 90", + &image.NRGBA{ + Rect: image.Rect(-1, -1, 0, 1), + Stride: 1 * 4, + Pix: []uint8{ + 0xff, 0x00, 0x00, 0xff, + 0x00, 0xff, 0x00, 0xff, + }, + }, + -360*10 + 90, + color.Black, + &image.NRGBA{ + Rect: image.Rect(0, 0, 2, 1), + Stride: 2 * 4, + Pix: []uint8{ + 0xff, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + }, + }, + }, + { + "Rotate -360*10 + 180", + &image.NRGBA{ + Rect: image.Rect(-1, -1, 0, 1), + Stride: 1 * 4, + Pix: []uint8{ + 0xff, 0x00, 0x00, 0xff, + 0x00, 0xff, 0x00, 0xff, + }, + }, + -360*10 + 180, + color.Black, + &image.NRGBA{ + Rect: image.Rect(0, 0, 1, 2), + Stride: 1 * 4, + Pix: []uint8{ + 0x00, 0xff, 0x00, 0xff, + 0xff, 0x00, 0x00, 0xff, + }, + }, + }, + { + "Rotate -360*10 + 270", + &image.NRGBA{ + Rect: image.Rect(-1, -1, 0, 1), + Stride: 1 * 4, + Pix: []uint8{ + 0xff, 0x00, 0x00, 0xff, + 0x00, 0xff, 0x00, 0xff, + }, + }, + -360*10 + 270, + color.Black, + &image.NRGBA{ + Rect: image.Rect(0, 0, 2, 1), + Stride: 2 * 4, + Pix: []uint8{ + 0x00, 0xff, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, + }, + }, + }, + { + "Rotate 360*10", + &image.NRGBA{ + Rect: image.Rect(-1, -1, 0, 1), + Stride: 1 * 4, + Pix: []uint8{ + 0x00, 0xff, 0x00, 0xff, + 0xff, 0x00, 0x00, 0xff, + }, + }, + 360 * 10, + color.Black, + &image.NRGBA{ + Rect: image.Rect(0, 0, 1, 2), + Stride: 1 * 4, + Pix: []uint8{ + 0x00, 0xff, 0x00, 0xff, + 0xff, 0x00, 0x00, 0xff, + }, + }, + }, + { + "Rotate 360*10 + 90", + &image.NRGBA{ + Rect: image.Rect(-1, -1, 0, 1), + Stride: 1 * 4, + Pix: []uint8{ + 0xff, 0x00, 0x00, 0xff, + 0x00, 0xff, 0x00, 0xff, + }, + }, + 360*10 + 90, + color.Black, + &image.NRGBA{ + Rect: image.Rect(0, 0, 2, 1), + Stride: 2 * 4, + Pix: []uint8{ + 0xff, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, + }, + }, + }, + { + "Rotate 360*10 + 180", + &image.NRGBA{ + Rect: image.Rect(-1, -1, 0, 1), + Stride: 1 * 4, + Pix: []uint8{ + 0xff, 0x00, 0x00, 0xff, + 0x00, 0xff, 0x00, 0xff, + }, + }, + 360*10 + 180, + color.Black, + &image.NRGBA{ + Rect: image.Rect(0, 0, 1, 2), + Stride: 1 * 4, + Pix: []uint8{ + 0x00, 0xff, 0x00, 0xff, + 0xff, 0x00, 0x00, 0xff, + }, + }, + }, + { + "Rotate 360*10 + 270", + &image.NRGBA{ + Rect: image.Rect(-1, -1, 0, 1), + Stride: 1 * 4, + Pix: []uint8{ + 0xff, 0x00, 0x00, 0xff, + 0x00, 0xff, 0x00, 0xff, + }, + }, + 360*10 + 270, + color.Black, + &image.NRGBA{ + Rect: image.Rect(0, 0, 2, 1), + Stride: 2 * 4, + Pix: []uint8{ + 0x00, 0xff, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, + }, + }, + }, } for _, test := range testCases { got := Rotate(test.src, test.angle, test.bg) |