소스 검색

Fix red, green and blue filters

Gildas Chabot 8 년 전
부모
커밋
014db433e7
3개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 1
      pluginSrc/blue/plugin.go
  2. 1 1
      pluginSrc/green/plugin.go
  3. 1 1
      pluginSrc/red/plugin.go

+ 1 - 1
pluginSrc/blue/plugin.go

@@ -13,7 +13,7 @@ func Transform(src image.Image) image.Image {
13 13
 	for x := 0; x < w; x++ {
14 14
 		for y := 0; y < h; y++ {
15 15
 			_, _, b, _ := src.At(x, y).RGBA()
16
-			ret.Set(x, y, color.RGBA{0, 0, uint8(b / 255), 0})
16
+			ret.Set(x, y, color.RGBA{0, 0, uint8(b / 256), 0})
17 17
 		}
18 18
 	}
19 19
 	return ret

+ 1 - 1
pluginSrc/green/plugin.go

@@ -13,7 +13,7 @@ func Transform(src image.Image) image.Image {
13 13
 	for x := 0; x < w; x++ {
14 14
 		for y := 0; y < h; y++ {
15 15
 			_, g, _, _ := src.At(x, y).RGBA()
16
-			ret.Set(x, y, color.RGBA{0, uint8(g / 255), 0, 0})
16
+			ret.Set(x, y, color.RGBA{0, uint8(g / 256), 0, 0})
17 17
 		}
18 18
 	}
19 19
 	return ret

+ 1 - 1
pluginSrc/red/plugin.go

@@ -13,7 +13,7 @@ func Transform(src image.Image) image.Image {
13 13
 	for x := 0; x < w; x++ {
14 14
 		for y := 0; y < h; y++ {
15 15
 			r, _, _, _ := src.At(x, y).RGBA()
16
-			ret.Set(x, y, color.RGBA{uint8(r / 255), 0, 0, 0})
16
+			ret.Set(x, y, color.RGBA{uint8(r / 256), 0, 0, 0})
17 17
 		}
18 18
 	}
19 19
 	return ret