graphics

package
v1.9.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IndicesNum     = (1 << 16) / 3 * 3 // Adjust num for triangles.
	VertexFloatNum = 12
)
View Source
const TexelAdjustmentFactor = 512.0

Variables

This section is empty.

Functions

func CopyImage added in v1.5.0

func CopyImage(img image.Image) []byte

CopyImage copies img to a new RGBA image.

Basically CopyImage just calls draw.Draw. If img is a paletted image, an optimized copying method is used.

CopyImage is used only internally but it is exposed for testing.

func InternalImageSize added in v1.9.0

func InternalImageSize(x int) int

InternalImageSize returns a nearest appropriate size as an internal image.

func MipmapLevel added in v1.9.0

func MipmapLevel(det float32) int

MipmapLevel returns an appropriate mipmap level for the given determinant of a geometry matrix.

MipmapLevel returns -1 if det is 0.

MipmapLevel panics if det is NaN.

func QuadIndices added in v1.9.0

func QuadIndices() []uint16

func QuadVertices added in v1.9.0

func QuadVertices(width, height int, sx0, sy0, sx1, sy1 int, a, b, c, d, tx, ty float32, cr, cg, cb, ca float32) []float32

Types

type Address added in v1.9.0

type Address int
const (
	AddressClampToZero Address = iota
	AddressRepeat
)

type CompositeMode added in v1.9.0

type CompositeMode int
const (
	CompositeModeSourceOver CompositeMode = iota // This value must be 0 (= initial value)
	CompositeModeClear
	CompositeModeCopy
	CompositeModeDestination
	CompositeModeDestinationOver
	CompositeModeSourceIn
	CompositeModeDestinationIn
	CompositeModeSourceOut
	CompositeModeDestinationOut
	CompositeModeSourceAtop
	CompositeModeDestinationAtop
	CompositeModeXor
	CompositeModeLighter
	CompositeModeUnknown

	CompositeModeMax = CompositeModeLighter
)

func (CompositeMode) Operations added in v1.9.0

func (c CompositeMode) Operations() (src Operation, dst Operation)

type Filter added in v1.6.0

type Filter int
const (
	FilterDefault Filter = iota
	FilterNearest
	FilterLinear
	FilterScreen
)

type Operation added in v1.9.0

type Operation int
const (
	Zero Operation = iota
	One
	SrcAlpha
	DstAlpha
	OneMinusSrcAlpha
	OneMinusDstAlpha
)

Jump to

Keyboard shortcuts

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