Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Riemersma = riemersma{}
Riemersma is a singleton [Drawer] that does Riemersma dithering to src image and draw result on dst image
Functions ¶
This section is empty.
Types ¶
type AnyImage ¶
type AnyImage struct { Dst draw.Image Dp image.Point Src image.Image Sp image.Point // contains filtered or unexported fields }
func (AnyImage) ColorNumChannels ¶
func (AnyImage) DitherPixel ¶
func (img AnyImage) DitherPixel(x int, y int, accErr ColorError) ColorError
type Image ¶
type Image interface { Size() image.Point // image size ColorNumChannels() int // number of color channels DitherPixel(x int, y int, accErr ColorError) ColorError // Dither pixel with accumulated error }
type RiemersmaDither ¶
type RiemersmaDither struct { Ratio float64 // weight ratio between youngest pixel and oldest pixel Weights []float64 // pre-calculated weights // contains filtered or unexported fields }
func NewRiemersmaDither ¶
func NewRiemersmaDither(queueSize int, ratio float64) *RiemersmaDither
Create new Riemersma dither operation with specific queueSize and ratio queueSize is the number of most recent pixel quantization errors to remember ratio is weight ratio between youngest pixel and oldest pixel
func (*RiemersmaDither) AccumulatedError ¶
func (rs *RiemersmaDither) AccumulatedError(numChannel int) ColorError
func (*RiemersmaDither) Dither ¶
func (rs *RiemersmaDither) Dither(image Image)
Click to show internal directories.
Click to hide internal directories.