Beispiel #1
0
func newAtFuncAlpha16(p *image.Alpha16) AtFunc {
	return func(x, y int) (r, g, b, a uint32) {
		i := p.PixOffset(x, y)
		a = uint32(p.Pix[i+0])<<8 | uint32(p.Pix[i+1])
		return a, a, a, a
	}
}
Beispiel #2
0
func newSetFuncAlpha16(p *image.Alpha16) SetFunc {
	return func(x, y int, r, g, b, a uint32) {
		i := p.PixOffset(x, y)
		a16 := uint16(a)
		p.Pix[i+0] = uint8(a16 >> 8)
		p.Pix[i+1] = uint8(a16)
	}
}