No need to use map, just use an array. Duh.

master
Zed A. Shaw 1 month ago
parent 20d1afa458
commit f19caf9b96
  1. 4
      filters/posterize.go

@ -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

Loading…
Cancel
Save