Sfoglia il codice sorgente

Fix red, green and blue filters

Gildas Chabot 8 anni fa
parent
commit
014db433e7
3 ha cambiato i file con 3 aggiunte e 3 eliminazioni
  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