UNPKG

starling-framework

Version:

A fast, productive library for 2D cross-platform development.

58 lines 2.18 kB
import Texture from "../textures/Texture"; import Painter from "../rendering/Painter"; import IFilterHelper from "./IFilterHelper"; import FragmentFilter from "./FragmentFilter"; declare namespace starling.filters { /** * The FilterChain allows you to combine several filters into one. The filters will be * * processed in the given order, the number of draw calls per filter adding up. * * Just like conventional filters, a chain may be attached to any display object. * */ export class FilterChain extends FragmentFilter { /** * Creates a new chain with the given filters. */ constructor(args?: Array<FragmentFilter>); /** * Disposes the filter chain itself as well as all contained filters. */ override dispose(): void; /** * @private */ override process(painter: Painter, helper: IFilterHelper, input0?: Texture, input1?: Texture, input2?: Texture, input3?: Texture): Texture; /** * Returns the filter at a certain index. If you pass a negative index, * * '-1' will return the last filter, '-2' the second to last filter, etc. */ getFilterAt(index: number): FragmentFilter; /** * Adds a filter to the chain. It will be appended at the very end. */ addFilter(filter: FragmentFilter): void; /** * Adds a filter to the chain at the given index. */ addFilterAt(filter: FragmentFilter, index: number): void; /** * Removes a filter from the chain. If the filter is not part of the chain, * * nothing happens. If requested, the filter will be disposed right away. */ removeFilter(filter: FragmentFilter, dispose?: boolean): FragmentFilter; /** * Removes the filter at a certain index. The indices of any subsequent filters * * are decremented. If requested, the filter will be disposed right away. */ removeFilterAt(index: number, dispose?: boolean): FragmentFilter; /** * Returns the index of a filter within the chain, or "-1" if it is not found. */ getFilterIndex(filter: FragmentFilter): number; /** * Indicates the current chain length. */ get numFilters(): number; } } export default starling.filters.FilterChain;