BurntSushi / xgbutil

A utility library to make use of the X Go Binding easier. (Implements EWMH and ICCCM specs, key binding support, etc.)
Do What The F*ck You Want To Public License
194 stars 46 forks source link

xgraphics.Image.Subimage return type should be image.Image #29

Closed tv42 closed 8 years ago

tv42 commented 9 years ago

I'd love to treat xgraphics.Image as just another drawing destination, but it doesn't quite match what stdlib does:

stdlib:

func (p *Alpha) SubImage(r Rectangle) Image
func (p *Alpha16) SubImage(r Rectangle) Image
func (p *Gray) SubImage(r Rectangle) Image
func (p *Gray16) SubImage(r Rectangle) Image
func (p *NRGBA) SubImage(r Rectangle) Image
func (p *NRGBA64) SubImage(r Rectangle) Image
func (p *Paletted) SubImage(r Rectangle) Image
func (p *RGBA) SubImage(r Rectangle) Image
func (p *RGBA64) SubImage(r Rectangle) Image
func (p *YCbCr) SubImage(r Rectangle) Image

xgraphics:

func (im *Image) SubImage(r image.Rectangle) *Image