{"ast":null,"code":"import { __decorate } from \"../tslib.es6.js\";\nimport { PostProcess } from \"./postProcess.js\";\nimport \"../Shaders/sharpen.fragment.js\";\nimport { RegisterClass } from \"../Misc/typeStore.js\";\nimport { serialize } from \"../Misc/decorators.js\";\nimport { SerializationHelper } from \"../Misc/decorators.serialization.js\";\n/**\n * The SharpenPostProcess applies a sharpen kernel to every pixel\n * See http://en.wikipedia.org/wiki/Kernel_(image_processing)\n */\nexport class SharpenPostProcess extends PostProcess {\n /**\n * Gets a string identifying the name of the class\n * @returns \"SharpenPostProcess\" string\n */\n getClassName() {\n return \"SharpenPostProcess\";\n }\n /**\n * Creates a new instance ConvolutionPostProcess\n * @param name The name of the effect.\n * @param options The required width/height ratio to downsize to before computing the render pass.\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 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 */\n constructor(name, options, camera, samplingMode, engine, reusable, textureType = 0, blockCompilation = false) {\n super(name, \"sharpen\", [\"sharpnessAmounts\", \"screenSize\"], null, options, camera, samplingMode, engine, reusable, null, textureType, undefined, null, blockCompilation);\n /**\n * How much of the original color should be applied. Setting this to 0 will display edge detection. (default: 1)\n */\n this.colorAmount = 1.0;\n /**\n * How much sharpness should be applied (default: 0.3)\n */\n this.edgeAmount = 0.3;\n this.onApply = effect => {\n effect.setFloat2(\"screenSize\", this.width, this.height);\n effect.setFloat2(\"sharpnessAmounts\", this.edgeAmount, this.colorAmount);\n };\n }\n _gatherImports(useWebGPU, list) {\n if (useWebGPU) {\n this._webGPUReady = true;\n list.push(Promise.all([import(\"../ShadersWGSL/sharpen.fragment.js\")]));\n } else {\n list.push(Promise.all([import(\"../Shaders/sharpen.fragment.js\")]));\n }\n super._gatherImports(useWebGPU, list);\n }\n /**\n * @internal\n */\n static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {\n return SerializationHelper.Parse(() => {\n return new SharpenPostProcess(parsedPostProcess.name, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, scene.getEngine(), parsedPostProcess.textureType, parsedPostProcess.reusable);\n }, parsedPostProcess, scene, rootUrl);\n }\n}\n__decorate([serialize()], SharpenPostProcess.prototype, \"colorAmount\", void 0);\n__decorate([serialize()], SharpenPostProcess.prototype, \"edgeAmount\", void 0);\nRegisterClass(\"BABYLON.SharpenPostProcess\", SharpenPostProcess);","map":{"version":3,"names":["__decorate","PostProcess","RegisterClass","serialize","SerializationHelper","SharpenPostProcess","getClassName","constructor","name","options","camera","samplingMode","engine","reusable","textureType","blockCompilation","undefined","colorAmount","edgeAmount","onApply","effect","setFloat2","width","height","_gatherImports","useWebGPU","list","_webGPUReady","push","Promise","all","_Parse","parsedPostProcess","targetCamera","scene","rootUrl","Parse","renderTargetSamplingMode","getEngine","prototype"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/PostProcesses/sharpenPostProcess.js"],"sourcesContent":["import { __decorate } from \"../tslib.es6.js\";\nimport { PostProcess } from \"./postProcess.js\";\n\nimport \"../Shaders/sharpen.fragment.js\";\nimport { RegisterClass } from \"../Misc/typeStore.js\";\nimport { serialize } from \"../Misc/decorators.js\";\nimport { SerializationHelper } from \"../Misc/decorators.serialization.js\";\n/**\n * The SharpenPostProcess applies a sharpen kernel to every pixel\n * See http://en.wikipedia.org/wiki/Kernel_(image_processing)\n */\nexport class SharpenPostProcess extends PostProcess {\n /**\n * Gets a string identifying the name of the class\n * @returns \"SharpenPostProcess\" string\n */\n getClassName() {\n return \"SharpenPostProcess\";\n }\n /**\n * Creates a new instance ConvolutionPostProcess\n * @param name The name of the effect.\n * @param options The required width/height ratio to downsize to before computing the render pass.\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 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 */\n constructor(name, options, camera, samplingMode, engine, reusable, textureType = 0, blockCompilation = false) {\n super(name, \"sharpen\", [\"sharpnessAmounts\", \"screenSize\"], null, options, camera, samplingMode, engine, reusable, null, textureType, undefined, null, blockCompilation);\n /**\n * How much of the original color should be applied. Setting this to 0 will display edge detection. (default: 1)\n */\n this.colorAmount = 1.0;\n /**\n * How much sharpness should be applied (default: 0.3)\n */\n this.edgeAmount = 0.3;\n this.onApply = (effect) => {\n effect.setFloat2(\"screenSize\", this.width, this.height);\n effect.setFloat2(\"sharpnessAmounts\", this.edgeAmount, this.colorAmount);\n };\n }\n _gatherImports(useWebGPU, list) {\n if (useWebGPU) {\n this._webGPUReady = true;\n list.push(Promise.all([import(\"../ShadersWGSL/sharpen.fragment.js\")]));\n }\n else {\n list.push(Promise.all([import(\"../Shaders/sharpen.fragment.js\")]));\n }\n super._gatherImports(useWebGPU, list);\n }\n /**\n * @internal\n */\n static _Parse(parsedPostProcess, targetCamera, scene, rootUrl) {\n return SerializationHelper.Parse(() => {\n return new SharpenPostProcess(parsedPostProcess.name, parsedPostProcess.options, targetCamera, parsedPostProcess.renderTargetSamplingMode, scene.getEngine(), parsedPostProcess.textureType, parsedPostProcess.reusable);\n }, parsedPostProcess, scene, rootUrl);\n }\n}\n__decorate([\n serialize()\n], SharpenPostProcess.prototype, \"colorAmount\", void 0);\n__decorate([\n serialize()\n], SharpenPostProcess.prototype, \"edgeAmount\", void 0);\nRegisterClass(\"BABYLON.SharpenPostProcess\", SharpenPostProcess);\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,iBAAiB;AAC5C,SAASC,WAAW,QAAQ,kBAAkB;AAE9C,OAAO,gCAAgC;AACvC,SAASC,aAAa,QAAQ,sBAAs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