Documentation ¶
Index ¶
- Constants
- func BeginFrame() error
- func DumpImages(dir string) error
- func EndFrame() error
- func SetGraphicsDriver(graphics driver.Graphics)
- type Image
- func (i *Image) DrawTriangles(srcs [graphics.ShaderImageNum]*Image, vertices []float32, indices []uint16, ...)
- func (i *Image) Dump(path string, blackbg bool) error
- func (i *Image) Fill(clr color.RGBA)
- func (i *Image) MarkDisposed()
- func (img *Image) Pixels(x, y, width, height int) ([]byte, error)
- func (i *Image) ReplacePixels(pix []byte)
- func (i *Image) SetVolatile(volatile bool)
- type Shader
Constants ¶
MaxCountForShare represents the time duration when the image can become shared.
This value is exported for testing.
Variables ¶
This section is empty.
Functions ¶
func BeginFrame ¶ added in v1.10.0
func BeginFrame() error
func DumpImages ¶ added in v1.10.0
func SetGraphicsDriver ¶ added in v1.10.0
Types ¶
type Image ¶
type Image struct {
// contains filtered or unexported fields
}
func (*Image) DrawTriangles ¶ added in v1.10.0
func (i *Image) DrawTriangles(srcs [graphics.ShaderImageNum]*Image, vertices []float32, indices []uint16, colorm *affine.ColorM, mode driver.CompositeMode, filter driver.Filter, address driver.Address, sourceRegion driver.Region, shader *Shader, uniforms []interface{})
DrawTriangles draws triangles with the given image.
The vertex floats are:
0: Destination X in pixels 1: Destination Y in pixels 2: Source X in pixels (the upper-left is (0, 0)) 3: Source Y in pixels 4: Color R [0.0-1.0] 5: Color G 6: Color B 7: Color Y
func (*Image) MarkDisposed ¶ added in v1.10.0
func (i *Image) MarkDisposed()
MarkDisposed marks the image as disposed. The actual operation is deferred. MarkDisposed can be called from finalizers.
A function from finalizer must not be blocked, but disposing operation can be blocked. Defer this operation until it becomes safe. (#913)
func (*Image) ReplacePixels ¶
func (*Image) SetVolatile ¶ added in v1.12.0
type Shader ¶ added in v1.12.0
type Shader struct {
// contains filtered or unexported fields
}
func (*Shader) MarkDisposed ¶ added in v1.12.0
func (s *Shader) MarkDisposed()
MarkDisposed marks the shader as disposed. The actual operation is deferred. MarkDisposed can be called from finalizers.
A function from finalizer must not be blocked, but disposing operation can be blocked. Defer this operation until it becomes safe. (#913)