{"ast":null,"code":"import { __decorate } from \"../tslib.es6.js\";\nimport { PostProcess } from \"./postProcess.js\";\nimport { Texture } from \"../Materials/Textures/texture.js\";\nimport { RegisterClass } from \"../Misc/typeStore.js\";\nimport { serialize, serializeAsVector2 } from \"../Misc/decorators.js\";\nimport { SerializationHelper } from \"../Misc/decorators.serialization.js\";\nimport { ThinBlurPostProcess } from \"./thinBlurPostProcess.js\";\n/**\n * The Blur Post Process which blurs an image based on a kernel and direction.\n * Can be used twice in x and y directions to perform a gaussian blur in two passes.\n */\nexport class BlurPostProcess extends PostProcess {\n /** The direction in which to blur the image. */\n get direction() {\n return this._effectWrapper.direction;\n }\n set direction(value) {\n this._effectWrapper.direction = value;\n }\n /**\n * Sets the length in pixels of the blur sample region\n */\n set kernel(v) {\n this._effectWrapper.kernel = v;\n }\n /**\n * Gets the length in pixels of the blur sample region\n */\n get kernel() {\n return this._effectWrapper.kernel;\n }\n /**\n * Sets whether or not the blur needs to unpack/repack floats\n */\n set packedFloat(v) {\n this._effectWrapper.packedFloat = v;\n }\n /**\n * Gets whether or not the blur is unpacking/repacking floats\n */\n get packedFloat() {\n return this._effectWrapper.packedFloat;\n }\n /**\n * Gets a string identifying the name of the class\n * @returns \"BlurPostProcess\" string\n */\n getClassName() {\n return \"BlurPostProcess\";\n }\n /**\n * Creates a new instance BlurPostProcess\n * @param name The name of the effect.\n * @param direction The direction in which to blur the image.\n * @param kernel The size of the kernel to be used when computing the blur. eg. Size of 3 will blur the center pixel by 2 pixels surrounding it.\n * @param options The required width/height ratio to downsize to before computing the render pass. (Use 1.0 for full size)\n * @param camera The camera to apply the render pass to.\n * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)\n * @param engine The engine which the post process will be applied. (default: current engine)\n * @param reusable If the post process can be reused on the same frame. (default: false)\n * @param textureType Type of textures used when performing the post process. (default: 0)\n * @param defines\n * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)\n * @param textureFormat Format of textures used when performing the post process. (default: TEXTUREFORMAT_RGBA)\n */\n constructor(name, direction, kernel, options, camera = null, samplingMode = Texture.BILINEAR_SAMPLINGMODE, engine, reusable, textureType = 0, defines = \"\", blockCompilation = false, textureFormat = 5) {\n const blockCompilationFinal = typeof options === \"number\" ? blockCompilation : !!options.blockCompilation;\n const localOptions = {\n uniforms: ThinBlurPostProcess.Uniforms,\n samplers: ThinBlurPostProcess.Samplers,\n size: typeof options === \"number\" ? options : undefined,\n camera,\n samplingMode,\n engine,\n reusable,\n textureType,\n vertexUrl: ThinBlurPostProcess.VertexUrl,\n indexParameters: {\n varyingCount: 0,\n depCount: 0\n },\n textureFormat,\n defines,\n ...options,\n blockCompilation: true\n };\n super(name, ThinBlurPostProcess.FragmentUrl, {\n effectWrapper: typeof options === \"number\" || !options.effectWrapper ? new ThinBlurPostProcess(name, engine, undefined, undefined, localOptions) : undefined,\n ...localOptions\n });\n this._effectWrapper.options.blockCompilation = blockCompilationFinal;\n this.direction = direction;\n this.onApplyObservable.add(() => {\n this._effectWrapper.textureWidth = this._outputTexture ? this._outputTexture.width : this.width;\n this._effectWrapper.textureHeight = this._outputTexture ? this._outputTexture.height : this.height;\n });\n this.kernel = kernel;\n }\n updateEffect(_defines = null, _uniforms = null, _samplers = null, _indexParameters, onCompiled, onError) {\n this._effectWrapper._updateParameters(onCompiled, onError);\n }\n /**\n * @internal\n */\n static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {\n return SerializationHelper.Parse(() => {\n return new BlurPostProcess(parsedPostProcess.name, parsedPostProcess.direction, parsedPostProcess.kernel, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, scene.getEngine(), parsedPostProcess.reusable, parsedPostProcess.textureType, undefined, false);\n }, parsedPostProcess, scene, rootUrl);\n }\n}\n__decorate([serializeAsVector2()], BlurPostProcess.prototype, \"direction\", null);\n__decorate([serialize()], BlurPostProcess.prototype, \"kernel\", null);\n__decorate([serialize()], BlurPostProcess.prototype, \"packedFloat\", null);\nRegisterClass(\"BABYLON.BlurPostProcess\", BlurPostProcess);","map":{"version":3,"names":["__decorate","PostProcess","Texture","RegisterClass","serialize","serializeAsVector2","SerializationHelper","ThinBlurPostProcess","BlurPostProcess","direction","_effectWrapper","value","kernel","v","packedFloat","getClassName","constructor","name","options","camera","samplingMode","BILINEAR_SAMPLINGMODE","engine","reusable","textureType","defines","blockCompilation","textureFormat","blockCompilationFinal","localOptions","uniforms","Uniforms","samplers","Samplers","size","undefined","vertexUrl","VertexUrl","indexParameters","varyingCount","depCount","FragmentUrl","effectWrapper","onApplyObservable","add","textureWidth","_outputTexture","width","textureHeight","height","updateEffect","_defines","_uniforms","_samplers","_indexParameters","onCompiled","onError","_updateParameters","_Parse","parsedPostProcess","targetCamera","scene","rootUrl","Parse","renderTargetSamplingMode","getEngine","prototype"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/PostProcesses/blurPostProcess.js"],"sourcesContent":["import { __decorate } from \"../tslib.es6.js\";\nimport { PostProcess } from \"./postProcess.js\";\nimport { Texture } from \"../Materials/Textures/texture.js\";\n\nimport { RegisterClass } from \"../Misc/typeStore.js\";\nimport { serialize, serializeAsVector2 } from \"../Misc/decorators.js\";\nimport { SerializationHelper } from \"../Misc/decorators.serialization.js\";\nimport { ThinBlurPostProcess } from \"./thinBlurPostProcess.js\";\n/**\n * The Blur Post Process which blurs an image based on a kernel and direction.\n * Can be used twice in x and y directions to perform a gaussian blur in two passes.\n */\nexport class BlurPostProcess extends PostProcess {\n /** The direction in which to blur the image. */\n get direction() {\n return this._effectWrapper.direction;\n }\n set direction(value) {\n this._effectWrapper.direction = value;\n }\n /**\n * Sets the length in pixels of the blur sample region\n */\n set kernel(v) {\n this._effectWrapper.kernel = v;\n }\n /**\n * Gets the length in pixels of the blur sample region\n */\n get kernel() {\n return this._effectWrapper.kernel;\n }\n /**\n * Sets whether or not the blur needs to unpack/repack floats\n */\n set packedFloat(v) {\n this._effectWrapper.packedFloat = v;\n }\n /**\n * Gets whether or not the blur is unpacking/repacking floats\n */\n get packedFloat() {\n return this._effectWrapper.packedFloat;\n }\n /**\n * Gets a string identifying the name of the class\n * @returns \"BlurPostProcess\" string\n */\n getClassName() {\n return \"BlurPostProcess\";\n }\n /**\n * Creates a new instance BlurPostProcess\n * @param name The name of the effect.\n * @param direction The direction in which to blur the image.\n * @param kernel The size of the kernel to be used when computing the blur. eg. Size of 3 will blur the center pixel by 2 pixels surrounding it.\n * @param options The required width/height ratio to downsize to before computing the render pass. (Use 1.0 for full size)\n * @param camera The camera to apply the render pass to.\n * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)\n * @param engine The engine which the post process will be applied. (default: current engine)\n * @param reusable If the post process can be reused on the same frame. (default: false)\n * @param textureType Type of textures used when performing the post process. (default: 0)\n * @param defines\n * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)\n * @param textureFormat Format of textures used when performing the post process. (default: TEXTUREFORMAT_RGBA)\n */\n constructor(name, direction, kernel, options, camera = null, samplingMode = Texture.BILINEAR_SAMPLINGMODE, engine, reusable, textureType = 0, defines = \"\", blockCompilation = false, textureFormat = 5) {\n const blockCompilationFinal = typeof options === \"number\" ? blockCompilation : !!options.blockCompilation;\n const localOptions = {\n uniforms: ThinBlurPostProcess.Uniforms,\n samplers: ThinBlurPostProcess.Samplers,\n size: typeof options === \"number\" ? options : undefined,\n camera,\n samplingMode,\n engine,\n reusable,\n textureType,\n vertexUrl: ThinBlurPostProcess.VertexUrl,\n indexParameters: { varyingCount: 0, depCount: 0 },\n textureFormat,\n defines,\n ...options,\n blockCompilation: true,\n };\n super(name, ThinBlurPostProcess.FragmentUrl, {\n effectWrapper: typeof options === \"number\" || !options.effectWrapper ? new ThinBlurPostProcess(name, engine, undefined, undefined, localOptions) : undefined,\n ...localOptions,\n });\n this._effectWrapper.options.blockCompilation = blockCompilationFinal;\n this.direction = direction;\n this.onApplyObservable.add(() => {\n this._effectWrapper.textureWidth = this._outputTexture ? this._outputTexture.width : this.width;\n this._effectWrapper.textureHeight = this._outputTexture ? this._outputTexture.height : this.height;\n });\n this.kernel = kernel;\n }\n updateEffect(_defines = null, _uniforms = null, _samplers = null, _indexParameters, onCompiled, onError) {\n this._effectWrapper._updateParameters(onCompiled, onError);\n }\n /**\n * @internal\n */\n static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {\n return SerializationHelper.Parse(() => {\n return new BlurPostProcess(parsedPostProcess.name, parsedPostProcess.direction, parsedPostProcess.kernel, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, scene.getEngine(), parsedPostProcess.reusable, parsedPostProcess.textureType, undefined, false);\n }, parsedPostProcess, scene, rootUrl);\n }\n}\n__decorate([\n serializeAsVector2()\n], BlurPostProcess.prototype, \"direction\", null);\n__decorate([\n serialize()\n], BlurPostProcess.prototype, \"kernel\", null);\n__decorate([\n serialize()\n], BlurPostProcess.prototype, \"packedFloat\", null);\nRegisterClass(\"BABYLON.BlurPostProcess\", BlurPostProcess);\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,WAAW,QAAQ,kBAAkB;AAC9C,SAASC,OAAO,QAAQ,kCAAkC;AAE1D,SAASC,aAAa,QAAQ,sBAAsB;AACpD,SAASC,SAAS,EAAEC,kBAAkB,QAAQ,uBAAuB;AACrE,SAASC,mBAAmB,QAAQ,qCAAqC;AACzE,SAASC,mBAAmB,QAAQ,0BAA0B;AAC9D;AACA;AACA;AACA;AACA,OAAO,MAAMC,eAAe,SAASP,WAAW,CAAC;EAC7C;EACA,IAAIQ,SAASA,CAAA,EAAG;IACZ,OAAO,IAAI,CAACC,cAAc,CAACD,SAAS;EACxC;EACA,IAAIA,SAASA,CAACE,KAAK,EAAE;IACjB,IAAI,CAACD,cAAc,CAACD,SAAS,GAAGE,KAAK;EACzC;EACA;AACJ;AACA;EACI,IAAIC,MAAMA,CAACC,CAAC,EAAE;IACV,IAAI,CAACH,cAAc,CAAC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