UNPKG

1.87 kBTypeScriptView Raw
1import { Matrix } from '@pixi/math';
2import { Filter } from '../Filter';
3import type { CLEAR_MODES } from '@pixi/constants';
4import type { Point } from '@pixi/math';
5import type { Dict } from '@pixi/utils';
6import type { IMaskTarget } from '../../mask/MaskData';
7import type { RenderTexture } from '../../renderTexture/RenderTexture';
8import type { Texture } from '../../textures/Texture';
9import type { FilterSystem } from '../FilterSystem';
10export interface ISpriteMaskTarget extends IMaskTarget {
11 _texture: Texture;
12 worldAlpha: number;
13 anchor: Point;
14}
15export interface ISpriteMaskFilter extends Filter {
16 maskSprite: IMaskTarget;
17}
18/**
19 * This handles a Sprite acting as a mask, as opposed to a Graphic.
20 *
21 * WebGL only.
22 * @memberof PIXI
23 */
24export declare class SpriteMaskFilter extends Filter {
25 /** @private */
26 _maskSprite: IMaskTarget;
27 /** Mask matrix */
28 maskMatrix: Matrix;
29 /**
30 * @param {PIXI.Sprite} sprite - The target sprite.
31 */
32 constructor(sprite: IMaskTarget);
33 /**
34 * @param vertexSrc - The source of the vertex shader.
35 * @param fragmentSrc - The source of the fragment shader.
36 * @param uniforms - Custom uniforms to use to augment the built-in ones.
37 */
38 constructor(vertexSrc?: string, fragmentSrc?: string, uniforms?: Dict<any>);
39 /**
40 * Sprite mask
41 * @type {PIXI.DisplayObject}
42 */
43 get maskSprite(): IMaskTarget;
44 set maskSprite(value: IMaskTarget);
45 /**
46 * Applies the filter
47 * @param filterManager - The renderer to retrieve the filter from
48 * @param input - The input render target.
49 * @param output - The target to output to.
50 * @param clearMode - Should the output be cleared before rendering to it.
51 */
52 apply(filterManager: FilterSystem, input: RenderTexture, output: RenderTexture, clearMode: CLEAR_MODES): void;
53}