func (d copy) String() string {
	return "Copy"
}
String implemenets fmt.Stringer interface.
package blend
import (
	"image"
	stdcolor "image/color"
	"image/draw"
)
var (
	Clear    draw.Drawer = clear{}
	Copy     draw.Drawer = copy{}
	Dest     draw.Drawer = dest{}
	SrcOver  draw.Drawer = srcOver{}
	DestOver draw.Drawer = destOver{}
	SrcIn    draw.Drawer = srcIn{}
	DestIn   draw.Drawer = destIn{}
	SrcOut   draw.Drawer = srcOut{}
	DestOut  draw.Drawer = destOut{}
	SrcAtop  draw.Drawer = srcAtop{}
	DestAtop draw.Drawer = destAtop{}
	XOR      draw.Drawer = xOR{}
)
type clear struct{}
func (d clear) String() string {
	return "Clear"
}
func (d clear) Draw(dst draw.Image, r image.Rectangle, src image.Image, sp image.Point) {
	drawMask(d, dst, r, src, sp, nil, image.Point{})
}
func (d clear) drawNRGBAToNRGBAUniform(dst *image.NRGBA, r image.Rectangle, src *image.NRGBA, sp image.Point, mask *image.Uniform) {
	alpha := uint32(0xffff)
	if mask != nil {
		_, _, _, alpha = mask.C.RGBA()
		if alpha == 0 {
			return
		}
	}
	d0, dx0, dx1, dxDelta, dyDelta, s0, sx0, sx1, sxDelta, syDelta := prepare4to4(dst, src, dst.Stride, src.Stride, r, sp)
	drawClearNRGBAToNRGBA.Parallel(dst.Pix, src.Pix, alpha, d0, s0, r.Dy(), sx0, sx1, sxDelta, syDelta, dx0, dx1, dxDelta, dyDelta)
}
func (d clear) drawRGBAToNRGBAUniform(dst *image.NRGBA, r image.Rectangle, src *image.RGBA, sp image.Point, mask *image.Uniform) {
	alpha := uint32(0xffff)
	if mask != nil {
		_, _, _, alpha = mask.C.RGBA()
		if alpha == 0 {
			return
		}
	}
	d0, dx0, dx1, dxDelta, dyDelta, s0, sx0, sx1, sxDelta, syDelta := prepare4to4(dst, src, dst.Stride, src.Stride, r, sp)
	drawClearRGBAToNRGBA.Parallel(dst.Pix, src.Pix, alpha, d0, s0, r.Dy(), sx0, sx1, sxDelta, syDelta, dx0, dx1, dxDelta, dyDelta)
}
func (d clear) drawNRGBAToRGBAUniform(dst *image.RGBA, r image.Rectangle, src *image.NRGBA, sp image.Point, mask *image.Uniform) {
	alpha := uint32(0xffff)
	if mask != nil {
		_, _, _, alpha = mask.C.RGBA()
		if alpha == 0 {
			return
		}
	}
	d0, dx0, dx1, dxDelta, dyDelta, s0, sx0, sx1, sxDelta, syDelta := prepare4to4(dst, src, dst.Stride, src.Stride, r, sp)
	drawClearNRGBAToRGBA.Parallel(dst.Pix, src.Pix, alpha, d0, s0, r.Dy(), sx0, sx1, sxDelta, syDelta, dx0, dx1, dxDelta, dyDelta)
}
func (d clear) drawRGBAToRGBAUniform(dst *image.RGBA, r image.Rectangle, src *image.RGBA, sp image.Point, mask *image.Uniform) {
	alpha := uint32(0xffff)
	if mask != nil {
		_, _, _, alpha = mask.C.RGBA()
		if alpha == 0 {
			return
		}
	}
	d0, dx0, dx1, dxDelta, dyDelta, s0, sx0, sx1, sxDelta, syDelta := prepare4to4(dst, src, dst.Stride, src.Stride, r, sp)
	drawClearRGBAToRGBA.Parallel(dst.Pix, src.Pix, alpha, d0, s0, r.Dy(), sx0, sx1, sxDelta, syDelta, dx0, dx1, dxDelta, dyDelta)
}
func (d clear) drawAlphaToNRGBAUniform(dst *image.NRGBA, r image.Rectangle, src *image.Alpha, sp image.Point, mask *image.Uniform) {
	alpha := uint32(0xffff)
	if mask != nil {
		_, _, _, alpha = mask.C.RGBA()
		if alpha == 0 {
			return
		}
	}
	d0, dx0, dx1, dxDelta, dyDelta, s0, sx0, sx1, sxDelta, syDelta := prepare1to4(dst, src, dst.Stride, src.Stride, r, sp)
	drawClearAlphaToNRGBA.Parallel(dst.Pix, src.Pix, alpha, d0, s0, r.Dy(), sx0, sx1, sxDelta, syDelta, dx0, dx1, dxDelta, dyDelta)
}
func (d clear) drawAlphaToRGBAUniform(dst *image.RGBA, r image.Rectangle, src *image.Alpha, sp image.Point, mask *image.Uniform) {
	alpha := uint32(0xffff)
	if mask != nil {
		_, _, _, alpha = mask.C.RGBA()
		if alpha == 0 {
			return
		}
	}
	d0, dx0, dx1, dxDelta, dyDelta, s0, sx0, sx1, sxDelta, syDelta := prepare1to4(dst, src, dst.Stride, src.Stride, r, sp)
	drawClearAlphaToRGBA.Parallel(dst.Pix, src.Pix, alpha, d0, s0, r.Dy(), sx0, sx1, sxDelta, syDelta, dx0, dx1, dxDelta, dyDelta)
}
func (d clear) drawUniformToNRGBAUniform(dst *image.NRGBA, r image.Rectangle, src *image.Uniform, sp image.Point, mask *image.Uniform) {
	alpha := uint32(0xffff)
	if mask != nil {
		_, _, _, alpha = mask.C.RGBA()
		if alpha == 0 {
			return
		}
	}
	sr, sg, sb, sa := src.C.RGBA()
	if alpha == 0x00 {
		sr, sg, sb, sa = 0, 0, 0, 0
	} else if alpha != 0xffff {
		sr = sr * alpha / 0xffff
		sg = sg * alpha / 0xffff
		sb = sb * alpha / 0xffff
		sa = sa * alpha / 0xffff
	}
	drawClearUniformToNRGBA.Parallel(dst.Pix[dst.PixOffset(r.Min.X, r.Min.Y):], sr, sg, sb, sa, r.Dy(), 0, r.Dx()<<2, 4, dst.Stride)
}
func (d clear) drawUniformToRGBAUniform(dst *image.RGBA, r image.Rectangle, src *image.Uniform, sp image.Point, mask *image.Uniform) {
	alpha := uint32(0xffff)
	if mask != nil {
		_, _, _, alpha = mask.C.RGBA()
		if alpha == 0 {
			return
		}
	}
	sr, sg, sb, sa := src.C.RGBA()
	if alpha == 0x00 {
		sr, sg, sb, sa = 0, 0, 0, 0
	} else if alpha != 0xffff {
		sr = sr * alpha / 0xffff
		sg = sg * alpha / 0xffff
		sb = sb * alpha / 0xffff
		sa = sa * alpha / 0xffff
	}
	drawClearUniformToRGBA.Parallel(dst.Pix[dst.PixOffset(r.Min.X, r.Min.Y):], sr, sg, sb, sa, r.Dy(), 0, r.Dx()<<2, 4, dst.Stride)
}
var drawClearNRGBAToNRGBA drawFunc = func(dest []byte, src []byte, alpha uint32, d0, s0, y int, sx0 int, sx1 int, sxDelta int, syDelta int, dx0 int, dx1 int, dxDelta int, dyDelta int) {
	for ; y > 0; y-- {
		dpix := dest[d0:]
		for i, j := sx0, dx0; i != sx1; i, j = i+sxDelta, j+dxDelta {
			var r, g, b, a, tmp uint32
			_ = tmp
			dpix[j+3] = uint8(a >> 8)
			if a == 0xffff {
				dpix[j+2] = uint8(b >> 8)
				dpix[j+1] = uint8(g >> 8)
				dpix[j+0] = uint8(r >> 8)
			} else if a == 0 {
				dpix[j+2] = 0
				dpix[j+1] = 0
				dpix[j+0] = 0
			} else {
				dpix[j+2] = uint8((b * 0xffff / a) >> 8)
				dpix[j+1] = uint8((g * 0xffff / a) >> 8)
				dpix[j+0] = uint8((r * 0xffff / a) >> 8)
			}
		}
		d0 += dyDelta
		s0 += syDelta
	}
}
var drawClearRGBAToNRGBA drawFunc = func(dest []byte, src []byte, alpha uint32, d0, s0, y int, sx0 int, sx1 int, sxDelta int, syDelta int, dx0 int, dx1 int, dxDelta int, dyDelta int) {
	for ; y > 0; y-- {
		dpix := dest[d0:]
		for i, j := sx0, dx0; i != sx1; i, j = i+sxDelta, j+dxDelta {
			var r, g, b, a, tmp uint32
			_ = tmp
			dpix[j+3] = uint8(a >> 8)
			if a == 0xffff {
				dpix[j+2] = uint8(b >> 8)
				dpix[j+1] = uint8(g >> 8)
				dpix[j+0] = uint8(r >> 8)
			} else if a == 0 {
				dpix[j+2] = 0
				dpix[j+1] = 0
				dpix[j+0] = 0
			} else {
				dpix[j+2] = uint8((b * 0xffff / a) >> 8)
				dpix[j+1] = uint8((g * 0xffff / a) >> 8)
				dpix[j+0] = uint8((r * 0xffff / a) >> 8)
			}
		}
		d0 += dyDelta
		s0 += syDelta
	}
}
var drawClearNRGBAToRGBA drawFunc = func(dest []byte, src []byte, alpha uint32, d0, s0, y int, sx0 int, sx1 int, sxDelta int, syDelta int, dx0 int, dx1 int, dxDelta int, dyDelta int) {
	for ; y > 0; y-- {
		dpix := dest[d0:]
		for i, j := sx0, dx0; i != sx1; i, j = i+sxDelta, j+dxDelta {
			var r, g, b, a, tmp uint32
			_ = tmp
			dpix[j+3] = uint8(a >> 8)
			dpix[j+2] = uint8(b >> 8)
			dpix[j+1] = uint8(g >> 8)
			dpix[j+0] = uint8(r >> 8)
		}
		d0 += dyDelta
		s0 += syDelta
	}
}
var drawClearRGBAToRGBA drawFunc = func(dest []byte, src []byte, alpha uint32, d0, s0, y int, sx0 int, sx1 int, sxDelta int, syDelta int, dx0 int, dx1 int, dxDelta int, dyDelta int) {
	for ; y > 0; y-- {
		dpix := dest[d0:]
		for i, j := sx0, dx0; i != sx1; i, j = i+sxDelta, j+dxDelta {
			var r, g, b, a, tmp uint32
			_ = tmp
			dpix[j+3] = uint8(a >> 8)
			dpix[j+2] = uint8(b >> 8)
			dpix[j+1] = uint8(g >> 8)
			dpix[j+0] = uint8(r >> 8)
		}
		d0 += dyDelta
		s0 += syDelta
	}
}
var drawClearAlphaToNRGBA drawFunc = func(dest []byte, src []byte, alpha uint32, d0, s0, y int, sx0 int, sx1 int, sxDelta int, syDelta int, dx0 int, dx1 int, dxDelta int, dyDelta int) {
	const (
		sb = 0
		sg = 0
		sr = 0
	)
	for ; y > 0; y-- {
		dpix := dest[d0:]
		for i, j := sx0, dx0; i != sx1; i, j = i+sxDelta, j+dxDelta {
			var r, g, b, a, tmp uint32
			_ = tmp
			dpix[j+3] = uint8(a >> 8)
			if a == 0xffff {
				dpix[j+2] = uint8(b >> 8)
				dpix[j+1] = uint8(g >> 8)
				dpix[j+0] = uint8(r >> 8)
			} else if a == 0 {
				dpix[j+2] = 0
				dpix[j+1] = 0
				dpix[j+0] = 0
			} else {
				dpix[j+2] = uint8((b * 0xffff / a) >> 8)
				dpix[j+1] = uint8((g * 0xffff / a) >> 8)
				dpix[j+0] = uint8((r * 0xffff / a) >> 8)
			}
		}
		d0 += dyDelta
		s0 += syDelta
	}
}
var drawClearAlphaToRGBA drawFunc = func(dest []byte, src []byte, alpha uint32, d0, s0, y int, sx0 int, sx1 int, sxDelta int, syDelta int, dx0 int, dx1 int, dxDelta int, dyDelta int) {
	const (
		sb = 0
		sg = 0
		sr = 0
	)
	for ; y > 0; y-- {
		dpix := dest[d0:]
		for i, j := sx0, dx0; i != sx1; i, j = i+sxDelta, j+dxDelta {
			var r, g, b, a, tmp uint32
			_ = tmp
			dpix[j+3] = uint8(a >> 8)
			dpix[j+2] = uint8(b >> 8)
			dpix[j+1] = uint8(g >> 8)
			dpix[j+0] = uint8(r >> 8)
		}
		d0 += dyDelta
		s0 += syDelta
	}
}
var drawClearUniformToNRGBA drawUniformFunc = func(dest []byte, sr, sg, sb, sa uint32, y int, dx0 int, dx1 int, dxDelta int, dyDelta int) {
	var dPos int
	for ; y > 0; y-- {
		dpix := dest[dPos:]
		for j := dx0; j != dx1; j += dxDelta {
			var r, g, b, a, tmp uint32
			_ = tmp
			dpix[j+3] = uint8(a >> 8)
			if a == 0xffff {
				dpix[j+2] = uint8(b >> 8)
				dpix[j+1] = uint8(g >> 8)
				dpix[j+0] = uint8(r >> 8)
			} else if a == 0 {
				dpix[j+2] = 0
				dpix[j+1] = 0
				dpix[j+0] = 0
			} else {
				dpix[j+2] = uint8((b * 0xffff / a) >> 8)
				dpix[j+1] = uint8((g * 0xffff / a) >> 8)
				dpix[j+0] = uint8((r * 0xffff / a) >> 8)
			}
		}
		dPos += dyDelta
	}
}
var drawClearUniformToRGBA drawUniformFunc = func(dest []byte, sr, sg, sb, sa uint32, y int, dx0 int, dx1 int, dxDelta int, dyDelta int) {
	var dPos int
	for ; y > 0; y-- {
		dpix := dest[dPos:]
		for j := dx0; j != dx1; j += dxDelta {
			var r, g, b, a, tmp uint32
			_ = tmp
			dpix[j+3] = uint8(a >> 8)
			dpix[j+2] = uint8(b >> 8)
			dpix[j+1] = uint8(g >> 8)
			dpix[j+0] = uint8(r >> 8)
		}
		dPos += dyDelta
	}
}
func (d clear) drawFallback(dst draw.Image, r image.Rectangle, src image.Image, sp image.Point, mask image.Image, mp image.Point) {
	x0, x1, dx := r.Min.X, r.Max.X, 1
	y0, y1, dy := r.Min.Y, r.Max.Y, 1
	if processBackward(dst, r, src, sp) {
		x0, x1, dx = x1-1, x0-1, -1
		y0, y1, dy = y1-1, y0-1, -1
	}
	var out stdcolor.RGBA64
	sy := sp.Y + y0 - r.Min.Y
	my := mp.Y + y0 - r.Min.Y
	for y := y0; y != y1; y, sy, my = y+dy, sy+dy, my+dy {
		sx := sp.X + x0 - r.Min.X
		mx := mp.X + x0 - r.Min.X
		for x := x0; x != x1; x, sx, mx = x+dx, sx+dx, mx+dx {
			ma := uint32(0xffff)
			if mask != nil {
				_, _, _, ma = mask.At(mx, my).RGBA()
			}
			if ma == 0 {
				continue
			}
			var a, r, g, b, tmp uint32
			_ = tmp
			out.R = uint16(r)
			out.G = uint16(g)
			out.B = uint16(b)
			out.A = uint16(a)
			dst.Set(x, y, &out)
		}
	}
}
type copy struct{}