@onerjs/smart-filters-blocks 8.25.2 → 8.25.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/dist/blocks/babylon/demo/effects/blackAndWhiteBlock.block.d.ts +34 -0
  2. package/dist/blocks/babylon/demo/effects/blackAndWhiteBlock.block.d.ts.map +1 -0
  3. package/dist/blocks/babylon/demo/effects/blackAndWhiteBlock.block.js +100 -0
  4. package/dist/blocks/babylon/demo/effects/blackAndWhiteBlock.block.js.map +1 -0
  5. package/dist/blocks/babylon/demo/effects/blurBlock.d.ts +53 -0
  6. package/dist/blocks/babylon/demo/effects/blurBlock.d.ts.map +1 -0
  7. package/dist/blocks/babylon/demo/effects/blurBlock.deserializer.d.ts +28 -0
  8. package/dist/blocks/babylon/demo/effects/blurBlock.deserializer.d.ts.map +1 -0
  9. package/dist/blocks/babylon/demo/effects/blurBlock.deserializer.js +15 -0
  10. package/dist/blocks/babylon/demo/effects/blurBlock.deserializer.js.map +1 -0
  11. package/dist/blocks/babylon/demo/effects/blurBlock.js +93 -0
  12. package/dist/blocks/babylon/demo/effects/blurBlock.js.map +1 -0
  13. package/dist/blocks/babylon/demo/effects/blurBlock.serializer.d.ts +8 -0
  14. package/dist/blocks/babylon/demo/effects/blurBlock.serializer.d.ts.map +1 -0
  15. package/dist/blocks/babylon/demo/effects/blurBlock.serializer.js +28 -0
  16. package/dist/blocks/babylon/demo/effects/blurBlock.serializer.js.map +1 -0
  17. package/dist/blocks/babylon/demo/effects/compositionBlock.d.ts +116 -0
  18. package/dist/blocks/babylon/demo/effects/compositionBlock.d.ts.map +1 -0
  19. package/dist/blocks/babylon/demo/effects/compositionBlock.deserializer.d.ts +24 -0
  20. package/dist/blocks/babylon/demo/effects/compositionBlock.deserializer.d.ts.map +1 -0
  21. package/dist/blocks/babylon/demo/effects/compositionBlock.deserializer.js +14 -0
  22. package/dist/blocks/babylon/demo/effects/compositionBlock.deserializer.js.map +1 -0
  23. package/dist/blocks/babylon/demo/effects/compositionBlock.fragment.d.ts +20 -0
  24. package/dist/blocks/babylon/demo/effects/compositionBlock.fragment.d.ts.map +1 -0
  25. package/dist/blocks/babylon/demo/effects/compositionBlock.fragment.js +71 -0
  26. package/dist/blocks/babylon/demo/effects/compositionBlock.fragment.js.map +1 -0
  27. package/dist/blocks/babylon/demo/effects/compositionBlock.js +163 -0
  28. package/dist/blocks/babylon/demo/effects/compositionBlock.js.map +1 -0
  29. package/dist/blocks/babylon/demo/effects/compositionBlock.serializer.d.ts +6 -0
  30. package/dist/blocks/babylon/demo/effects/compositionBlock.serializer.d.ts.map +1 -0
  31. package/dist/blocks/babylon/demo/effects/compositionBlock.serializer.js +25 -0
  32. package/dist/blocks/babylon/demo/effects/compositionBlock.serializer.js.map +1 -0
  33. package/dist/blocks/babylon/demo/effects/contrastBlock.block.d.ts +39 -0
  34. package/dist/blocks/babylon/demo/effects/contrastBlock.block.d.ts.map +1 -0
  35. package/dist/blocks/babylon/demo/effects/contrastBlock.block.js +137 -0
  36. package/dist/blocks/babylon/demo/effects/contrastBlock.block.js.map +1 -0
  37. package/dist/blocks/babylon/demo/effects/desaturateBlock.block.d.ts +39 -0
  38. package/dist/blocks/babylon/demo/effects/desaturateBlock.block.d.ts.map +1 -0
  39. package/dist/blocks/babylon/demo/effects/desaturateBlock.block.js +114 -0
  40. package/dist/blocks/babylon/demo/effects/desaturateBlock.block.js.map +1 -0
  41. package/dist/blocks/babylon/demo/effects/directionalBlurBlock.d.ts +76 -0
  42. package/dist/blocks/babylon/demo/effects/directionalBlurBlock.d.ts.map +1 -0
  43. package/dist/blocks/babylon/demo/effects/directionalBlurBlock.deserializer.d.ts +32 -0
  44. package/dist/blocks/babylon/demo/effects/directionalBlurBlock.deserializer.d.ts.map +1 -0
  45. package/dist/blocks/babylon/demo/effects/directionalBlurBlock.deserializer.js +16 -0
  46. package/dist/blocks/babylon/demo/effects/directionalBlurBlock.deserializer.js.map +1 -0
  47. package/dist/blocks/babylon/demo/effects/directionalBlurBlock.js +162 -0
  48. package/dist/blocks/babylon/demo/effects/directionalBlurBlock.js.map +1 -0
  49. package/dist/blocks/babylon/demo/effects/directionalBlurBlock.serializer.d.ts +6 -0
  50. package/dist/blocks/babylon/demo/effects/directionalBlurBlock.serializer.d.ts.map +1 -0
  51. package/dist/blocks/babylon/demo/effects/directionalBlurBlock.serializer.js +27 -0
  52. package/dist/blocks/babylon/demo/effects/directionalBlurBlock.serializer.js.map +1 -0
  53. package/dist/blocks/babylon/demo/effects/exposureBlock.block.d.ts +38 -0
  54. package/dist/blocks/babylon/demo/effects/exposureBlock.block.d.ts.map +1 -0
  55. package/dist/blocks/babylon/demo/effects/exposureBlock.block.js +106 -0
  56. package/dist/blocks/babylon/demo/effects/exposureBlock.block.js.map +1 -0
  57. package/dist/blocks/babylon/demo/effects/greenScreenBlock.block.d.ts +46 -0
  58. package/dist/blocks/babylon/demo/effects/greenScreenBlock.block.d.ts.map +1 -0
  59. package/dist/blocks/babylon/demo/effects/greenScreenBlock.block.js +132 -0
  60. package/dist/blocks/babylon/demo/effects/greenScreenBlock.block.js.map +1 -0
  61. package/dist/blocks/babylon/demo/effects/index.d.ts +15 -0
  62. package/dist/blocks/babylon/demo/effects/index.d.ts.map +1 -0
  63. package/dist/blocks/babylon/demo/effects/index.js +15 -0
  64. package/dist/blocks/babylon/demo/effects/index.js.map +1 -0
  65. package/dist/blocks/babylon/demo/effects/kaleidoscopeBlock.d.ts +63 -0
  66. package/dist/blocks/babylon/demo/effects/kaleidoscopeBlock.d.ts.map +1 -0
  67. package/dist/blocks/babylon/demo/effects/kaleidoscopeBlock.js +158 -0
  68. package/dist/blocks/babylon/demo/effects/kaleidoscopeBlock.js.map +1 -0
  69. package/dist/blocks/babylon/demo/effects/maskBlock.block.d.ts +38 -0
  70. package/dist/blocks/babylon/demo/effects/maskBlock.block.d.ts.map +1 -0
  71. package/dist/blocks/babylon/demo/effects/maskBlock.block.js +109 -0
  72. package/dist/blocks/babylon/demo/effects/maskBlock.block.js.map +1 -0
  73. package/dist/blocks/babylon/demo/effects/pixelateBlock.block.d.ts +44 -0
  74. package/dist/blocks/babylon/demo/effects/pixelateBlock.block.d.ts.map +1 -0
  75. package/dist/blocks/babylon/demo/effects/pixelateBlock.block.js +129 -0
  76. package/dist/blocks/babylon/demo/effects/pixelateBlock.block.js.map +1 -0
  77. package/dist/blocks/babylon/demo/effects/posterizeBlock.block.d.ts +39 -0
  78. package/dist/blocks/babylon/demo/effects/posterizeBlock.block.d.ts.map +1 -0
  79. package/dist/blocks/babylon/demo/effects/posterizeBlock.block.js +115 -0
  80. package/dist/blocks/babylon/demo/effects/posterizeBlock.block.js.map +1 -0
  81. package/dist/blocks/babylon/demo/effects/spritesheetBlock.d.ts +77 -0
  82. package/dist/blocks/babylon/demo/effects/spritesheetBlock.d.ts.map +1 -0
  83. package/dist/blocks/babylon/demo/effects/spritesheetBlock.fragment.d.ts +20 -0
  84. package/dist/blocks/babylon/demo/effects/spritesheetBlock.fragment.d.ts.map +1 -0
  85. package/dist/blocks/babylon/demo/effects/spritesheetBlock.fragment.js +60 -0
  86. package/dist/blocks/babylon/demo/effects/spritesheetBlock.fragment.js.map +1 -0
  87. package/dist/blocks/babylon/demo/effects/spritesheetBlock.js +98 -0
  88. package/dist/blocks/babylon/demo/effects/spritesheetBlock.js.map +1 -0
  89. package/dist/blocks/babylon/demo/effects/tintBlock.d.ts +7 -0
  90. package/dist/blocks/babylon/demo/effects/tintBlock.d.ts.map +1 -0
  91. package/dist/blocks/babylon/demo/effects/tintBlock.js +51 -0
  92. package/dist/blocks/babylon/demo/effects/tintBlock.js.map +1 -0
  93. package/dist/blocks/babylon/demo/transitions/index.d.ts +2 -0
  94. package/dist/blocks/babylon/demo/transitions/index.d.ts.map +1 -0
  95. package/dist/blocks/babylon/demo/transitions/index.js +2 -0
  96. package/dist/blocks/babylon/demo/transitions/index.js.map +1 -0
  97. package/dist/blocks/babylon/demo/transitions/wipeBlock.block.d.ts +42 -0
  98. package/dist/blocks/babylon/demo/transitions/wipeBlock.block.d.ts.map +1 -0
  99. package/dist/blocks/babylon/demo/transitions/wipeBlock.block.js +115 -0
  100. package/dist/blocks/babylon/demo/transitions/wipeBlock.block.js.map +1 -0
  101. package/dist/blocks/babylon/demo/utilities/index.d.ts +2 -0
  102. package/dist/blocks/babylon/demo/utilities/index.d.ts.map +1 -0
  103. package/dist/blocks/babylon/demo/utilities/index.js +2 -0
  104. package/dist/blocks/babylon/demo/utilities/index.js.map +1 -0
  105. package/dist/blocks/babylon/demo/utilities/premultiplyAlphaBlock.block.d.ts +34 -0
  106. package/dist/blocks/babylon/demo/utilities/premultiplyAlphaBlock.block.d.ts.map +1 -0
  107. package/dist/blocks/babylon/demo/utilities/premultiplyAlphaBlock.block.js +96 -0
  108. package/dist/blocks/babylon/demo/utilities/premultiplyAlphaBlock.block.js.map +1 -0
  109. package/dist/blocks/blockNamespaces.d.ts +5 -0
  110. package/dist/blocks/blockNamespaces.d.ts.map +1 -0
  111. package/dist/blocks/blockNamespaces.js +7 -0
  112. package/dist/blocks/blockNamespaces.js.map +1 -0
  113. package/dist/blocks/blockTypes.d.ts +22 -0
  114. package/dist/blocks/blockTypes.d.ts.map +1 -0
  115. package/dist/blocks/blockTypes.js +24 -0
  116. package/dist/blocks/blockTypes.js.map +1 -0
  117. package/dist/blocks/index.d.ts +6 -0
  118. package/dist/blocks/index.d.ts.map +1 -0
  119. package/dist/blocks/index.js +7 -0
  120. package/dist/blocks/index.js.map +1 -0
  121. package/dist/index.d.ts +3 -0
  122. package/dist/index.d.ts.map +1 -0
  123. package/dist/index.js +4 -0
  124. package/dist/index.js.map +1 -0
  125. package/dist/registration/IBlockRegistration.d.ts +38 -0
  126. package/dist/registration/IBlockRegistration.d.ts.map +1 -0
  127. package/dist/registration/IBlockRegistration.js +2 -0
  128. package/dist/registration/IBlockRegistration.js.map +1 -0
  129. package/dist/registration/blockSerializers.d.ts +13 -0
  130. package/dist/registration/blockSerializers.d.ts.map +1 -0
  131. package/dist/registration/blockSerializers.js +33 -0
  132. package/dist/registration/blockSerializers.js.map +1 -0
  133. package/dist/registration/builtInBlockRegistrations.d.ts +13 -0
  134. package/dist/registration/builtInBlockRegistrations.d.ts.map +1 -0
  135. package/dist/registration/builtInBlockRegistrations.js +273 -0
  136. package/dist/registration/builtInBlockRegistrations.js.map +1 -0
  137. package/dist/registration/index.d.ts +4 -0
  138. package/dist/registration/index.d.ts.map +1 -0
  139. package/dist/registration/index.js +5 -0
  140. package/dist/registration/index.js.map +1 -0
  141. package/package.json +2 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/blocks/babylon/demo/transitions/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,42 @@
1
+ import { ShaderBinding, ConnectionPointType, type SmartFilter, ShaderBlock, type ShaderProgram } from "@onerjs/smart-filters";
2
+ /**
3
+ * The implementation of the WipeBlock
4
+ */
5
+ export declare class WipeBlock extends ShaderBlock {
6
+ /**
7
+ * The class name of the block.
8
+ */
9
+ static ClassName: string;
10
+ /**
11
+ * The namespace of the block.
12
+ */
13
+ static Namespace: string;
14
+ /**
15
+ * The textureA connection point.
16
+ */
17
+ readonly textureA: import("@onerjs/smart-filters").ConnectionPoint<ConnectionPointType.Texture>;
18
+ /**
19
+ * The textureB connection point.
20
+ */
21
+ readonly textureB: import("@onerjs/smart-filters").ConnectionPoint<ConnectionPointType.Texture>;
22
+ /**
23
+ * The progress connection point.
24
+ */
25
+ readonly progress: import("@onerjs/smart-filters").ConnectionPoint<ConnectionPointType.Float>;
26
+ /**
27
+ * The shader program (vertex and fragment code) to use to render the block
28
+ */
29
+ static ShaderCode: ShaderProgram;
30
+ /**
31
+ * Instantiates a new WipeBlock.
32
+ * @param smartFilter - The smart filter this block belongs to
33
+ * @param name - The friendly name of the block
34
+ */
35
+ constructor(smartFilter: SmartFilter, name: string);
36
+ /**
37
+ * Get the class instance that binds all the required data to the shader (effect) when rendering.
38
+ * @returns The class instance that binds the data to the effect
39
+ */
40
+ getShaderBinding(): ShaderBinding;
41
+ }
42
+ //# sourceMappingURL=wipeBlock.block.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wipeBlock.block.d.ts","sourceRoot":"","sources":["../../../../../src/blocks/babylon/demo/transitions/wipeBlock.block.ts"],"names":[],"mappings":"AAYA,OAAO,EACH,aAAa,EAEb,mBAAmB,EACnB,KAAK,WAAW,EAChB,WAAW,EACX,KAAK,aAAa,EACrB,8BAAsB;AA6EvB;;GAEG;AACH,qBAAa,SAAU,SAAQ,WAAW;IACtC;;OAEG;IACH,OAAuB,SAAS,SAAe;IAE/C;;OAEG;IACH,OAAuB,SAAS,SAA8B;IAE9D;;OAEG;IACH,SAAgB,QAAQ,+EAAuE;IAE/F;;OAEG;IACH,SAAgB,QAAQ,+EAAuE;IAE/F;;OAEG;IACH,SAAgB,QAAQ,6EAAqE;IAE7F;;OAEG;IACH,OAAuB,UAAU,gBAAsB;IAEvD;;;;OAIG;gBACS,WAAW,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM;IAIlD;;;OAGG;IACI,gBAAgB,IAAI,aAAa;CAO3C"}
@@ -0,0 +1,115 @@
1
+ /* eslint-disable prettier/prettier */
2
+ // ************************************************************
3
+ // Note: this file is auto-generated, do not modify it directly
4
+ // ************************************************************
5
+ import { ShaderBinding, ConnectionPointType, ShaderBlock, } from "@onerjs/smart-filters";
6
+ /**
7
+ * The shader program for the block.
8
+ */
9
+ const BlockShaderProgram = {
10
+ vertex: undefined,
11
+ fragment: {
12
+ uniform: `
13
+ uniform sampler2D _textureA_;
14
+ uniform sampler2D _textureB_;
15
+ uniform float _progress_;`,
16
+ mainInputTexture: "",
17
+ mainFunctionName: "_wipe_",
18
+ functions: [
19
+ {
20
+ name: "_wipe_",
21
+ code: `
22
+ vec4 _wipe_(vec2 vUV) {
23
+ vec4 colorA = texture2D(_textureA_, vUV);
24
+ vec4 colorB = texture2D(_textureB_, vUV);
25
+ return mix(colorB, colorA, step(_progress_, vUV.y));
26
+ }
27
+ `,
28
+ params: "vec2 vUV",
29
+ },
30
+ ],
31
+ },
32
+ };
33
+ /**
34
+ * The uniform names for this shader, to be used in the shader binding so
35
+ * that the names are always in sync.
36
+ */
37
+ const Uniforms = {
38
+ textureA: "textureA",
39
+ textureB: "textureB",
40
+ progress: "progress",
41
+ };
42
+ /**
43
+ * The shader binding for the WipeBlock, used by the runtime
44
+ */
45
+ class WipeBlockShaderBinding extends ShaderBinding {
46
+ /**
47
+ * Creates a new shader binding instance for the block.
48
+ * @param textureA - The textureA runtime value
49
+ * @param textureB - The textureB runtime value
50
+ * @param progress - The progress runtime value
51
+ */
52
+ constructor(textureA, textureB, progress) {
53
+ super();
54
+ this._textureA = textureA;
55
+ this._textureB = textureB;
56
+ this._progress = progress;
57
+ }
58
+ /**
59
+ * Binds all the required data to the shader when rendering.
60
+ * @param effect - defines the effect to bind the data to
61
+ */
62
+ bind(effect) {
63
+ effect.setTexture(this.getRemappedName(Uniforms.textureA), this._textureA.value);
64
+ effect.setTexture(this.getRemappedName(Uniforms.textureB), this._textureB.value);
65
+ effect.setFloat(this.getRemappedName(Uniforms.progress), this._progress.value);
66
+ }
67
+ }
68
+ /**
69
+ * The implementation of the WipeBlock
70
+ */
71
+ export class WipeBlock extends ShaderBlock {
72
+ /**
73
+ * Instantiates a new WipeBlock.
74
+ * @param smartFilter - The smart filter this block belongs to
75
+ * @param name - The friendly name of the block
76
+ */
77
+ constructor(smartFilter, name) {
78
+ super(smartFilter, name, false);
79
+ /**
80
+ * The textureA connection point.
81
+ */
82
+ this.textureA = this._registerInput(Uniforms.textureA, ConnectionPointType.Texture);
83
+ /**
84
+ * The textureB connection point.
85
+ */
86
+ this.textureB = this._registerInput(Uniforms.textureB, ConnectionPointType.Texture);
87
+ /**
88
+ * The progress connection point.
89
+ */
90
+ this.progress = this._registerInput(Uniforms.progress, ConnectionPointType.Float);
91
+ }
92
+ /**
93
+ * Get the class instance that binds all the required data to the shader (effect) when rendering.
94
+ * @returns The class instance that binds the data to the effect
95
+ */
96
+ getShaderBinding() {
97
+ const textureA = this._confirmRuntimeDataSupplied(this.textureA);
98
+ const textureB = this._confirmRuntimeDataSupplied(this.textureB);
99
+ const progress = this._confirmRuntimeDataSupplied(this.progress);
100
+ return new WipeBlockShaderBinding(textureA, textureB, progress);
101
+ }
102
+ }
103
+ /**
104
+ * The class name of the block.
105
+ */
106
+ WipeBlock.ClassName = "WipeBlock";
107
+ /**
108
+ * The namespace of the block.
109
+ */
110
+ WipeBlock.Namespace = "Babylon.Demo.Transitions";
111
+ /**
112
+ * The shader program (vertex and fragment code) to use to render the block
113
+ */
114
+ WipeBlock.ShaderCode = BlockShaderProgram;
115
+ //# sourceMappingURL=wipeBlock.block.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wipeBlock.block.js","sourceRoot":"","sources":["../../../../../src/blocks/babylon/demo/transitions/wipeBlock.block.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,+DAA+D;AAC/D,+DAA+D;AAC/D,+DAA+D;AAS/D,OAAO,EACH,aAAa,EAEb,mBAAmB,EAEnB,WAAW,GAEd,8BAAsB;AAEvB;;GAEG;AACH,MAAM,kBAAkB,GAAkB;IACtC,MAAM,EAAE,SAAS;IACjB,QAAQ,EAAE;QACN,OAAO,EAAE;;;sCAGqB;QAC9B,gBAAgB,EAAE,EAAE;QACpB,gBAAgB,EAAE,QAAQ;QAC1B,SAAS,EAAE;YACP;gBACI,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE;;;;;;qBAMD;gBACL,MAAM,EAAE,UAAU;aACrB;SACJ;KACJ;CACJ,CAAC;AAEF;;;GAGG;AACH,MAAM,QAAQ,GAAG;IACb,QAAQ,EAAE,UAAU;IACpB,QAAQ,EAAE,UAAU;IACpB,QAAQ,EAAE,UAAU;CACvB,CAAC;AAGF;;GAEG;AACH,MAAM,sBAAuB,SAAQ,aAAa;IAK9C;;;;;OAKG;IACH,YACI,QAAkD,EAClD,QAAkD,EAClD,QAAgD;QAEhD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;IAC9B,CAAC;IAED;;;OAGG;IACa,IAAI,CAAC,MAAc;QAC/B,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACjF,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACjF,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACnF,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,OAAO,SAAU,SAAQ,WAAW;IA+BtC;;;;OAIG;IACH,YAAY,WAAwB,EAAE,IAAY;QAC9C,KAAK,CAAC,WAAW,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;QA1BpC;;WAEG;QACa,aAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,QAAQ,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC;QAE/F;;WAEG;QACa,aAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,QAAQ,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC;QAE/F;;WAEG;QACa,aAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,QAAQ,EAAE,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAc7F,CAAC;IAED;;;OAGG;IACI,gBAAgB;QACnB,MAAM,QAAQ,GAAG,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACjE,MAAM,QAAQ,GAAG,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACjE,MAAM,QAAQ,GAAG,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAEjE,OAAO,IAAI,sBAAsB,CAAC,QAAQ,EAAC,QAAQ,EAAC,QAAQ,CAAC,CAAC;IAClE,CAAC;;AAjDD;;GAEG;AACoB,mBAAS,GAAG,WAAW,AAAd,CAAe;AAE/C;;GAEG;AACoB,mBAAS,GAAG,0BAA0B,AAA7B,CAA8B;AAiB9D;;GAEG;AACoB,oBAAU,GAAG,kBAAkB,AAArB,CAAsB"}
@@ -0,0 +1,2 @@
1
+ export * from "./premultiplyAlphaBlock.block.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/blocks/babylon/demo/utilities/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./premultiplyAlphaBlock.block.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/blocks/babylon/demo/utilities/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { DisableableShaderBinding, ConnectionPointType, type SmartFilter, DisableableShaderBlock, type ShaderProgram } from "@onerjs/smart-filters";
2
+ /**
3
+ * The implementation of the PremultiplyAlphaBlock
4
+ */
5
+ export declare class PremultiplyAlphaBlock extends DisableableShaderBlock {
6
+ /**
7
+ * The class name of the block.
8
+ */
9
+ static ClassName: string;
10
+ /**
11
+ * The namespace of the block.
12
+ */
13
+ static Namespace: string;
14
+ /**
15
+ * The input connection point.
16
+ */
17
+ readonly input: import("@onerjs/smart-filters").ConnectionPoint<ConnectionPointType.Texture>;
18
+ /**
19
+ * The shader program (vertex and fragment code) to use to render the block
20
+ */
21
+ static ShaderCode: ShaderProgram;
22
+ /**
23
+ * Instantiates a new PremultiplyAlphaBlock.
24
+ * @param smartFilter - The smart filter this block belongs to
25
+ * @param name - The friendly name of the block
26
+ */
27
+ constructor(smartFilter: SmartFilter, name: string);
28
+ /**
29
+ * Get the class instance that binds all the required data to the shader (effect) when rendering.
30
+ * @returns The class instance that binds the data to the effect
31
+ */
32
+ getShaderBinding(): DisableableShaderBinding;
33
+ }
34
+ //# sourceMappingURL=premultiplyAlphaBlock.block.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"premultiplyAlphaBlock.block.d.ts","sourceRoot":"","sources":["../../../../../src/blocks/babylon/demo/utilities/premultiplyAlphaBlock.block.ts"],"names":[],"mappings":"AAYA,OAAO,EACH,wBAAwB,EAExB,mBAAmB,EACnB,KAAK,WAAW,EAChB,sBAAsB,EACtB,KAAK,aAAa,EAEG,8BAAsB;AAiE/C;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,sBAAsB;IAC7D;;OAEG;IACH,OAAuB,SAAS,SAA2B;IAE3D;;OAEG;IACH,OAAuB,SAAS,SAA4B;IAE5D;;OAEG;IACH,SAAgB,KAAK,+EAAoE;IAEzF;;OAEG;IACH,OAAuB,UAAU,gBAAsB;IAEvD;;;;OAIG;gBACS,WAAW,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM;IAIlD;;;OAGG;IACI,gBAAgB,IAAI,wBAAwB;CAKtD"}
@@ -0,0 +1,96 @@
1
+ /* eslint-disable prettier/prettier */
2
+ // ************************************************************
3
+ // Note: this file is auto-generated, do not modify it directly
4
+ // ************************************************************
5
+ import { DisableableShaderBinding, ConnectionPointType, DisableableShaderBlock, BlockDisableStrategy } from "@onerjs/smart-filters";
6
+ /**
7
+ * The shader program for the block.
8
+ */
9
+ const BlockShaderProgram = {
10
+ vertex: undefined,
11
+ fragment: {
12
+ uniform: `
13
+ uniform sampler2D _input_; // main`,
14
+ mainInputTexture: "_input_",
15
+ mainFunctionName: "_premultiply_",
16
+ functions: [
17
+ {
18
+ name: "_premultiply_",
19
+ code: `
20
+ vec4 _premultiply_(vec2 vUV) {
21
+ vec4 color = texture2D(_input_, vUV);
22
+ return vec4(color.rgb * color.a, color.a);
23
+ }
24
+ `,
25
+ params: "vec2 vUV",
26
+ },
27
+ ],
28
+ },
29
+ };
30
+ /**
31
+ * The uniform names for this shader, to be used in the shader binding so
32
+ * that the names are always in sync.
33
+ */
34
+ const Uniforms = {
35
+ input: "input",
36
+ };
37
+ /**
38
+ * The shader binding for the PremultiplyAlphaBlock, used by the runtime
39
+ */
40
+ class PremultiplyAlphaBlockShaderBinding extends DisableableShaderBinding {
41
+ /**
42
+ * Creates a new shader binding instance for the block.
43
+ * @param parentBlock - IDisableableBlock
44
+ * @param input - The input runtime value
45
+ */
46
+ constructor(parentBlock, input) {
47
+ super(parentBlock);
48
+ this._input = input;
49
+ }
50
+ /**
51
+ * Binds all the required data to the shader when rendering.
52
+ * @param effect - defines the effect to bind the data to
53
+ */
54
+ bind(effect) {
55
+ super.bind(effect);
56
+ effect.setTexture(this.getRemappedName(Uniforms.input), this._input.value);
57
+ }
58
+ }
59
+ /**
60
+ * The implementation of the PremultiplyAlphaBlock
61
+ */
62
+ export class PremultiplyAlphaBlock extends DisableableShaderBlock {
63
+ /**
64
+ * Instantiates a new PremultiplyAlphaBlock.
65
+ * @param smartFilter - The smart filter this block belongs to
66
+ * @param name - The friendly name of the block
67
+ */
68
+ constructor(smartFilter, name) {
69
+ super(smartFilter, name, false, BlockDisableStrategy.AutoSample);
70
+ /**
71
+ * The input connection point.
72
+ */
73
+ this.input = this._registerInput(Uniforms.input, ConnectionPointType.Texture);
74
+ }
75
+ /**
76
+ * Get the class instance that binds all the required data to the shader (effect) when rendering.
77
+ * @returns The class instance that binds the data to the effect
78
+ */
79
+ getShaderBinding() {
80
+ const input = this._confirmRuntimeDataSupplied(this.input);
81
+ return new PremultiplyAlphaBlockShaderBinding(this, input);
82
+ }
83
+ }
84
+ /**
85
+ * The class name of the block.
86
+ */
87
+ PremultiplyAlphaBlock.ClassName = "PremultiplyAlphaBlock";
88
+ /**
89
+ * The namespace of the block.
90
+ */
91
+ PremultiplyAlphaBlock.Namespace = "Babylon.Demo.Utilities";
92
+ /**
93
+ * The shader program (vertex and fragment code) to use to render the block
94
+ */
95
+ PremultiplyAlphaBlock.ShaderCode = BlockShaderProgram;
96
+ //# sourceMappingURL=premultiplyAlphaBlock.block.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"premultiplyAlphaBlock.block.js","sourceRoot":"","sources":["../../../../../src/blocks/babylon/demo/utilities/premultiplyAlphaBlock.block.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,+DAA+D;AAC/D,+DAA+D;AAC/D,+DAA+D;AAS/D,OAAO,EACH,wBAAwB,EAExB,mBAAmB,EAEnB,sBAAsB,EAGtB,oBAAoB,EAAC,8BAAsB;AAE/C;;GAEG;AACH,MAAM,kBAAkB,GAAkB;IACtC,MAAM,EAAE,SAAS;IACjB,QAAQ,EAAE;QACN,OAAO,EAAE;+CAC8B;QACvC,gBAAgB,EAAE,SAAS;QAC3B,gBAAgB,EAAE,eAAe;QACjC,SAAS,EAAE;YACP;gBACI,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE;;;;;qBAKD;gBACL,MAAM,EAAE,UAAU;aACrB;SACJ;KACJ;CACJ,CAAC;AAEF;;;GAGG;AACH,MAAM,QAAQ,GAAG;IACb,KAAK,EAAE,OAAO;CACjB,CAAC;AAGF;;GAEG;AACH,MAAM,kCAAmC,SAAQ,wBAAwB;IAGrE;;;;OAIG;IACH,YACI,WAA8B,EAC9B,KAA+C;QAE/C,KAAK,CAAC,WAAW,CAAC,CAAC;QACnB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACxB,CAAC;IAED;;;OAGG;IACa,IAAI,CAAC,MAAc;QAC/B,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACnB,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC/E,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,OAAO,qBAAsB,SAAQ,sBAAsB;IAqB7D;;;;OAIG;IACH,YAAY,WAAwB,EAAE,IAAY;QAC9C,KAAK,CAAC,WAAW,EAAE,IAAI,EAAE,KAAK,EAAE,oBAAoB,CAAC,UAAU,CAAC,CAAC;QAhBrE;;WAEG;QACa,UAAK,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,KAAK,EAAE,mBAAmB,CAAC,OAAO,CAAC,CAAC;IAczF,CAAC;IAED;;;OAGG;IACI,gBAAgB;QACnB,MAAM,KAAK,GAAG,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAE3D,OAAO,IAAI,kCAAkC,CAAC,IAAI,EAAC,KAAK,CAAC,CAAC;IAC9D,CAAC;;AArCD;;GAEG;AACoB,+BAAS,GAAG,uBAAuB,AAA1B,CAA2B;AAE3D;;GAEG;AACoB,+BAAS,GAAG,wBAAwB,AAA3B,CAA4B;AAO5D;;GAEG;AACoB,gCAAU,GAAG,kBAAkB,AAArB,CAAsB"}
@@ -0,0 +1,5 @@
1
+ export declare const babylonDemoEffectsNamespace = "Babylon.Demo.Effects";
2
+ export declare const babylonDemoUtilitiesNamespace = "Babylon.Demo.Utilities";
3
+ export declare const babylonDemoTransitionsNamespace = "Babylon.Demo.Transitions";
4
+ export declare const inputsNamespace = "Inputs";
5
+ //# sourceMappingURL=blockNamespaces.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blockNamespaces.d.ts","sourceRoot":"","sources":["../../src/blocks/blockNamespaces.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,2BAA2B,yBAAyB,CAAC;AAClE,eAAO,MAAM,6BAA6B,2BAA2B,CAAC;AACtE,eAAO,MAAM,+BAA+B,6BAA6B,CAAC;AAC1E,eAAO,MAAM,eAAe,WAAW,CAAC"}
@@ -0,0 +1,7 @@
1
+ /* eslint-disable @typescript-eslint/naming-convention */
2
+ export const babylonDemoEffectsNamespace = "Babylon.Demo.Effects";
3
+ export const babylonDemoUtilitiesNamespace = "Babylon.Demo.Utilities";
4
+ export const babylonDemoTransitionsNamespace = "Babylon.Demo.Transitions";
5
+ export const inputsNamespace = "Inputs";
6
+ /* eslint-enable @typescript-eslint/naming-convention */
7
+ //# sourceMappingURL=blockNamespaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blockNamespaces.js","sourceRoot":"","sources":["../../src/blocks/blockNamespaces.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,MAAM,CAAC,MAAM,2BAA2B,GAAG,sBAAsB,CAAC;AAClE,MAAM,CAAC,MAAM,6BAA6B,GAAG,wBAAwB,CAAC;AACtE,MAAM,CAAC,MAAM,+BAA+B,GAAG,0BAA0B,CAAC;AAC1E,MAAM,CAAC,MAAM,eAAe,GAAG,QAAQ,CAAC;AACxC,wDAAwD"}
@@ -0,0 +1,22 @@
1
+ export declare const pixelateBlockType = "PixelateBlock";
2
+ export declare const blackAndWhiteBlockType = "BlackAndWhiteBlock";
3
+ export declare const exposureBlockType = "ExposureBlock";
4
+ export declare const contrastBlockType = "ContrastBlock";
5
+ export declare const desaturateBlockType = "DesaturateBlock";
6
+ export declare const posterizeBlockType = "PosterizeBlock";
7
+ export declare const kaleidoscopeBlockType = "KaleidoscopeBlock";
8
+ export declare const greenScreenBlockType = "GreenScreenBlock";
9
+ export declare const glassBlockType = "GlassBlock";
10
+ export declare const frameBlockType = "FrameBlock";
11
+ export declare const blurBlockType = "BlurBlock";
12
+ export declare const directionalBlurBlockType = "DirectionalBlurBlock";
13
+ export declare const compositionBlockType = "CompositionBlock";
14
+ export declare const glitchBlockType = "GlitchBlock";
15
+ export declare const tileBlockType = "TileBlock";
16
+ export declare const wipeBlockType = "WipeBlock";
17
+ export declare const maskBlockType = "MaskBlock";
18
+ export declare const particleBlockType = "ParticleBlock";
19
+ export declare const spritesheetBlockType = "SpritesheetBlock";
20
+ export declare const tintBlockType = "TintBlock";
21
+ export declare const premultiplyAlphaBlockType = "PremultiplyAlphaBlock";
22
+ //# sourceMappingURL=blockTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blockTypes.d.ts","sourceRoot":"","sources":["../../src/blocks/blockTypes.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,iBAAiB,kBAAkB,CAAC;AACjD,eAAO,MAAM,sBAAsB,uBAAuB,CAAC;AAC3D,eAAO,MAAM,iBAAiB,kBAAkB,CAAC;AACjD,eAAO,MAAM,iBAAiB,kBAAkB,CAAC;AACjD,eAAO,MAAM,mBAAmB,oBAAoB,CAAC;AACrD,eAAO,MAAM,kBAAkB,mBAAmB,CAAC;AACnD,eAAO,MAAM,qBAAqB,sBAAsB,CAAC;AACzD,eAAO,MAAM,oBAAoB,qBAAqB,CAAC;AACvD,eAAO,MAAM,cAAc,eAAe,CAAC;AAC3C,eAAO,MAAM,cAAc,eAAe,CAAC;AAC3C,eAAO,MAAM,aAAa,cAAc,CAAC;AACzC,eAAO,MAAM,wBAAwB,yBAAyB,CAAC;AAC/D,eAAO,MAAM,oBAAoB,qBAAqB,CAAC;AACvD,eAAO,MAAM,eAAe,gBAAgB,CAAC;AAC7C,eAAO,MAAM,aAAa,cAAc,CAAC;AACzC,eAAO,MAAM,aAAa,cAAc,CAAC;AACzC,eAAO,MAAM,aAAa,cAAc,CAAC;AACzC,eAAO,MAAM,iBAAiB,kBAAkB,CAAC;AACjD,eAAO,MAAM,oBAAoB,qBAAqB,CAAC;AACvD,eAAO,MAAM,aAAa,cAAc,CAAC;AACzC,eAAO,MAAM,yBAAyB,0BAA0B,CAAC"}
@@ -0,0 +1,24 @@
1
+ /* eslint-disable @typescript-eslint/naming-convention */
2
+ export const pixelateBlockType = "PixelateBlock";
3
+ export const blackAndWhiteBlockType = "BlackAndWhiteBlock";
4
+ export const exposureBlockType = "ExposureBlock";
5
+ export const contrastBlockType = "ContrastBlock";
6
+ export const desaturateBlockType = "DesaturateBlock";
7
+ export const posterizeBlockType = "PosterizeBlock";
8
+ export const kaleidoscopeBlockType = "KaleidoscopeBlock";
9
+ export const greenScreenBlockType = "GreenScreenBlock";
10
+ export const glassBlockType = "GlassBlock";
11
+ export const frameBlockType = "FrameBlock";
12
+ export const blurBlockType = "BlurBlock";
13
+ export const directionalBlurBlockType = "DirectionalBlurBlock";
14
+ export const compositionBlockType = "CompositionBlock";
15
+ export const glitchBlockType = "GlitchBlock";
16
+ export const tileBlockType = "TileBlock";
17
+ export const wipeBlockType = "WipeBlock";
18
+ export const maskBlockType = "MaskBlock";
19
+ export const particleBlockType = "ParticleBlock";
20
+ export const spritesheetBlockType = "SpritesheetBlock";
21
+ export const tintBlockType = "TintBlock";
22
+ export const premultiplyAlphaBlockType = "PremultiplyAlphaBlock";
23
+ /* eslint-enable @typescript-eslint/naming-convention */
24
+ //# sourceMappingURL=blockTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blockTypes.js","sourceRoot":"","sources":["../../src/blocks/blockTypes.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC;AACjD,MAAM,CAAC,MAAM,sBAAsB,GAAG,oBAAoB,CAAC;AAC3D,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC;AACjD,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC;AACjD,MAAM,CAAC,MAAM,mBAAmB,GAAG,iBAAiB,CAAC;AACrD,MAAM,CAAC,MAAM,kBAAkB,GAAG,gBAAgB,CAAC;AACnD,MAAM,CAAC,MAAM,qBAAqB,GAAG,mBAAmB,CAAC;AACzD,MAAM,CAAC,MAAM,oBAAoB,GAAG,kBAAkB,CAAC;AACvD,MAAM,CAAC,MAAM,cAAc,GAAG,YAAY,CAAC;AAC3C,MAAM,CAAC,MAAM,cAAc,GAAG,YAAY,CAAC;AAC3C,MAAM,CAAC,MAAM,aAAa,GAAG,WAAW,CAAC;AACzC,MAAM,CAAC,MAAM,wBAAwB,GAAG,sBAAsB,CAAC;AAC/D,MAAM,CAAC,MAAM,oBAAoB,GAAG,kBAAkB,CAAC;AACvD,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAAC;AAC7C,MAAM,CAAC,MAAM,aAAa,GAAG,WAAW,CAAC;AACzC,MAAM,CAAC,MAAM,aAAa,GAAG,WAAW,CAAC;AACzC,MAAM,CAAC,MAAM,aAAa,GAAG,WAAW,CAAC;AACzC,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC;AACjD,MAAM,CAAC,MAAM,oBAAoB,GAAG,kBAAkB,CAAC;AACvD,MAAM,CAAC,MAAM,aAAa,GAAG,WAAW,CAAC;AACzC,MAAM,CAAC,MAAM,yBAAyB,GAAG,uBAAuB,CAAC;AACjE,wDAAwD"}
@@ -0,0 +1,6 @@
1
+ export * from "./babylon/demo/effects/index.js";
2
+ export * from "./babylon/demo/transitions/index.js";
3
+ export * from "./babylon/demo/utilities/index.js";
4
+ export * from "./blockTypes.js";
5
+ export * from "./blockNamespaces.js";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/blocks/index.ts"],"names":[],"mappings":"AACA,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AACpD,cAAc,mCAAmC,CAAC;AAClD,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,7 @@
1
+ /* eslint-disable import/no-internal-modules */
2
+ export * from "./babylon/demo/effects/index.js";
3
+ export * from "./babylon/demo/transitions/index.js";
4
+ export * from "./babylon/demo/utilities/index.js";
5
+ export * from "./blockTypes.js";
6
+ export * from "./blockNamespaces.js";
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/blocks/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AACpD,cAAc,mCAAmC,CAAC;AAClD,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from "./registration/index.js";
2
+ export * from "./blocks/index.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ /* eslint-disable import/no-internal-modules */
2
+ export * from "./registration/index.js";
3
+ export * from "./blocks/index.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,38 @@
1
+ import type { ThinEngine } from "@onerjs/core/Engines/thinEngine.js";
2
+ import type { SmartFilter, SmartFilterDeserializer, ISerializedBlockV1, BaseBlock } from "@onerjs/smart-filters";
3
+ /**
4
+ * An object which describes a block definition, as well as a factory for creating a new instance of the block or
5
+ * deserializing it
6
+ */
7
+ export interface IBlockRegistration {
8
+ /**
9
+ * The block type of the block
10
+ */
11
+ blockType: string;
12
+ /**
13
+ * Creates an instance of the block, either fresh or deserialized from a serialized block
14
+ * @param smartFilter - The smart filter to create the block for
15
+ * @param engine - The engine to use for creating blocks
16
+ * @param smartFilterDeserializer - The deserializer to use for deserializing blocks
17
+ * @param serializedBlock - The serialized block to deserialize, if any
18
+ * @returns - A promise for a new instance of the block
19
+ */
20
+ factory?: (smartFilter: SmartFilter, engine: ThinEngine, smartFilterDeserializer: SmartFilterDeserializer, serializedBlock?: ISerializedBlockV1) => Promise<BaseBlock>;
21
+ /**
22
+ * The namespace of the block
23
+ */
24
+ namespace: string;
25
+ /**
26
+ * A tooltip for the block if displayed in an editor, for instance
27
+ */
28
+ tooltip: string;
29
+ /**
30
+ * True if this is an input block
31
+ */
32
+ isInput?: boolean;
33
+ /**
34
+ * If true, this represents a custom block (not one that was programmatically included)
35
+ */
36
+ isCustom?: boolean;
37
+ }
38
+ //# sourceMappingURL=IBlockRegistration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IBlockRegistration.d.ts","sourceRoot":"","sources":["../../src/registration/IBlockRegistration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,2CAAmC;AAC7D,OAAO,KAAK,EAAE,WAAW,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,SAAS,EAAE,8BAAsB;AAEzG;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IAC/B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,CAAC,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,eAAe,CAAC,EAAE,kBAAkB,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC;IAEvK;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=IBlockRegistration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IBlockRegistration.js","sourceRoot":"","sources":["../../src/registration/IBlockRegistration.ts"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ import type { IBlockSerializerV1 } from "@onerjs/smart-filters";
2
+ /**
3
+ * Any blocks that do not need to make use of ISerializedBlockV1.data can use the default serialization and
4
+ * should go in this list. If the serializer needs to store additional info in ISerializedBlockV1.data (e.g.
5
+ * webcam source name), then it should be registered in additionalBlockSerializers below.
6
+ */
7
+ export declare const blocksUsingDefaultSerialization: string[];
8
+ /**
9
+ * Any blocks which require serializing more information than just the connections should be registered here.
10
+ * They should make use of the ISerializedBlockV1.data field to store this information.
11
+ */
12
+ export declare const additionalBlockSerializers: IBlockSerializerV1[];
13
+ //# sourceMappingURL=blockSerializers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blockSerializers.d.ts","sourceRoot":"","sources":["../../src/registration/blockSerializers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,8BAAsB;AAqBxD;;;;GAIG;AAEH,eAAO,MAAM,+BAA+B,EAAE,MAAM,EAenD,CAAC;AAEF;;;GAGG;AAEH,eAAO,MAAM,0BAA0B,EAAE,kBAAkB,EAAsF,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { BlurBlockSerializer } from "../blocks/babylon/demo/effects/blurBlock.serializer.js";
2
+ import { DirectionalBlurBlockSerializer } from "../blocks/babylon/demo/effects/directionalBlurBlock.serializer.js";
3
+ import { CompositionBlockSerializer } from "../blocks/babylon/demo/effects/compositionBlock.serializer.js";
4
+ import { blackAndWhiteBlockType, pixelateBlockType, exposureBlockType, contrastBlockType, desaturateBlockType, posterizeBlockType, kaleidoscopeBlockType, greenScreenBlockType, maskBlockType, particleBlockType, spritesheetBlockType, tintBlockType, premultiplyAlphaBlockType, wipeBlockType, } from "../blocks/blockTypes.js";
5
+ /**
6
+ * Any blocks that do not need to make use of ISerializedBlockV1.data can use the default serialization and
7
+ * should go in this list. If the serializer needs to store additional info in ISerializedBlockV1.data (e.g.
8
+ * webcam source name), then it should be registered in additionalBlockSerializers below.
9
+ */
10
+ // eslint-disable-next-line @typescript-eslint/naming-convention
11
+ export const blocksUsingDefaultSerialization = [
12
+ blackAndWhiteBlockType,
13
+ pixelateBlockType,
14
+ exposureBlockType,
15
+ contrastBlockType,
16
+ desaturateBlockType,
17
+ posterizeBlockType,
18
+ kaleidoscopeBlockType,
19
+ greenScreenBlockType,
20
+ maskBlockType,
21
+ particleBlockType,
22
+ spritesheetBlockType,
23
+ tintBlockType,
24
+ premultiplyAlphaBlockType,
25
+ wipeBlockType,
26
+ ];
27
+ /**
28
+ * Any blocks which require serializing more information than just the connections should be registered here.
29
+ * They should make use of the ISerializedBlockV1.data field to store this information.
30
+ */
31
+ // eslint-disable-next-line @typescript-eslint/naming-convention
32
+ export const additionalBlockSerializers = [BlurBlockSerializer, DirectionalBlurBlockSerializer, CompositionBlockSerializer];
33
+ //# sourceMappingURL=blockSerializers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blockSerializers.js","sourceRoot":"","sources":["../../src/registration/blockSerializers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wDAAwD,CAAC;AAC7F,OAAO,EAAE,8BAA8B,EAAE,MAAM,mEAAmE,CAAC;AACnH,OAAO,EAAE,0BAA0B,EAAE,MAAM,+DAA+D,CAAC;AAC3G,OAAO,EACH,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,aAAa,EACb,iBAAiB,EACjB,oBAAoB,EACpB,aAAa,EACb,yBAAyB,EACzB,aAAa,GAChB,MAAM,yBAAyB,CAAC;AAEjC;;;;GAIG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,+BAA+B,GAAa;IACrD,sBAAsB;IACtB,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB;IACjB,mBAAmB;IACnB,kBAAkB;IAClB,qBAAqB;IACrB,oBAAoB;IACpB,aAAa;IACb,iBAAiB;IACjB,oBAAoB;IACpB,aAAa;IACb,yBAAyB;IACzB,aAAa;CAChB,CAAC;AAEF;;;GAGG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,0BAA0B,GAAyB,CAAC,mBAAmB,EAAE,8BAA8B,EAAE,0BAA0B,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { IBlockRegistration } from "./IBlockRegistration.js";
2
+ /**
3
+ * The list of block registrations.
4
+ *
5
+ * Important notes:
6
+ * 1. Do not import the block code directly in this file. Instead, use dynamic imports to ensure that the block code
7
+ * is only loaded when needed.
8
+ * 2. If the deserializer is trivial (doesn't require consulting the serializedBlock.data), it can be implemented here
9
+ * 3. If the deserializer is non-trivial (needs serializedBlock.data), implement it in a separate file alongside the block
10
+ * in the form blockClassName.deserializer.ts
11
+ */
12
+ export declare const BuiltInBlockRegistrations: IBlockRegistration[];
13
+ //# sourceMappingURL=builtInBlockRegistrations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builtInBlockRegistrations.d.ts","sourceRoot":"","sources":["../../src/registration/builtInBlockRegistrations.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAoBlE;;;;;;;;;GASG;AACH,eAAO,MAAM,yBAAyB,EAAE,kBAAkB,EAoQzD,CAAC"}