From ae7119f65a326ae336ca896492e2f5c81c5d72a8 Mon Sep 17 00:00:00 2001 From: mappu Date: Sat, 9 Jun 2018 17:38:15 +1200 Subject: [PATCH] delete unused blending functions --- blendcolor.go | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 blendcolor.go diff --git a/blendcolor.go b/blendcolor.go deleted file mode 100644 index 2c597df..0000000 --- a/blendcolor.go +++ /dev/null @@ -1,35 +0,0 @@ -package thumbnail - -import ( - "image/color" -) - -func Blend(a, b color.Color) color.Color { - switch a.(type) { - case color.RGBA: - return BlendRGBA(a.(color.RGBA), b.(color.RGBA)) // FIXME there's syntax for this - - case color.YCbCr: - return BlendYCbCr(a.(color.YCbCr), b.(color.YCbCr)) - - default: - return a // ??? unknown color format - } -} - -func BlendYCbCr(a, b color.YCbCr) color.YCbCr { - return color.YCbCr{ - Y: uint8((int(a.Y) + int(b.Y)) / 2), - Cb: uint8((int(a.Cb) + int(b.Cb)) / 2), - Cr: uint8((int(a.Cr) + int(b.Cr)) / 2), - } -} - -func BlendRGBA(a, b color.RGBA) color.RGBA { - return color.RGBA{ - R: uint8((int(a.R) + int(b.R)) / 2), - G: uint8((int(a.G) + int(b.G)) / 2), - B: uint8((int(a.B) + int(b.B)) / 2), - A: uint8((int(a.A) + int(b.A)) / 2), - } -}