convolutionPostProcess.d.ts 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import type { PostProcessOptions } from "./postProcess";
  2. import { PostProcess } from "./postProcess";
  3. import type { Nullable } from "../types";
  4. import type { Camera } from "../Cameras/camera";
  5. import type { AbstractEngine } from "../Engines/abstractEngine";
  6. import "../Shaders/convolution.fragment";
  7. import type { Scene } from "../scene";
  8. /**
  9. * The ConvolutionPostProcess applies a 3x3 kernel to every pixel of the
  10. * input texture to perform effects such as edge detection or sharpening
  11. * See http://en.wikipedia.org/wiki/Kernel_(image_processing)
  12. */
  13. export declare class ConvolutionPostProcess extends PostProcess {
  14. /** Array of 9 values corresponding to the 3x3 kernel to be applied */
  15. kernel: number[];
  16. /**
  17. * Gets a string identifying the name of the class
  18. * @returns "ConvolutionPostProcess" string
  19. */
  20. getClassName(): string;
  21. /**
  22. * Creates a new instance ConvolutionPostProcess
  23. * @param name The name of the effect.
  24. * @param kernel Array of 9 values corresponding to the 3x3 kernel to be applied
  25. * @param options The required width/height ratio to downsize to before computing the render pass.
  26. * @param camera The camera to apply the render pass to.
  27. * @param samplingMode The sampling mode to be used when computing the pass. (default: 0)
  28. * @param engine The engine which the post process will be applied. (default: current engine)
  29. * @param reusable If the post process can be reused on the same frame. (default: false)
  30. * @param textureType Type of textures used when performing the post process. (default: 0)
  31. */
  32. constructor(name: string, kernel: number[], options: number | PostProcessOptions, camera: Nullable<Camera>, samplingMode?: number, engine?: AbstractEngine, reusable?: boolean, textureType?: number);
  33. /**
  34. * @internal
  35. */
  36. static _Parse(parsedPostProcess: any, targetCamera: Camera, scene: Scene, rootUrl: string): Nullable<ConvolutionPostProcess>;
  37. /**
  38. * Edge detection 0 see https://en.wikipedia.org/wiki/Kernel_(image_processing)
  39. */
  40. static EdgeDetect0Kernel: number[];
  41. /**
  42. * Edge detection 1 see https://en.wikipedia.org/wiki/Kernel_(image_processing)
  43. */
  44. static EdgeDetect1Kernel: number[];
  45. /**
  46. * Edge detection 2 see https://en.wikipedia.org/wiki/Kernel_(image_processing)
  47. */
  48. static EdgeDetect2Kernel: number[];
  49. /**
  50. * Kernel to sharpen an image see https://en.wikipedia.org/wiki/Kernel_(image_processing)
  51. */
  52. static SharpenKernel: number[];
  53. /**
  54. * Kernel to emboss an image see https://en.wikipedia.org/wiki/Kernel_(image_processing)
  55. */
  56. static EmbossKernel: number[];
  57. /**
  58. * Kernel to blur an image see https://en.wikipedia.org/wiki/Kernel_(image_processing)
  59. */
  60. static GaussianKernel: number[];
  61. }