p.Pix[y*p.Stride+x] = c
}
+// SubImage returns an image representing the portion of the image p visible
+// through r. The returned value shares pixels with the original image.
+func (p *RGBA) SubImage(r Rectangle) Image {
+ return &RGBA{
+ Pix: p.Pix,
+ Stride: p.Stride,
+ Rect: p.Rect.Intersect(r),
+ }
+}
+
// Opaque scans the entire image and returns whether or not it is fully opaque.
func (p *RGBA) Opaque() bool {
if p.Rect.Empty() {
p.Pix[y*p.Stride+x] = c
}
+// SubImage returns an image representing the portion of the image p visible
+// through r. The returned value shares pixels with the original image.
+func (p *RGBA64) SubImage(r Rectangle) Image {
+ return &RGBA64{
+ Pix: p.Pix,
+ Stride: p.Stride,
+ Rect: p.Rect.Intersect(r),
+ }
+}
+
// Opaque scans the entire image and returns whether or not it is fully opaque.
func (p *RGBA64) Opaque() bool {
if p.Rect.Empty() {
p.Pix[y*p.Stride+x] = c
}
+// SubImage returns an image representing the portion of the image p visible
+// through r. The returned value shares pixels with the original image.
+func (p *NRGBA) SubImage(r Rectangle) Image {
+ return &NRGBA{
+ Pix: p.Pix,
+ Stride: p.Stride,
+ Rect: p.Rect.Intersect(r),
+ }
+}
+
// Opaque scans the entire image and returns whether or not it is fully opaque.
func (p *NRGBA) Opaque() bool {
if p.Rect.Empty() {
p.Pix[y*p.Stride+x] = c
}
+// SubImage returns an image representing the portion of the image p visible
+// through r. The returned value shares pixels with the original image.
+func (p *NRGBA64) SubImage(r Rectangle) Image {
+ return &NRGBA64{
+ Pix: p.Pix,
+ Stride: p.Stride,
+ Rect: p.Rect.Intersect(r),
+ }
+}
+
// Opaque scans the entire image and returns whether or not it is fully opaque.
func (p *NRGBA64) Opaque() bool {
if p.Rect.Empty() {
p.Pix[y*p.Stride+x] = c
}
+// SubImage returns an image representing the portion of the image p visible
+// through r. The returned value shares pixels with the original image.
+func (p *Alpha) SubImage(r Rectangle) Image {
+ return &Alpha{
+ Pix: p.Pix,
+ Stride: p.Stride,
+ Rect: p.Rect.Intersect(r),
+ }
+}
+
// Opaque scans the entire image and returns whether or not it is fully opaque.
func (p *Alpha) Opaque() bool {
if p.Rect.Empty() {
p.Pix[y*p.Stride+x] = c
}
+// SubImage returns an image representing the portion of the image p visible
+// through r. The returned value shares pixels with the original image.
+func (p *Alpha16) SubImage(r Rectangle) Image {
+ return &Alpha16{
+ Pix: p.Pix,
+ Stride: p.Stride,
+ Rect: p.Rect.Intersect(r),
+ }
+}
+
// Opaque scans the entire image and returns whether or not it is fully opaque.
func (p *Alpha16) Opaque() bool {
if p.Rect.Empty() {
p.Pix[y*p.Stride+x] = c
}
+// SubImage returns an image representing the portion of the image p visible
+// through r. The returned value shares pixels with the original image.
+func (p *Gray) SubImage(r Rectangle) Image {
+ return &Gray{
+ Pix: p.Pix,
+ Stride: p.Stride,
+ Rect: p.Rect.Intersect(r),
+ }
+}
+
// Opaque scans the entire image and returns whether or not it is fully opaque.
func (p *Gray) Opaque() bool {
return true
p.Pix[y*p.Stride+x] = c
}
+// SubImage returns an image representing the portion of the image p visible
+// through r. The returned value shares pixels with the original image.
+func (p *Gray16) SubImage(r Rectangle) Image {
+ return &Gray16{
+ Pix: p.Pix,
+ Stride: p.Stride,
+ Rect: p.Rect.Intersect(r),
+ }
+}
+
// Opaque scans the entire image and returns whether or not it is fully opaque.
func (p *Gray16) Opaque() bool {
return true
p.Pix[y*p.Stride+x] = index
}
+// SubImage returns an image representing the portion of the image p visible
+// through r. The returned value shares pixels with the original image.
+func (p *Paletted) SubImage(r Rectangle) Image {
+ return &Paletted{
+ Pix: p.Pix,
+ Stride: p.Stride,
+ Rect: p.Rect.Intersect(r),
+ Palette: p.Palette,
+ }
+}
+
// Opaque scans the entire image and returns whether or not it is fully opaque.
func (p *Paletted) Opaque() bool {
for _, c := range p.Palette {