UNPKG

2.65 kBSource Map (JSON)View Raw
1{"version":3,"file":"FilterState.mjs","sources":["../../src/filters/FilterState.ts"],"sourcesContent":["import { MSAA_QUALITY } from '@pixi/constants';\nimport { Rectangle } from '@pixi/math';\n\nimport type { Matrix } from '@pixi/math';\nimport type { RenderTexture } from '../renderTexture/RenderTexture';\nimport type { Filter } from './Filter';\nimport type { IFilterTarget } from './IFilterTarget';\n\n/**\n * System plugin to the renderer to manage filter states.\n * @ignore\n */\nexport class FilterState\n{\n renderTexture: RenderTexture;\n\n /**\n * Target of the filters\n * We store for case when custom filter wants to know the element it was applied on\n * @member {PIXI.DisplayObject}\n */\n target: IFilterTarget;\n\n /**\n * Compatibility with PixiJS v4 filters\n * @default false\n */\n legacy: boolean;\n\n /**\n * Resolution of filters\n * @default 1\n */\n resolution: number;\n\n /**\n * Number of samples\n * @default MSAA_QUALITY.NONE\n */\n multisample: MSAA_QUALITY;\n\n /** Source frame. */\n sourceFrame: Rectangle;\n\n /** Destination frame. */\n destinationFrame: Rectangle;\n\n /** Original render-target source frame. */\n bindingSourceFrame: Rectangle;\n\n /** Original render-target destination frame. */\n bindingDestinationFrame: Rectangle;\n\n /** Collection of filters. */\n filters: Array<Filter>;\n\n /** Projection system transform saved by link. */\n transform: Matrix;\n\n constructor()\n {\n this.renderTexture = null;\n\n this.target = null;\n this.legacy = false;\n this.resolution = 1;\n this.multisample = MSAA_QUALITY.NONE;\n\n // next three fields are created only for root\n // re-assigned for everything else\n\n this.sourceFrame = new Rectangle();\n this.destinationFrame = new Rectangle();\n this.bindingSourceFrame = new Rectangle();\n this.bindingDestinationFrame = new Rectangle();\n this.filters = [];\n this.transform = null;\n }\n\n /** Clears the state */\n clear(): void\n {\n this.target = null;\n this.filters = null;\n this.renderTexture = null;\n }\n}\n"],"names":[],"mappings":";;AAYO,MAAM,YACb;AAAA,EA8CI,cACA;AACI,SAAK,gBAAgB,MAErB,KAAK,SAAS,MACd,KAAK,SAAS,IACd,KAAK,aAAa,GAClB,KAAK,cAAc,aAAa,MAKhC,KAAK,cAAc,IAAI,UAAU,GACjC,KAAK,mBAAmB,IAAI,UAAU,GACtC,KAAK,qBAAqB,IAAI,aAC9B,KAAK,0BAA0B,IAAI,UACnC,GAAA,KAAK,UAAU,CAAA,GACf,KAAK,YAAY;AAAA,EACrB;AAAA;AAAA,EAGA,QACA;AACI,SAAK,SAAS,MACd,KAAK,UAAU,MACf,KAAK,gBAAgB;AAAA,EACzB;AACJ;"}
\No newline at end of file