Imports #
"image"
"image/color"
"image/internal/imageutil"
"image"
"image/color"
"image/internal/imageutil"
FloydSteinberg is a [Drawer] that is the [Src] [Op] with Floyd-Steinberg error diffusion.
var FloydSteinberg Drawer = floydSteinberg{...}
Over specifies ``(src in mask) over dst''.
const Over Op = iota
Src specifies ``src in mask''.
const Src
m is the maximum color value returned by image.Color.RGBA.
const m = *ast.BinaryExpr
Op is a Porter-Duff compositing operator.
type Op int
Drawer contains the [Draw] method.
type Drawer interface {
Draw(dst Image, r image.Rectangle, src image.Image, sp image.Point)
}
Image is an image.Image with a Set method to change a single pixel.
type Image interface {
image.Image
Set(x int, y int, c color.Color)
}
Quantizer produces a palette for an image.
type Quantizer interface {
Quantize(p color.Palette, m image.Image) color.Palette
}
RGBA64Image extends both the [Image] and [image.RGBA64Image] interfaces with a SetRGBA64 method to change a single pixel. SetRGBA64 is equivalent to calling Set, but it can avoid allocations from converting concrete color types to the [color.Color] interface type.
type RGBA64Image interface {
image.RGBA64Image
Set(x int, y int, c color.Color)
SetRGBA64(x int, y int, c color.RGBA64)
}
type floydSteinberg struct {
}
func (floydSteinberg) Draw(dst Image, r image.Rectangle, src image.Image, sp image.Point)
Draw calls [DrawMask] with a nil mask.
func Draw(dst Image, r image.Rectangle, src image.Image, sp image.Point, op Op)
Draw implements the [Drawer] interface by calling the Draw function with this [Op].
func (op Op) Draw(dst Image, r image.Rectangle, src image.Image, sp image.Point)
DrawMask aligns r.Min in dst with sp in src and mp in mask and then replaces the rectangle r in dst with the result of a Porter-Duff composition. A nil mask is treated as opaque.
func DrawMask(dst Image, r image.Rectangle, src image.Image, sp image.Point, mask image.Image, mp image.Point, op Op)
clamp clamps i to the interval [0, 0xffff].
func clamp(i int32) int32
clip clips r against each image's bounds (after translating into the destination image's coordinate space) and shifts the points sp and mp by the same amount as the change in r.Min.
func clip(dst Image, r *image.Rectangle, src image.Image, sp *image.Point, mask image.Image, mp *image.Point)
func drawCMYK(dst *image.RGBA, r image.Rectangle, src *image.CMYK, sp image.Point)
func drawCopyOver(dst *image.RGBA, r image.Rectangle, src *image.RGBA, sp image.Point)
drawCopySrc copies bytes to dstPix from srcPix. These arguments roughly correspond to the Pix fields of the image package's concrete image.Image implementations, but are offset (dstPix is dst.Pix[dpOffset:] not dst.Pix).
func drawCopySrc(dstPix []byte, dstStride int, r image.Rectangle, srcPix []byte, srcStride int, sp image.Point, bytesPerRow int)
func drawFillOver(dst *image.RGBA, r image.Rectangle, sr uint32, sg uint32, sb uint32, sa uint32)
func drawFillSrc(dst *image.RGBA, r image.Rectangle, sr uint32, sg uint32, sb uint32, sa uint32)
func drawGlyphOver(dst *image.RGBA, r image.Rectangle, src *image.Uniform, mask *image.Alpha, mp image.Point)
func drawGray(dst *image.RGBA, r image.Rectangle, src *image.Gray, sp image.Point)
func drawGrayMaskOver(dst *image.RGBA, r image.Rectangle, src *image.Gray, sp image.Point, mask *image.Alpha, mp image.Point)
func drawNRGBAOver(dst *image.RGBA, r image.Rectangle, src *image.NRGBA, sp image.Point)
func drawNRGBASrc(dst *image.RGBA, r image.Rectangle, src *image.NRGBA, sp image.Point)
func drawPaletted(dst Image, r image.Rectangle, src image.Image, sp image.Point, floydSteinberg bool)
func drawRGBA(dst *image.RGBA, r image.Rectangle, src image.Image, sp image.Point, mask image.Image, mp image.Point, op Op)
func drawRGBA64ImageMaskOver(dst *image.RGBA, r image.Rectangle, src image.RGBA64Image, sp image.Point, mask *image.Alpha, mp image.Point)
func drawRGBAMaskOver(dst *image.RGBA, r image.Rectangle, src *image.RGBA, sp image.Point, mask *image.Alpha, mp image.Point)
func processBackward(dst image.Image, r image.Rectangle, src image.Image, sp image.Point) bool
sqDiff returns the squared-difference of x and y, shifted by 2 so that adding four of those won't overflow a uint32. x and y are both assumed to be in the range [0, 0xffff].
func sqDiff(x int32, y int32) uint32
Generated with Arrow