atlas

package
v2.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BeginFrame

func BeginFrame(graphicsDriver graphicsdriver.Graphics) error

func DumpImages

func DumpImages(graphicsDriver graphicsdriver.Graphics, dir string) error

func EndFrame

func EndFrame(graphicsDriver graphicsdriver.Graphics) error

Types

type Image

type Image struct {
	// contains filtered or unexported fields
}

Image is a rectangle pixel set that might be on an atlas.

func NewImage

func NewImage(width, height int) *Image

func NewScreenFramebufferImage

func NewScreenFramebufferImage(width, height int) *Image

func (*Image) DrawTriangles

func (i *Image) DrawTriangles(srcs [graphics.ShaderImageNum]*Image, vertices []float32, indices []uint16, colorm affine.ColorM, mode graphicsdriver.CompositeMode, filter graphicsdriver.Filter, address graphicsdriver.Address, dstRegion, srcRegion graphicsdriver.Region, subimageOffsets [graphics.ShaderImageNum - 1][2]float32, shader *Shader, uniforms [][]float32, evenOdd bool)

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) DumpScreenshot added in v2.1.4

func (i *Image) DumpScreenshot(graphicsDriver graphicsdriver.Graphics, path string, blackbg bool) error

func (*Image) MarkDisposed

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) Pixels

func (img *Image) Pixels(graphicsDriver graphicsdriver.Graphics) ([]byte, error)

func (*Image) ReplacePixels

func (i *Image) ReplacePixels(pix []byte, mask []byte)

ReplacePixels replaces the pixels on the image. ReplacePixels cannot take a region due to the current implementation. internal/restorable.Image has to record the areas of replaced pixels, and the areas must not be overlapped so far.

func (*Image) SetIndependent added in v2.3.0

func (i *Image) SetIndependent(independent bool)

func (*Image) SetVolatile

func (i *Image) SetVolatile(volatile bool)

type Shader

type Shader struct {
	// contains filtered or unexported fields
}

func NewShader

func NewShader(ir *shaderir.Program) *Shader

func (*Shader) MarkDisposed

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL