2023-08-23 22:04:54 +00:00
|
|
|
package canvas
|
2023-08-20 21:54:06 +00:00
|
|
|
|
|
|
|
import "io"
|
|
|
|
import "image"
|
|
|
|
|
|
|
|
// Texture is a handle that points to a 2D raster image managed by the backend.
|
|
|
|
type Texture interface {
|
2023-09-04 16:07:29 +00:00
|
|
|
image.Image
|
2023-08-20 21:54:06 +00:00
|
|
|
|
|
|
|
// Clip returns a smaller section of this texture, pointing to the same
|
2023-09-04 16:21:17 +00:00
|
|
|
// internal data.
|
2023-08-20 21:54:06 +00:00
|
|
|
Clip (image.Rectangle) Texture
|
|
|
|
}
|
2023-08-20 22:33:20 +00:00
|
|
|
|
2023-09-04 16:21:17 +00:00
|
|
|
// TextureCloser is a texture that can be closed. Anything that receives a
|
|
|
|
// TextureCloser must close it after use.
|
|
|
|
type TextureCloser interface {
|
2023-08-20 22:33:20 +00:00
|
|
|
Texture
|
2023-09-04 16:21:17 +00:00
|
|
|
io.Closer
|
2023-08-20 22:33:20 +00:00
|
|
|
}
|