|
|
|
|
@ -17,13 +17,13 @@ const ( |
|
|
|
|
|
|
|
|
|
type PosterizeFilter struct { |
|
|
|
|
Depth uint16 |
|
|
|
|
Bins map[uint16]uint16 |
|
|
|
|
Bins [math.MaxUint16]uint16 |
|
|
|
|
DitherType int |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func Posterize(depth uint16, dither_type int) gift.Filter { |
|
|
|
|
var i uint16 |
|
|
|
|
bins := make(map[uint16]uint16) |
|
|
|
|
var bins [math.MaxUint16]uint16 |
|
|
|
|
chunk := uint16((math.MaxUint16 + 1) / int(depth)) |
|
|
|
|
|
|
|
|
|
// BUG: this was fine with uint8, now it's dumb as hell
|
|
|
|
|
|