summaryrefslogtreecommitdiffstats
path: root/Godeps
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2015-07-29 01:39:43 -0800
committer=Corey Hulen <corey@hulen.com>2015-07-29 01:39:43 -0800
commit4244990bf118c04d4d66dd946aaf5217fc59a393 (patch)
tree9cfad1eec8a462577e1723c62b70520994c0920a /Godeps
parent9677a9f71777d75f3def0b0cb238050a30ec6a67 (diff)
parentd222f6c7a3c69a68879cc0fd5aeb7343d72dfb39 (diff)
downloadchat-4244990bf118c04d4d66dd946aaf5217fc59a393.tar.gz
chat-4244990bf118c04d4d66dd946aaf5217fc59a393.tar.bz2
chat-4244990bf118c04d4d66dd946aaf5217fc59a393.zip
Merge branch 'master' into mm-1355
Diffstat (limited to 'Godeps')
-rw-r--r--Godeps/Godeps.json2
-rw-r--r--Godeps/_workspace/src/github.com/nfnt/resize/converter.go6
-rw-r--r--Godeps/_workspace/src/github.com/nfnt/resize/resize.go4
-rw-r--r--Godeps/_workspace/src/github.com/nfnt/resize/resize_test.go96
4 files changed, 99 insertions, 9 deletions
diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json
index 38f2bb09a..c2b32df06 100644
--- a/Godeps/Godeps.json
+++ b/Godeps/Godeps.json
@@ -80,7 +80,7 @@
},
{
"ImportPath": "github.com/nfnt/resize",
- "Rev": "f2d1b73023c55bdfb4fa2ed385d2bec95bce3692"
+ "Rev": "dc93e1b98c579d90ee2fa15c1fd6dac34f6e7899"
},
{
"ImportPath": "github.com/stretchr/objx",
diff --git a/Godeps/_workspace/src/github.com/nfnt/resize/converter.go b/Godeps/_workspace/src/github.com/nfnt/resize/converter.go
index 84bd284ba..b3dd06b8d 100644
--- a/Godeps/_workspace/src/github.com/nfnt/resize/converter.go
+++ b/Godeps/_workspace/src/github.com/nfnt/resize/converter.go
@@ -131,11 +131,11 @@ func resizeRGBA(in *image.RGBA, out *image.NRGBA, scale float64, coeffs []int16,
// reverse alpha-premultiplication.
if a != 0 {
- r *= 0xffff
+ r *= 0xff
r /= a
- g *= 0xffff
+ g *= 0xff
g /= a
- b *= 0xffff
+ b *= 0xff
b /= a
}
diff --git a/Godeps/_workspace/src/github.com/nfnt/resize/resize.go b/Godeps/_workspace/src/github.com/nfnt/resize/resize.go
index 4d4ff6e3e..c1672432e 100644
--- a/Godeps/_workspace/src/github.com/nfnt/resize/resize.go
+++ b/Godeps/_workspace/src/github.com/nfnt/resize/resize.go
@@ -167,7 +167,7 @@ func Resize(width, height uint, img image.Image, interp InterpolationFunction) i
// accessing the YCbCr arrays in a tight loop is slow.
// converting the image to ycc increases performance by 2x.
temp := newYCC(image.Rect(0, 0, input.Bounds().Dy(), int(width)), input.SubsampleRatio)
- result := newYCC(image.Rect(0, 0, int(width), int(height)), input.SubsampleRatio)
+ result := newYCC(image.Rect(0, 0, int(width), int(height)), image.YCbCrSubsampleRatio444)
coeffs, offset, filterLength := createWeights8(temp.Bounds().Dy(), taps, blur, scaleX, kernel)
in := imageYCbCrToYCC(input)
@@ -409,7 +409,7 @@ func resizeNearest(width, height uint, scaleX, scaleY float64, img image.Image,
// accessing the YCbCr arrays in a tight loop is slow.
// converting the image to ycc increases performance by 2x.
temp := newYCC(image.Rect(0, 0, input.Bounds().Dy(), int(width)), input.SubsampleRatio)
- result := newYCC(image.Rect(0, 0, int(width), int(height)), input.SubsampleRatio)
+ result := newYCC(image.Rect(0, 0, int(width), int(height)), image.YCbCrSubsampleRatio444)
coeffs, offset, filterLength := createWeightsNearest(temp.Bounds().Dy(), taps, blur, scaleX)
in := imageYCbCrToYCC(input)
diff --git a/Godeps/_workspace/src/github.com/nfnt/resize/resize_test.go b/Godeps/_workspace/src/github.com/nfnt/resize/resize_test.go
index ee31ac494..6f6911316 100644
--- a/Godeps/_workspace/src/github.com/nfnt/resize/resize_test.go
+++ b/Godeps/_workspace/src/github.com/nfnt/resize/resize_test.go
@@ -46,7 +46,7 @@ func Test_CorrectResize(t *testing.T) {
}
}
-func Test_SameColor(t *testing.T) {
+func Test_SameColorWithRGBA(t *testing.T) {
img := image.NewRGBA(image.Rect(0, 0, 20, 20))
for y := img.Bounds().Min.Y; y < img.Bounds().Max.Y; y++ {
for x := img.Bounds().Min.X; x < img.Bounds().Max.X; x++ {
@@ -56,9 +56,99 @@ func Test_SameColor(t *testing.T) {
out := Resize(10, 10, img, Lanczos3)
for y := out.Bounds().Min.Y; y < out.Bounds().Max.Y; y++ {
for x := out.Bounds().Min.X; x < out.Bounds().Max.X; x++ {
- color := img.At(x, y).(color.RGBA)
+ color := out.At(x, y).(color.NRGBA)
if color.R != 0x80 || color.G != 0x80 || color.B != 0x80 || color.A != 0xFF {
- t.Fail()
+ t.Errorf("%+v", color)
+ }
+ }
+ }
+}
+
+func Test_SameColorWithNRGBA(t *testing.T) {
+ img := image.NewNRGBA(image.Rect(0, 0, 20, 20))
+ for y := img.Bounds().Min.Y; y < img.Bounds().Max.Y; y++ {
+ for x := img.Bounds().Min.X; x < img.Bounds().Max.X; x++ {
+ img.SetNRGBA(x, y, color.NRGBA{0x80, 0x80, 0x80, 0xFF})
+ }
+ }
+ out := Resize(10, 10, img, Lanczos3)
+ for y := out.Bounds().Min.Y; y < out.Bounds().Max.Y; y++ {
+ for x := out.Bounds().Min.X; x < out.Bounds().Max.X; x++ {
+ color := out.At(x, y).(color.NRGBA)
+ if color.R != 0x80 || color.G != 0x80 || color.B != 0x80 || color.A != 0xFF {
+ t.Errorf("%+v", color)
+ }
+ }
+ }
+}
+
+func Test_SameColorWithRGBA64(t *testing.T) {
+ img := image.NewRGBA64(image.Rect(0, 0, 20, 20))
+ for y := img.Bounds().Min.Y; y < img.Bounds().Max.Y; y++ {
+ for x := img.Bounds().Min.X; x < img.Bounds().Max.X; x++ {
+ img.SetRGBA64(x, y, color.RGBA64{0x8000, 0x8000, 0x8000, 0xFFFF})
+ }
+ }
+ out := Resize(10, 10, img, Lanczos3)
+ for y := out.Bounds().Min.Y; y < out.Bounds().Max.Y; y++ {
+ for x := out.Bounds().Min.X; x < out.Bounds().Max.X; x++ {
+ color := out.At(x, y).(color.NRGBA64)
+ if color.R != 0x8000 || color.G != 0x8000 || color.B != 0x8000 || color.A != 0xFFFF {
+ t.Errorf("%+v", color)
+ }
+ }
+ }
+}
+
+func Test_SameColorWithNRGBA64(t *testing.T) {
+ img := image.NewNRGBA64(image.Rect(0, 0, 20, 20))
+ for y := img.Bounds().Min.Y; y < img.Bounds().Max.Y; y++ {
+ for x := img.Bounds().Min.X; x < img.Bounds().Max.X; x++ {
+ img.SetNRGBA64(x, y, color.NRGBA64{0x8000, 0x8000, 0x8000, 0xFFFF})
+ }
+ }
+ out := Resize(10, 10, img, Lanczos3)
+ for y := out.Bounds().Min.Y; y < out.Bounds().Max.Y; y++ {
+ for x := out.Bounds().Min.X; x < out.Bounds().Max.X; x++ {
+ color := out.At(x, y).(color.NRGBA64)
+ if color.R != 0x8000 || color.G != 0x8000 || color.B != 0x8000 || color.A != 0xFFFF {
+ t.Errorf("%+v", color)
+ }
+ }
+ }
+}
+
+func Test_SameColorWithGray(t *testing.T) {
+ img := image.NewGray(image.Rect(0, 0, 20, 20))
+ for y := img.Bounds().Min.Y; y < img.Bounds().Max.Y; y++ {
+ for x := img.Bounds().Min.X; x < img.Bounds().Max.X; x++ {
+ img.SetGray(x, y, color.Gray{0x80})
+ }
+ }
+ out := Resize(10, 10, img, Lanczos3)
+ for y := out.Bounds().Min.Y; y < out.Bounds().Max.Y; y++ {
+ for x := out.Bounds().Min.X; x < out.Bounds().Max.X; x++ {
+ color := out.At(x, y).(color.Gray)
+ if color.Y != 0x80 {
+ t.Errorf("%+v", color)
+ }
+ }
+ }
+}
+
+func Test_SameColorWithGray16(t *testing.T) {
+ img := image.NewGray16(image.Rect(0, 0, 20, 20))
+ for y := img.Bounds().Min.Y; y < img.Bounds().Max.Y; y++ {
+ for x := img.Bounds().Min.X; x < img.Bounds().Max.X; x++ {
+ img.SetGray16(x, y, color.Gray16{0x8000})
+ }
+ }
+ out := Resize(10, 10, img, Lanczos3)
+ for y := out.Bounds().Min.Y; y < out.Bounds().Max.Y; y++ {
+ for x := out.Bounds().Min.X; x < out.Bounds().Max.X; x++ {
+ color := out.At(x, y).(color.Gray16)
+ if color.Y != 0x8000 {
+ t.Errorf("%+v", color)
}
}
}