colorm

package
v2.5.0-alpha.6 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2022 License: Apache-2.0 Imports: 4 Imported by: 39

Documentation

Index

Constants

View Source
const Dim = ebiten.ColorMDim

Dim is a dimension of a ColorM.

Variables

This section is empty.

Functions

func DrawImage

func DrawImage(dst, src *ebiten.Image, colorM ColorM, op *DrawImageOptions)

DrawImage draws src onto dst.

DrawImage is basically the same as ebiten.DrawImage, but with a color matrix.

func DrawTriangles

func DrawTriangles(dst *ebiten.Image, vertices []ebiten.Vertex, indices []uint16, img *ebiten.Image, colorM ColorM, op *DrawTrianglesOptions)

DrawTriangles draws triangles onto dst.

DrawTriangles is basically the same as ebiten.DrawTriangles, but with a color matrix.

Types

type ColorM

type ColorM = ebiten.ColorM

ColorM represents a matrix to transform coloring when rendering an image.

ColorM is applied to the straight alpha color while an Image's pixels' format is alpha premultiplied. Before applying a matrix, a color is un-multiplied, and after applying the matrix, the color is multiplied again.

The initial value is identity.

type DrawImageOptions

type DrawImageOptions struct {
	// GeoM is a geometry matrix to draw.
	// The default (zero) value is identity, which draws the image at (0, 0).
	GeoM ebiten.GeoM

	// Blend is a blending way of the source color and the destination color.
	// The default (zero) value is the regular alpha blending.
	Blend ebiten.Blend

	// Filter is a type of texture filter.
	// The default (zero) value is ebiten.FilterNearest.
	Filter ebiten.Filter
}

DrawImageOptions represents options for DrawImage.

type DrawTrianglesOptions

type DrawTrianglesOptions struct {
	// ColorScaleMode is the mode of color scales in vertices.
	// The default (zero) value is ebiten.ColorScaleModeStraightAlpha.
	ColorScaleMode ebiten.ColorScaleMode

	// Blend is a blending way of the source color and the destination color.
	// The default (zero) value is the regular alpha blending.
	Blend ebiten.Blend

	// Filter is a type of texture filter.
	// The default (zero) value is ebiten.FilterNearest.
	Filter ebiten.Filter

	// Address is a sampler address mode.
	// The default (zero) value is ebiten.AddressUnsafe.
	Address ebiten.Address

	// FillRule indicates the rule how an overlapped region is rendered.
	//
	// The rule EvenOdd is useful when you want to render a complex polygon.
	// A complex polygon is a non-convex polygon like a concave polygon, a polygon with holes, or a self-intersecting polygon.
	// See examples/vector for actual usages.
	//
	// The default (zero) value is ebiten.FillAll.
	FillRule ebiten.FillRule

	// AntiAlias indicates whether the rendering uses anti-alias or not.
	// AntiAlias is useful especially when you pass vertices from the vector package.
	//
	// AntiAlias increases internal draw calls and might affect performance.
	// Use the build tag `ebitenginedebug` to check the number of draw calls if you care.
	//
	// The default (zero) value is false.
	AntiAlias bool
}

DrawTrianglesOptions represents options for DrawTriangles.

Jump to

Keyboard shortcuts

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