shareable

package
v1.11.7 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const MaxCountForShare = 10

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 DumpImages(dir string) error

func EndFrame added in v1.10.0

func EndFrame() error

func SetGraphicsDriver added in v1.10.0

func SetGraphicsDriver(graphics driver.Graphics)

Types

type Image

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

func NewImage

func NewImage(width, height int, volatile bool) *Image

func NewScreenFramebufferImage

func NewScreenFramebufferImage(width, height int) *Image

func (*Image) At

func (i *Image) At(x, y int) (byte, byte, byte, byte, error)

func (*Image) DrawTriangles added in v1.10.0

func (i *Image) DrawTriangles(img *Image, vertices []float32, indices []uint16, colorm *affine.ColorM, mode driver.CompositeMode, filter driver.Filter, address driver.Address)

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:  Bounds of the source min X in pixels
5:  Bounds of the source min Y in pixels
6:  Bounds of the source max X in pixels
7:  Bounds of the source max Y in pixels
8:  Color R [0.0-1.0]
9:  Color G
10: Color B
11: Color Y

func (*Image) Dump added in v1.10.0

func (i *Image) Dump(path string, blackbg bool) error

func (*Image) Fill added in v1.9.0

func (i *Image) Fill(clr color.RGBA)

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 (i *Image) ReplacePixels(p []byte)

Jump to

Keyboard shortcuts

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