Variable: canvasUtils
> const canvasUtils: object
Defined in: node_modules/pixi.js/lib/rendering/renderers/canvas/utils/canvasUtils.d.ts:14
Internal
Canvas helper utilities for tinting and pattern generation.
Type Declaration
_applyInverseRotation
> _applyInverseRotation: (context, rotate, srcWidth, srcHeight) => void
Applies inverse rotation transform to context for texture packer rotation compensation. Supports all 16 groupD8 symmetries (rotations and reflections).
Parameters
context
Canvas 2D context
rotate
number
The groupD8 rotation value
srcWidth
number
Source crop width (before rotation)
srcHeight
number
Source crop height (before rotation)
Returns
void
_canvasSourceCache
> _canvasSourceCache: WeakMap<TextureSource<any>, CanvasSourceCache>
_unpremultipliedCache
> _unpremultipliedCache: WeakMap<TextureSource<any>, CanvasSourceCache>
applyPatternTransform
> applyPatternTransform: (pattern, matrix, invert?) => void
Applies a transform to a CanvasPattern.
Parameters
pattern
CanvasPattern
The pattern to apply the transform to.
matrix
The matrix to apply.
a
number
b
number
c
number
d
number
tx
number
ty
number
invert?
boolean
Returns
void
cacheStepsPerColorChannel
> cacheStepsPerColorChannel: number
canUseMultiply
> canUseMultiply: boolean
canvas
> canvas: ICanvas | null
convertTintToImage
> convertTintToImage: boolean
getCanvasSource
> getCanvasSource: (texture) => CanvasImageSource | null
Parameters
texture
Returns
CanvasImageSource | null
getTintedCanvas
> getTintedCanvas: (sprite, color) => ICanvas | ImageLike
Parameters
sprite
texture
color
number
Returns
getTintedPattern
> getTintedPattern: (texture, color) => CanvasPattern
Parameters
texture
color
number
Returns
CanvasPattern
tintMethod
> tintMethod: (texture, color, canvas) => void
Parameters
texture
color
number
canvas
Returns
void
tintWithMultiply
> tintWithMultiply: (texture, color, canvas) => void
Parameters
texture
color
number
canvas
Returns
void
tintWithOverlay
> tintWithOverlay: (texture, color, canvas) => void
Parameters
texture
color
number
canvas
Returns
void
tintWithPerPixel
> tintWithPerPixel: (texture, color, canvas) => void
Parameters
texture
color
number
canvas
Returns
void