22 lines
555 B
Go
22 lines
555 B
Go
package canvas
|
|
|
|
import "io"
|
|
import "image"
|
|
|
|
// Texture is a handle that points to a 2D raster image managed by the backend.
|
|
type Texture interface {
|
|
image.Image
|
|
|
|
// SubTexture returns a returns a Texture representing the portion of
|
|
// this Texture visible through a rectangle. The returned value shares
|
|
// pixels with the original Texture.
|
|
SubTexture (image.Rectangle) Texture
|
|
}
|
|
|
|
// TextureCloser is a texture that can be closed. Anything that receives a
|
|
// TextureCloser must close it after use.
|
|
type TextureCloser interface {
|
|
Texture
|
|
io.Closer
|
|
}
|