@lightningjs/renderer 2.16.0 → 2.17.0

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 (194) hide show
  1. package/dist/src/core/CoreTextureManager.js +1 -1
  2. package/dist/src/core/CoreTextureManager.js.map +1 -1
  3. package/dist/src/core/TextureMemoryManager.js +14 -32
  4. package/dist/src/core/TextureMemoryManager.js.map +1 -1
  5. package/dist/tsconfig.dist.tsbuildinfo +1 -1
  6. package/package.json +1 -1
  7. package/src/core/CoreTextureManager.ts +1 -1
  8. package/src/core/TextureMemoryManager.ts +21 -38
  9. package/dist/exports/canvas-shaders.d.ts +0 -10
  10. package/dist/exports/canvas-shaders.js +0 -27
  11. package/dist/exports/canvas-shaders.js.map +0 -1
  12. package/dist/exports/webgl-shaders.d.ts +0 -11
  13. package/dist/exports/webgl-shaders.js +0 -28
  14. package/dist/exports/webgl-shaders.js.map +0 -1
  15. package/dist/src/core/platforms/Platform.d.ts +0 -37
  16. package/dist/src/core/platforms/Platform.js +0 -22
  17. package/dist/src/core/platforms/Platform.js.map +0 -1
  18. package/dist/src/core/platforms/web/WebPlatform.d.ts +0 -9
  19. package/dist/src/core/platforms/web/WebPlatform.js +0 -58
  20. package/dist/src/core/platforms/web/WebPlatform.js.map +0 -1
  21. package/dist/src/core/renderers/CoreShaderNode.d.ts +0 -59
  22. package/dist/src/core/renderers/CoreShaderNode.js +0 -113
  23. package/dist/src/core/renderers/CoreShaderNode.js.map +0 -1
  24. package/dist/src/core/renderers/CoreShaderProgram.d.ts +0 -4
  25. package/dist/src/core/renderers/CoreShaderProgram.js +0 -20
  26. package/dist/src/core/renderers/CoreShaderProgram.js.map +0 -1
  27. package/dist/src/core/renderers/canvas/CanvasRenderer.d.ts +0 -37
  28. package/dist/src/core/renderers/canvas/CanvasRenderer.js +0 -215
  29. package/dist/src/core/renderers/canvas/CanvasRenderer.js.map +0 -1
  30. package/dist/src/core/renderers/canvas/CanvasShaderNode.d.ts +0 -21
  31. package/dist/src/core/renderers/canvas/CanvasShaderNode.js +0 -57
  32. package/dist/src/core/renderers/canvas/CanvasShaderNode.js.map +0 -1
  33. package/dist/src/core/renderers/canvas/CanvasTexture.d.ts +0 -16
  34. package/dist/src/core/renderers/canvas/CanvasTexture.js +0 -124
  35. package/dist/src/core/renderers/canvas/CanvasTexture.js.map +0 -1
  36. package/dist/src/core/renderers/webgl/WebGlCtxRenderTexture.d.ts +0 -12
  37. package/dist/src/core/renderers/webgl/WebGlCtxRenderTexture.js +0 -55
  38. package/dist/src/core/renderers/webgl/WebGlCtxRenderTexture.js.map +0 -1
  39. package/dist/src/core/renderers/webgl/WebGlCtxSubTexture.d.ts +0 -9
  40. package/dist/src/core/renderers/webgl/WebGlCtxSubTexture.js +0 -38
  41. package/dist/src/core/renderers/webgl/WebGlCtxSubTexture.js.map +0 -1
  42. package/dist/src/core/renderers/webgl/WebGlCtxTexture.d.ts +0 -57
  43. package/dist/src/core/renderers/webgl/WebGlCtxTexture.js +0 -224
  44. package/dist/src/core/renderers/webgl/WebGlCtxTexture.js.map +0 -1
  45. package/dist/src/core/renderers/webgl/WebGlRenderOp.d.ts +0 -44
  46. package/dist/src/core/renderers/webgl/WebGlRenderOp.js +0 -125
  47. package/dist/src/core/renderers/webgl/WebGlRenderOp.js.map +0 -1
  48. package/dist/src/core/renderers/webgl/WebGlRenderer.d.ts +0 -136
  49. package/dist/src/core/renderers/webgl/WebGlRenderer.js +0 -573
  50. package/dist/src/core/renderers/webgl/WebGlRenderer.js.map +0 -1
  51. package/dist/src/core/renderers/webgl/WebGlShaderNode.d.ts +0 -222
  52. package/dist/src/core/renderers/webgl/WebGlShaderNode.js +0 -331
  53. package/dist/src/core/renderers/webgl/WebGlShaderNode.js.map +0 -1
  54. package/dist/src/core/renderers/webgl/WebGlShaderProgram.d.ts +0 -35
  55. package/dist/src/core/renderers/webgl/WebGlShaderProgram.js +0 -201
  56. package/dist/src/core/renderers/webgl/WebGlShaderProgram.js.map +0 -1
  57. package/dist/src/core/shaders/canvas/Border.d.ts +0 -9
  58. package/dist/src/core/shaders/canvas/Border.js +0 -57
  59. package/dist/src/core/shaders/canvas/Border.js.map +0 -1
  60. package/dist/src/core/shaders/canvas/HolePunch.d.ts +0 -7
  61. package/dist/src/core/shaders/canvas/HolePunch.js +0 -38
  62. package/dist/src/core/shaders/canvas/HolePunch.js.map +0 -1
  63. package/dist/src/core/shaders/canvas/LinearGradient.d.ts +0 -10
  64. package/dist/src/core/shaders/canvas/LinearGradient.js +0 -48
  65. package/dist/src/core/shaders/canvas/LinearGradient.js.map +0 -1
  66. package/dist/src/core/shaders/canvas/RadialGradient.d.ts +0 -11
  67. package/dist/src/core/shaders/canvas/RadialGradient.js +0 -70
  68. package/dist/src/core/shaders/canvas/RadialGradient.js.map +0 -1
  69. package/dist/src/core/shaders/canvas/Rounded.d.ts +0 -7
  70. package/dist/src/core/shaders/canvas/Rounded.js +0 -33
  71. package/dist/src/core/shaders/canvas/Rounded.js.map +0 -1
  72. package/dist/src/core/shaders/canvas/RoundedWithBorder.d.ts +0 -7
  73. package/dist/src/core/shaders/canvas/RoundedWithBorder.js +0 -43
  74. package/dist/src/core/shaders/canvas/RoundedWithBorder.js.map +0 -1
  75. package/dist/src/core/shaders/canvas/RoundedWithBorderAndShadow.d.ts +0 -8
  76. package/dist/src/core/shaders/canvas/RoundedWithBorderAndShadow.js +0 -41
  77. package/dist/src/core/shaders/canvas/RoundedWithBorderAndShadow.js.map +0 -1
  78. package/dist/src/core/shaders/canvas/RoundedWithShadow.d.ts +0 -7
  79. package/dist/src/core/shaders/canvas/RoundedWithShadow.js +0 -40
  80. package/dist/src/core/shaders/canvas/RoundedWithShadow.js.map +0 -1
  81. package/dist/src/core/shaders/canvas/Shadow.d.ts +0 -8
  82. package/dist/src/core/shaders/canvas/Shadow.js +0 -31
  83. package/dist/src/core/shaders/canvas/Shadow.js.map +0 -1
  84. package/dist/src/core/shaders/canvas/utils/render.d.ts +0 -5
  85. package/dist/src/core/shaders/canvas/utils/render.js +0 -84
  86. package/dist/src/core/shaders/canvas/utils/render.js.map +0 -1
  87. package/dist/src/core/shaders/templates/BorderTemplate.d.ts +0 -37
  88. package/dist/src/core/shaders/templates/BorderTemplate.js +0 -73
  89. package/dist/src/core/shaders/templates/BorderTemplate.js.map +0 -1
  90. package/dist/src/core/shaders/templates/HolePunchTemplate.d.ts +0 -46
  91. package/dist/src/core/shaders/templates/HolePunchTemplate.js +0 -35
  92. package/dist/src/core/shaders/templates/HolePunchTemplate.js.map +0 -1
  93. package/dist/src/core/shaders/templates/LinearGradientTemplate.d.ts +0 -23
  94. package/dist/src/core/shaders/templates/LinearGradientTemplate.js +0 -47
  95. package/dist/src/core/shaders/templates/LinearGradientTemplate.js.map +0 -1
  96. package/dist/src/core/shaders/templates/RadialGradientTemplate.d.ts +0 -31
  97. package/dist/src/core/shaders/templates/RadialGradientTemplate.js +0 -49
  98. package/dist/src/core/shaders/templates/RadialGradientTemplate.js.map +0 -1
  99. package/dist/src/core/shaders/templates/RoundedTemplate.d.ts +0 -29
  100. package/dist/src/core/shaders/templates/RoundedTemplate.js +0 -67
  101. package/dist/src/core/shaders/templates/RoundedTemplate.js.map +0 -1
  102. package/dist/src/core/shaders/templates/RoundedWithBorderAndShadowTemplate.d.ts +0 -7
  103. package/dist/src/core/shaders/templates/RoundedWithBorderAndShadowTemplate.js +0 -24
  104. package/dist/src/core/shaders/templates/RoundedWithBorderAndShadowTemplate.js.map +0 -1
  105. package/dist/src/core/shaders/templates/RoundedWithBorderTemplate.d.ts +0 -6
  106. package/dist/src/core/shaders/templates/RoundedWithBorderTemplate.js +0 -23
  107. package/dist/src/core/shaders/templates/RoundedWithBorderTemplate.js.map +0 -1
  108. package/dist/src/core/shaders/templates/RoundedWithShadowTemplate.d.ts +0 -6
  109. package/dist/src/core/shaders/templates/RoundedWithShadowTemplate.js +0 -23
  110. package/dist/src/core/shaders/templates/RoundedWithShadowTemplate.js.map +0 -1
  111. package/dist/src/core/shaders/templates/ShadowTemplate.d.ts +0 -34
  112. package/dist/src/core/shaders/templates/ShadowTemplate.js +0 -66
  113. package/dist/src/core/shaders/templates/ShadowTemplate.js.map +0 -1
  114. package/dist/src/core/shaders/templates/shaderUtils.d.ts +0 -5
  115. package/dist/src/core/shaders/templates/shaderUtils.js +0 -41
  116. package/dist/src/core/shaders/templates/shaderUtils.js.map +0 -1
  117. package/dist/src/core/shaders/utils.d.ts +0 -5
  118. package/dist/src/core/shaders/utils.js +0 -41
  119. package/dist/src/core/shaders/utils.js.map +0 -1
  120. package/dist/src/core/shaders/webgl/Border.d.ts +0 -3
  121. package/dist/src/core/shaders/webgl/Border.js +0 -110
  122. package/dist/src/core/shaders/webgl/Border.js.map +0 -1
  123. package/dist/src/core/shaders/webgl/Default.d.ts +0 -2
  124. package/dist/src/core/shaders/webgl/Default.js +0 -86
  125. package/dist/src/core/shaders/webgl/Default.js.map +0 -1
  126. package/dist/src/core/shaders/webgl/DefaultBatched.d.ts +0 -2
  127. package/dist/src/core/shaders/webgl/DefaultBatched.js +0 -104
  128. package/dist/src/core/shaders/webgl/DefaultBatched.js.map +0 -1
  129. package/dist/src/core/shaders/webgl/HolePunch.d.ts +0 -3
  130. package/dist/src/core/shaders/webgl/HolePunch.js +0 -65
  131. package/dist/src/core/shaders/webgl/HolePunch.js.map +0 -1
  132. package/dist/src/core/shaders/webgl/LinearGradient.d.ts +0 -3
  133. package/dist/src/core/shaders/webgl/LinearGradient.js +0 -76
  134. package/dist/src/core/shaders/webgl/LinearGradient.js.map +0 -1
  135. package/dist/src/core/shaders/webgl/RadialGradient.d.ts +0 -3
  136. package/dist/src/core/shaders/webgl/RadialGradient.js +0 -74
  137. package/dist/src/core/shaders/webgl/RadialGradient.js.map +0 -1
  138. package/dist/src/core/shaders/webgl/Rounded.d.ts +0 -7
  139. package/dist/src/core/shaders/webgl/Rounded.js +0 -86
  140. package/dist/src/core/shaders/webgl/Rounded.js.map +0 -1
  141. package/dist/src/core/shaders/webgl/RoundedWithBorder.d.ts +0 -3
  142. package/dist/src/core/shaders/webgl/RoundedWithBorder.js +0 -140
  143. package/dist/src/core/shaders/webgl/RoundedWithBorder.js.map +0 -1
  144. package/dist/src/core/shaders/webgl/RoundedWithBorderAndShadow.d.ts +0 -3
  145. package/dist/src/core/shaders/webgl/RoundedWithBorderAndShadow.js +0 -162
  146. package/dist/src/core/shaders/webgl/RoundedWithBorderAndShadow.js.map +0 -1
  147. package/dist/src/core/shaders/webgl/RoundedWithShadow.d.ts +0 -3
  148. package/dist/src/core/shaders/webgl/RoundedWithShadow.js +0 -84
  149. package/dist/src/core/shaders/webgl/RoundedWithShadow.js.map +0 -1
  150. package/dist/src/core/shaders/webgl/SdfShader.d.ts +0 -32
  151. package/dist/src/core/shaders/webgl/SdfShader.js +0 -116
  152. package/dist/src/core/shaders/webgl/SdfShader.js.map +0 -1
  153. package/dist/src/core/shaders/webgl/Shadow.d.ts +0 -3
  154. package/dist/src/core/shaders/webgl/Shadow.js +0 -110
  155. package/dist/src/core/shaders/webgl/Shadow.js.map +0 -1
  156. package/dist/src/core/shaders/webgl/Spinner.d.ts +0 -1
  157. package/dist/src/core/shaders/webgl/Spinner.js +0 -2
  158. package/dist/src/core/shaders/webgl/Spinner.js.map +0 -1
  159. package/dist/src/core/text-rendering/CanvasFontHandler.d.ts +0 -25
  160. package/dist/src/core/text-rendering/CanvasFontHandler.js +0 -117
  161. package/dist/src/core/text-rendering/CanvasFontHandler.js.map +0 -1
  162. package/dist/src/core/text-rendering/CanvasTextRenderer.d.ts +0 -6
  163. package/dist/src/core/text-rendering/CanvasTextRenderer.js +0 -139
  164. package/dist/src/core/text-rendering/CanvasTextRenderer.js.map +0 -1
  165. package/dist/src/core/text-rendering/SdfFontHandler.d.ts +0 -137
  166. package/dist/src/core/text-rendering/SdfFontHandler.js +0 -336
  167. package/dist/src/core/text-rendering/SdfFontHandler.js.map +0 -1
  168. package/dist/src/core/text-rendering/SdfTextRenderer.d.ts +0 -21
  169. package/dist/src/core/text-rendering/SdfTextRenderer.js +0 -324
  170. package/dist/src/core/text-rendering/SdfTextRenderer.js.map +0 -1
  171. package/dist/src/core/text-rendering/TextRenderer.d.ts +0 -425
  172. package/dist/src/core/text-rendering/TextRenderer.js +0 -70
  173. package/dist/src/core/text-rendering/TextRenderer.js.map +0 -1
  174. package/dist/src/core/text-rendering/Utils.d.ts +0 -71
  175. package/dist/src/core/text-rendering/Utils.js +0 -212
  176. package/dist/src/core/text-rendering/Utils.js.map +0 -1
  177. package/dist/src/core/text-rendering/canvas/Settings.d.ts +0 -53
  178. package/dist/src/core/text-rendering/canvas/Settings.js +0 -20
  179. package/dist/src/core/text-rendering/canvas/Settings.js.map +0 -1
  180. package/dist/src/core/text-rendering/canvas/Utils.d.ts +0 -19
  181. package/dist/src/core/text-rendering/canvas/Utils.js +0 -139
  182. package/dist/src/core/text-rendering/canvas/Utils.js.map +0 -1
  183. package/dist/src/core/text-rendering/canvas/calculateRenderInfo.d.ts +0 -37
  184. package/dist/src/core/text-rendering/canvas/calculateRenderInfo.js +0 -188
  185. package/dist/src/core/text-rendering/canvas/calculateRenderInfo.js.map +0 -1
  186. package/dist/src/core/text-rendering/canvas/draw.d.ts +0 -12
  187. package/dist/src/core/text-rendering/canvas/draw.js +0 -133
  188. package/dist/src/core/text-rendering/canvas/draw.js.map +0 -1
  189. package/dist/src/core/text-rendering/sdf/PeekableGenerator.d.ts +0 -12
  190. package/dist/src/core/text-rendering/sdf/PeekableGenerator.js +0 -61
  191. package/dist/src/core/text-rendering/sdf/PeekableGenerator.js.map +0 -1
  192. package/dist/src/core/text-rendering/sdf/SimpleFontShaper.d.ts +0 -45
  193. package/dist/src/core/text-rendering/sdf/SimpleFontShaper.js +0 -69
  194. package/dist/src/core/text-rendering/sdf/SimpleFontShaper.js.map +0 -1
@@ -1,41 +0,0 @@
1
- /*
2
- * Copyright 2023 Comcast Cable Communications Management, LLC
3
- * Licensed under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License.
5
- * You may obtain a copy of the License at
6
- *
7
- * http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software
10
- * distributed under the License is distributed on an "AS IS" BASIS,
11
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- * See the License for the specific language governing permissions and
13
- * limitations under the License.
14
- *
15
- * SPDX-License-Identifier: Apache-2.0
16
- */
17
- import { calcFactoredRadiusArray, valuesAreEqual } from '../../lib/utils.js';
18
- import { RoundedWithBorderAndShadowTemplate, } from '../templates/RoundedWithBorderAndShadowTemplate.js';
19
- import * as render from './utils/render.js';
20
- export const RoundedWithBorderAndShadow = {
21
- props: RoundedWithBorderAndShadowTemplate.props,
22
- saveAndRestore: true,
23
- update(node) {
24
- const props = this.props;
25
- const radius = calcFactoredRadiusArray(props.radius, node.width, node.height);
26
- this.computed.radius = radius;
27
- this.computed.borderColor = this.toColorString(props['border-color']);
28
- this.computed.borderAsym = !valuesAreEqual(props['border-width']);
29
- const borderWidth = props['border-width'];
30
- this.computed.borderRadius = radius.map((value, index) => Math.max(0, value - borderWidth[index] * 0.5));
31
- this.computed.shadowColor = this.toColorString(props['shadow-color']);
32
- this.computed.shadowRadius = radius.map((value) => value + props['shadow-blur']);
33
- },
34
- render(ctx, quad, renderContext) {
35
- const { tx, ty, width, height } = quad;
36
- const computed = this.computed;
37
- render.shadow(ctx, tx, ty, height, width, computed.shadowColor, this.props['shadow-projection'], computed.shadowRadius, this.stage.pixelRatio);
38
- render.roundedRectWithBorder(ctx, quad.tx, quad.ty, quad.width, quad.height, computed.radius, this.props['border-width'], computed.borderRadius, computed.borderColor, computed.borderAsym, renderContext);
39
- },
40
- };
41
- //# sourceMappingURL=RoundedWithBorderAndShadow.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RoundedWithBorderAndShadow.js","sourceRoot":"","sources":["../../../../../src/core/shaders/canvas/RoundedWithBorderAndShadow.ts"],"names":[],"mappings":"AAAA;;;;;;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AChC,CAAC;IACZ,CAAC;IACD,MAAM,CAAC,GAAG,EAAE,IAAI,EAAE,aAAa;QAC7B,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;QACvC,MAAM,QAAQ,GAAG,IAAI,CAAC,QAA0B,CAAC;QACjD,MAAM,CAAC,MAAM,CACX,GAAG,EACH,EAAE,EACF,EAAE,EACF,MAAM,EACN,KAAK,EACL,QAAQ,CAAC,WAAW,EACpB,IAAI,CAAC,KAAM,CAAC,mBAAmB,CAAC,EAChC,QAAQ,CAAC,YAAY,EACrB,IAAI,CAAC,KAAK,CAAC,UAAU,CACtB,CAAC;QACF,MAAM,CAAC,qBAAqB,CAC1B,GAAG,EACH,IAAI,CAAC,EAAE,EACP,IAAI,CAAC,EAAE,EACP,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,MAAM,EACX,QAAQ,CAAC,MAAM,EACf,IAAI,CAAC,KAAM,CAAC,cAAc,CAAS,EACnC,QAAQ,CAAC,YAAY,EACrB,QAAQ,CAAC,WAAW,EACpB,QAAQ,CAAC,UAAU,EACnB,aAAa,CACd,CAAC;IACJ,CAAC;CACF,CAAC"}
@@ -1,7 +0,0 @@
1
- import type { CanvasShaderType } from '../../renderers/canvas/CanvasShaderNode.js';
2
- import { type RoundedWithShadowProps } from '../templates/RoundedWithShadowTemplate.js';
3
- import type { ComputedRoundedValues } from './Rounded.js';
4
- import type { ComputedShadowValues } from './Shadow.js';
5
- type ComputedValues = ComputedRoundedValues & ComputedShadowValues;
6
- export declare const RoundedWithShadow: CanvasShaderType<RoundedWithShadowProps, ComputedValues>;
7
- export {};
@@ -1,40 +0,0 @@
1
- /*
2
- * Copyright 2023 Comcast Cable Communications Management, LLC
3
- * Licensed under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License.
5
- * You may obtain a copy of the License at
6
- *
7
- * http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software
10
- * distributed under the License is distributed on an "AS IS" BASIS,
11
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- * See the License for the specific language governing permissions and
13
- * limitations under the License.
14
- *
15
- * SPDX-License-Identifier: Apache-2.0
16
- */
17
- import { calcFactoredRadiusArray } from '../../lib/utils.js';
18
- import { RoundedWithShadowTemplate, } from '../templates/RoundedWithShadowTemplate.js';
19
- import * as render from './utils/render.js';
20
- export const RoundedWithShadow = {
21
- props: RoundedWithShadowTemplate.props,
22
- saveAndRestore: true,
23
- update(node) {
24
- const props = this.props;
25
- const radius = calcFactoredRadiusArray(props.radius, node.width, node.height);
26
- this.computed.radius = radius;
27
- this.computed.shadowColor = this.toColorString(props['shadow-color']);
28
- this.computed.shadowRadius = radius.map((value) => value + props['shadow-blur']);
29
- },
30
- render(ctx, quad, renderContext) {
31
- const { tx, ty, width, height } = quad;
32
- const computed = this.computed;
33
- render.shadow(ctx, tx, ty, width, height, computed.shadowColor, this.props['shadow-projection'], computed.shadowRadius, this.stage.pixelRatio);
34
- const path = new Path2D();
35
- render.roundRect(path, tx, ty, width, height, computed.radius);
36
- ctx.clip(path);
37
- renderContext();
38
- },
39
- };
40
- //# sourceMappingURL=RoundedWithShadow.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RoundedWithShadow.js","sourceRoot":"","sources":["../../../../../src/core/shaders/canvas/RoundedWithShadow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAG7D,OAAO,EACL,yBAAyB,GAE1B,MAAM,2CAA2C,CAAC;AAGnD,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAI5C,MAAM,CAAC,MAAM,iBAAiB,GAG1B;IACF,KAAK,EAAE,yBAAyB,CAAC,KAAK;IACtC,cAAc,EAAE,IAAI;IACpB,MAAM,CAAC,IAAI;QACT,MAAM,KAAK,GAAG,IAAI,CAAC,KAAM,CAAC;QAC1B,MAAM,MAAM,GAAG,uBAAuB,CACpC,KAAK,CAAC,MAAc,EACpB,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,MAAM,CACZ,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAC;QAC9B,IAAI,CAAC,QAAQ,CAAC,WAAW,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC;QACtE,IAAI,CAAC,QAAQ,CAAC,YAAY,GAAG,MAAM,CAAC,GAAG,CACrC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,GAAG,KAAK,CAAC,aAAa,CAAC,CAChC,CAAC;IACZ,CAAC;IACD,MAAM,CAAC,GAAG,EAAE,IAAI,EAAE,aAAa;QAC7B,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;QACvC,MAAM,QAAQ,GAAG,IAAI,CAAC,QAA0B,CAAC;QACjD,MAAM,CAAC,MAAM,CACX,GAAG,EACH,EAAE,EACF,EAAE,EACF,KAAK,EACL,MAAM,EACN,QAAQ,CAAC,WAAW,EACpB,IAAI,CAAC,KAAM,CAAC,mBAAmB,CAAC,EAChC,QAAQ,CAAC,YAAY,EACrB,IAAI,CAAC,KAAK,CAAC,UAAU,CACtB,CAAC;QAEF,MAAM,IAAI,GAAG,IAAI,MAAM,EAAE,CAAC;QAC1B,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC/D,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACf,aAAa,EAAE,CAAC;IAClB,CAAC;CACF,CAAC"}
@@ -1,8 +0,0 @@
1
- import type { CanvasShaderType } from '../../renderers/canvas/CanvasShaderNode.js';
2
- import type { Vec4 } from '../../renderers/webgl/internal/ShaderUtils.js';
3
- import { type ShadowProps } from '../templates/ShadowTemplate.js';
4
- export interface ComputedShadowValues {
5
- shadowColor: string;
6
- shadowRadius: Vec4;
7
- }
8
- export declare const Shadow: CanvasShaderType<ShadowProps, ComputedShadowValues>;
@@ -1,31 +0,0 @@
1
- /*
2
- * Copyright 2023 Comcast Cable Communications Management, LLC
3
- * Licensed under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License.
5
- * You may obtain a copy of the License at
6
- *
7
- * http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software
10
- * distributed under the License is distributed on an "AS IS" BASIS,
11
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- * See the License for the specific language governing permissions and
13
- * limitations under the License.
14
- *
15
- * SPDX-License-Identifier: Apache-2.0
16
- */
17
- import { ShadowTemplate, } from '../templates/ShadowTemplate.js';
18
- import { shadow } from './utils/render.js';
19
- export const Shadow = {
20
- props: ShadowTemplate.props,
21
- update() {
22
- this.computed.shadowColor = this.toColorString(this.props['color']);
23
- const blur = this.props['blur'];
24
- this.computed.shadowRadius = [blur, blur, blur, blur];
25
- },
26
- render(ctx, quad, renderContext) {
27
- shadow(ctx, quad.tx, quad.ty, quad.width, quad.height, this.computed.shadowColor, this.props['projection'], this.computed.shadowRadius, this.stage.pixelRatio);
28
- renderContext();
29
- },
30
- };
31
- //# sourceMappingURL=Shadow.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Shadow.js","sourceRoot":"","sources":["../../../../../src/core/shaders/canvas/Shadow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,EACL,cAAc,GAEf,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAO3C,MAAM,CAAC,MAAM,MAAM,GAAwD;IACzE,KAAK,EAAE,cAAc,CAAC,KAAK;IAC3B,MAAM;QACJ,IAAI,CAAC,QAAQ,CAAC,WAAW,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,KAAM,CAAC,OAAO,CAAC,CAAC,CAAC;QACrE,MAAM,IAAI,GAAG,IAAI,CAAC,KAAM,CAAC,MAAM,CAAC,CAAC;QACjC,IAAI,CAAC,QAAQ,CAAC,YAAY,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IACxD,CAAC;IACD,MAAM,CAAC,GAAG,EAAE,IAAI,EAAE,aAAa;QAC7B,MAAM,CACJ,GAAG,EACH,IAAI,CAAC,EAAE,EACP,IAAI,CAAC,EAAE,EACP,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,QAAQ,CAAC,WAAY,EAC1B,IAAI,CAAC,KAAM,CAAC,YAAY,CAAC,EACzB,IAAI,CAAC,QAAQ,CAAC,YAAa,EAC3B,IAAI,CAAC,KAAK,CAAC,UAAU,CACtB,CAAC;QACF,aAAa,EAAE,CAAC;IAClB,CAAC;CACF,CAAC"}
@@ -1,5 +0,0 @@
1
- import type { Vec4 } from '../../../renderers/webgl/internal/ShaderUtils.js';
2
- export declare function roundRect(ctx: CanvasRenderingContext2D | Path2D, x: number, y: number, width: number, height: number, radius: Vec4): void;
3
- export declare function roundedRectWithBorder(ctx: CanvasRenderingContext2D, x: number, y: number, width: number, height: number, radius: Vec4, borderWidth: Vec4, borderRadius: Vec4, borderColor: string, borderAsym: boolean, renderContext: () => void): void;
4
- export declare function shadow(ctx: CanvasRenderingContext2D, x: number, y: number, width: number, height: number, color: string, projection: Vec4, radius: Vec4, pixelRatio: number): void;
5
- export declare function strokeLine(ctx: CanvasRenderingContext2D, x: number, y: number, x2: number, y2: number, lineWidth: number): void;
@@ -1,84 +0,0 @@
1
- /*
2
- * Copyright 2023 Comcast Cable Communications Management, LLC
3
- * Licensed under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License.
5
- * You may obtain a copy of the License at
6
- *
7
- * http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software
10
- * distributed under the License is distributed on an "AS IS" BASIS,
11
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- * See the License for the specific language governing permissions and
13
- * limitations under the License.
14
- *
15
- * SPDX-License-Identifier: Apache-2.0
16
- */
17
- export function roundRect(ctx, x, y, width, height, radius) {
18
- if (ctx.roundRect !== undefined) {
19
- ctx.roundRect(x, y, width, height, radius);
20
- return;
21
- }
22
- const { 0: tl, 1: tr, 2: br, 3: bl } = radius;
23
- ctx.moveTo(x + tl, y);
24
- ctx.lineTo(x + width - tr, y);
25
- ctx.ellipse(x + width - tr, y + tr, tr, tr, 0, 1.5 * Math.PI, 2 * Math.PI);
26
- ctx.lineTo(x + width, y - height - br);
27
- ctx.ellipse(x + width - br, y + height - br, br, br, 0, 0, 0.5 * Math.PI);
28
- ctx.lineTo(x + bl, y + height);
29
- ctx.ellipse(x + bl, y + height - bl, bl, bl, 0, 0.5 * Math.PI, Math.PI);
30
- ctx.lineTo(x, y + tl);
31
- ctx.ellipse(x + tl, y + tl, tl, tl, 0, Math.PI, 1.5 * Math.PI);
32
- }
33
- export function roundedRectWithBorder(ctx, x, y, width, height, radius, borderWidth, borderRadius, borderColor, borderAsym, renderContext) {
34
- if (borderAsym === false) {
35
- const bWidth = borderWidth[0];
36
- const bHalfWidth = bWidth * 0.5;
37
- const path = new Path2D();
38
- roundRect(path, x, y, width, height, radius);
39
- ctx.clip(path);
40
- renderContext();
41
- if (bWidth > 0) {
42
- ctx.beginPath();
43
- ctx.lineWidth = bWidth;
44
- ctx.strokeStyle = borderColor;
45
- roundRect(ctx, x + bHalfWidth, y + bHalfWidth, width - bWidth, height - bWidth, borderRadius);
46
- ctx.stroke();
47
- }
48
- return;
49
- }
50
- ctx.beginPath();
51
- roundRect(ctx, x, y, width, height, radius);
52
- ctx.fillStyle = borderColor;
53
- ctx.fill();
54
- const { 0: t, 1: r, 2: b, 3: l } = borderWidth;
55
- const path = new Path2D();
56
- roundRect(path, x + l, y + t, width - (l + r), height - (t + b), borderRadius);
57
- ctx.clip(path);
58
- renderContext();
59
- }
60
- export function shadow(ctx, x, y, width, height, color, projection, radius, pixelRatio) {
61
- ctx.save();
62
- const cw = ctx.canvas.width;
63
- const ch = ctx.canvas.height;
64
- const scaleFactor = (2 * projection[3] + width) / width;
65
- ctx.scale(scaleFactor, scaleFactor);
66
- ctx.shadowColor = color;
67
- ctx.shadowBlur = projection[2] * pixelRatio;
68
- ctx.shadowOffsetX = projection[0] + cw * pixelRatio - projection[3] * 0.5;
69
- ctx.shadowOffsetY = projection[1] + ch * pixelRatio - projection[3] * 0.5;
70
- const spreadFactor = projection[3];
71
- ctx.beginPath();
72
- roundRect(ctx, (x - spreadFactor - cw) / scaleFactor, (y - spreadFactor - ch) / scaleFactor, width + spreadFactor, height + spreadFactor, radius);
73
- ctx.fillStyle = color;
74
- ctx.fill();
75
- ctx.restore();
76
- }
77
- export function strokeLine(ctx, x, y, x2, y2, lineWidth) {
78
- ctx.beginPath();
79
- ctx.lineWidth = lineWidth;
80
- ctx.moveTo(x, y);
81
- ctx.lineTo(x2, y2);
82
- ctx.stroke();
83
- }
84
- //# sourceMappingURL=render.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"render.js","sourceRoot":"","sources":["../../../../../../src/core/shaders/canvas/utils/render.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,MAAM,UAAU,SAAS,CACvB,GAAsC,EACtC,CAAS,EACT,CAAS,EACT,KAAa,EACb,MAAc,EACd,MAAY;IAEZ,IAAI,GAAG,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;QAChC,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QAC3C,OAAO;IACT,CAAC;IACD,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC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,CAAC,CAAC,CAAC;IACnC,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,SAAS,CACP,GAAG,EACH,CAAC,CAAC,GAAG,YAAY,GAAG,EAAE,CAAC,GAAG,WAAW,EACrC,CAAC,CAAC,GAAG,YAAY,GAAG,EAAE,CAAC,GAAG,WAAW,EACrC,KAAK,GAAG,YAAY,EACpB,MAAM,GAAG,YAAY,EACrB,MAAM,CACP,CAAC;IACF,GAAG,CAAC,SAAS,GAAG,KAAK,CAAC;IACtB,GAAG,CAAC,IAAI,EAAE,CAAC;IACX,GAAG,CAAC,OAAO,EAAE,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,UAAU,CACxB,GAA6B,EAC7B,CAAS,EACT,CAAS,EACT,EAAU,EACV,EAAU,EACV,SAAiB;IAEjB,GAAG,CAAC,SAAS,EAAE,CAAC;IAChB,GAAG,CAAC,SAAS,GAAG,SAAS,CAAC;IAC1B,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACjB,GAAG,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;IACnB,GAAG,CAAC,MAAM,EAAE,CAAC;AACf,CAAC"}
@@ -1,37 +0,0 @@
1
- import type { CoreShaderType } from '../../renderers/CoreShaderNode.js';
2
- import { type PrefixedType } from '../utils.js';
3
- /**
4
- * Properties of the {@link Border} shader
5
- */
6
- export interface BorderProps {
7
- /**
8
- * Width of the border in pixels
9
- *
10
- * @default 0
11
- */
12
- width: number | [number, number, number, number];
13
- /**
14
- * Color of the border in 0xRRGGBBAA
15
- *
16
- * @default 0xffffffff
17
- */
18
- color: number;
19
- /**
20
- * Top width
21
- */
22
- top: number;
23
- /**
24
- * Right width
25
- */
26
- right: number;
27
- /**
28
- * Bottom width
29
- */
30
- bottom: number;
31
- /**
32
- * Left width
33
- */
34
- left: number;
35
- }
36
- export declare function getBorderProps<P extends string>(prefix?: P): PrefixedType<BorderProps, P>;
37
- export declare const BorderTemplate: CoreShaderType<BorderProps>;
@@ -1,73 +0,0 @@
1
- /*
2
- * Copyright 2023 Comcast Cable Communications Management, LLC
3
- * Licensed under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License.
5
- * You may obtain a copy of the License at
6
- *
7
- * http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software
10
- * distributed under the License is distributed on an "AS IS" BASIS,
11
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- * See the License for the specific language governing permissions and
13
- * limitations under the License.
14
- *
15
- * SPDX-License-Identifier: Apache-2.0
16
- */
17
- import { validateArrayLength4 } from '../utils.js';
18
- export function getBorderProps(prefix) {
19
- const pf = prefix && prefix.length > 0 ? `${prefix}-` : '';
20
- const width = pf + 'width';
21
- return {
22
- [width]: {
23
- default: [0, 0, 0, 0],
24
- resolve(value) {
25
- if (value !== undefined) {
26
- return validateArrayLength4(value);
27
- }
28
- return [].concat(this.default);
29
- },
30
- },
31
- [pf + 'color']: 0xffffffff,
32
- [pf + 'top']: {
33
- default: 0,
34
- set(value, props) {
35
- props[width][0] = value;
36
- },
37
- get(props) {
38
- return props[width][0];
39
- },
40
- },
41
- [pf + 'right']: {
42
- default: 0,
43
- set(value, props) {
44
- props[width][1] = value;
45
- },
46
- get(props) {
47
- return props[width][1];
48
- },
49
- },
50
- [pf + 'bottom']: {
51
- default: 0,
52
- set(value, props) {
53
- props[width][2] = value;
54
- },
55
- get(props) {
56
- return props[width][2];
57
- },
58
- },
59
- [pf + 'left']: {
60
- default: 0,
61
- set(value, props) {
62
- props[width][3] = value;
63
- },
64
- get(props) {
65
- return props[width][3];
66
- },
67
- },
68
- };
69
- }
70
- export const BorderTemplate = {
71
- props: getBorderProps(),
72
- };
73
- //# sourceMappingURL=BorderTemplate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BorderTemplate.js","sourceRoot":"","sources":["../../../../../src/core/shaders/templates/BorderTemplate.ts"],"names":[],"mappings":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;QACD,CAAC,EAAE,GAAG,QAAQ,CAAC,EAAE;YACf,OAAO,EAAE,CAAC;YACV,GAAG,CAAC,KAAK,EAAE,KAAK;gBACb,KAAK,CAAC,KAAK,CAAU,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;YACpC,CAAC;YACD,GAAG,CAAC,KAAK;gBACP,OAAQ,KAAK,CAAC,KAAK,CAAU,CAAC,CAAC,CAAC,CAAC;YACnC,CAAC;SACF;QACD,CAAC,EAAE,GAAG,MAAM,CAAC,EAAE;YACb,OAAO,EAAE,CAAC;YACV,GAAG,CAAC,KAAK,EAAE,KAAK;gBACb,KAAK,CAAC,KAAK,CAAU,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC;YACpC,CAAC;YACD,GAAG,CAAC,KAAK;gBACP,OAAQ,KAAK,CAAC,KAAK,CAAU,CAAC,CAAC,CAAC,CAAC;YACnC,CAAC;SACF;KAC8B,CAAC;AACpC,CAAC;AAID,MAAM,CAAC,MAAM,cAAc,GAAgC;IACzD,KAAK,EAAE,cAAc,EAAsB;CAC5C,CAAC"}
@@ -1,46 +0,0 @@
1
- import type { CoreShaderType } from '../../renderers/CoreShaderNode.js';
2
- /**
3
- * Properties of the {@link HolePunch} shader
4
- */
5
- export interface HolePunchProps {
6
- /**
7
- * X position where the hole punch starts
8
- */
9
- x: number;
10
- /**
11
- * Y position where the hole punch starts
12
- */
13
- y: number;
14
- /**
15
- * Width of the hole punch
16
- */
17
- width: number;
18
- /**
19
- * height of the hole punch
20
- *
21
- * @remarks if not defined uses the width value
22
- */
23
- height: number;
24
- /**
25
- * Corner radius in pixels, to cut out of the corners of the hole punch
26
- *
27
- * @remarks
28
- * You can input an array with a length of up to four or a number.
29
- *
30
- * array length 4:
31
- * [topLeft, topRight, bottomRight, bottomLeft]
32
- *
33
- * array length 2:
34
- * [20, 40] -> [20(topLeft), 40(topRight), 20(bottomRight), 40(bottomLeft)]
35
- *
36
- * array length 3:
37
- * [20, 40, 60] -> [20(topLeft), 40(topRight), 60(bottomRight), 20(bottomLeft)]
38
- *
39
- * number:
40
- * 30 -> [30, 30, 30, 30]
41
- *
42
- * @default -1
43
- */
44
- radius: number | number[];
45
- }
46
- export declare const HolePunchTemplate: CoreShaderType<HolePunchProps>;
@@ -1,35 +0,0 @@
1
- /*
2
- * Copyright 2023 Comcast Cable Communications Management, LLC
3
- * Licensed under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License.
5
- * You may obtain a copy of the License at
6
- *
7
- * http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software
10
- * distributed under the License is distributed on an "AS IS" BASIS,
11
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- * See the License for the specific language governing permissions and
13
- * limitations under the License.
14
- *
15
- * SPDX-License-Identifier: Apache-2.0
16
- */
17
- import { validateArrayLength4 } from '../utils.js';
18
- export const HolePunchTemplate = {
19
- props: {
20
- x: 0,
21
- y: 0,
22
- width: 50,
23
- height: 50,
24
- radius: {
25
- default: [0, 0, 0, 0],
26
- resolve(value) {
27
- if (value !== undefined) {
28
- return validateArrayLength4(value);
29
- }
30
- return [].concat(this.default);
31
- },
32
- },
33
- },
34
- };
35
- //# sourceMappingURL=HolePunchTemplate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HolePunchTemplate.js","sourceRoot":"","sources":["../../../../../src/core/shaders/templates/HolePunchTemplate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AA+CnD,MAAM,CAAC,MAAM,iBAAiB,GAAmC;IAC/D,KAAK,EAAE;QACL,CAAC,EAAE,CAAC;QACJ,CAAC,EAAE,CAAC;QACJ,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,MAAM,EAAE;YACN,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;YACrB,OAAO,CAAC,KAAK;gBACX,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;oBACxB,OAAO,oBAAoB,CAAC,KAAK,CAAC,CAAC;gBACrC,CAAC;gBACD,OAAQ,EAAe,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC/C,CAAC;SACF;KACF;CACF,CAAC"}
@@ -1,23 +0,0 @@
1
- import type { CoreShaderType } from '../../renderers/CoreShaderNode.js';
2
- /**
3
- * Properties of the {@link LinearGradient} shader
4
- */
5
- export interface LinearGradientProps {
6
- /**
7
- * Array of colors to be used in the LinearGradient shader
8
- *
9
- * @default [0xff000000, 0xffffffff]
10
- */
11
- colors: number[];
12
- /**
13
- * Angle of the LinearGradient shader, Angle in Radians
14
- *
15
- * @default 0
16
- */
17
- angle: number;
18
- /**
19
- * Array of color stops
20
- */
21
- stops: number[];
22
- }
23
- export declare const LinearGradientTemplate: CoreShaderType<LinearGradientProps>;
@@ -1,47 +0,0 @@
1
- /*
2
- * Copyright 2023 Comcast Cable Communications Management, LLC
3
- * Licensed under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License.
5
- * You may obtain a copy of the License at
6
- *
7
- * http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software
10
- * distributed under the License is distributed on an "AS IS" BASIS,
11
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- * See the License for the specific language governing permissions and
13
- * limitations under the License.
14
- *
15
- * SPDX-License-Identifier: Apache-2.0
16
- */
17
- export const LinearGradientTemplate = {
18
- props: {
19
- colors: {
20
- default: [0x000000ff, 0xffffffff],
21
- resolve(value) {
22
- if (value !== undefined && value.length > 0) {
23
- return value;
24
- }
25
- return [].concat(this.default);
26
- },
27
- },
28
- stops: {
29
- default: [0, 1],
30
- resolve(value, props) {
31
- if (value !== undefined && value.length === props.colors.length) {
32
- return value;
33
- }
34
- if (value === undefined) {
35
- value = [];
36
- }
37
- const len = props.colors.length;
38
- for (let i = 0; i < len; i++) {
39
- value[i] = i * (1 / (len - 1));
40
- }
41
- return value;
42
- },
43
- },
44
- angle: 0,
45
- },
46
- };
47
- //# sourceMappingURL=LinearGradientTemplate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LinearGradientTemplate.js","sourceRoot":"","sources":["../../../../../src/core/shaders/templates/LinearGradientTemplate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AA0BH,MAAM,CAAC,MAAM,sBAAsB,GAAwC;IACzE,KAAK,EAAE;QACL,MAAM,EAAE;YACN,OAAO,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC;YACjC,OAAO,CAAC,KAAK;gBACX,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBAC5C,OAAO,KAAK,CAAC;gBACf,CAAC;gBACD,OAAQ,EAAe,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC/C,CAAC;SACF;QACD,KAAK,EAAE;YACL,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;YACf,OAAO,CAAC,KAAK,EAAE,KAAK;gBAClB,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;oBAChE,OAAO,KAAK,CAAC;gBACf,CAAC;gBACD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;oBACxB,KAAK,GAAG,EAAE,CAAC;gBACb,CAAC;gBACD,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC;gBAChC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;oBAC7B,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;gBACjC,CAAC;gBACD,OAAO,KAAK,CAAC;YACf,CAAC;SACF;QACD,KAAK,EAAE,CAAC;KACT;CACF,CAAC"}
@@ -1,31 +0,0 @@
1
- import type { CoreShaderType } from '../../renderers/CoreShaderNode.js';
2
- /**
3
- * Properties of the {@link RadialGradient} shader
4
- */
5
- export interface RadialGradientProps {
6
- /**
7
- * Array of colors to be used in the RadialGradient shader
8
- *
9
- * @default [0xff000000, 0xffffffff]
10
- */
11
- colors: number[];
12
- /**
13
- * Array of color stops
14
- */
15
- stops: number[];
16
- /**
17
- * Width of the RadialGradientEffect
18
- */
19
- width: number;
20
- /**
21
- * height of the RadialGradientEffect
22
- *
23
- * @remarks if not defined uses the width value
24
- */
25
- height: number;
26
- /**
27
- * center point of where the RadialGradientEffect is drawn
28
- */
29
- pivot: [number, number];
30
- }
31
- export declare const RadialGradientTemplate: CoreShaderType<RadialGradientProps>;
@@ -1,49 +0,0 @@
1
- /*
2
- * Copyright 2023 Comcast Cable Communications Management, LLC
3
- * Licensed under the Apache License, Version 2.0 (the "License");
4
- * you may not use this file except in compliance with the License.
5
- * You may obtain a copy of the License at
6
- *
7
- * http://www.apache.org/licenses/LICENSE-2.0
8
- *
9
- * Unless required by applicable law or agreed to in writing, software
10
- * distributed under the License is distributed on an "AS IS" BASIS,
11
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- * See the License for the specific language governing permissions and
13
- * limitations under the License.
14
- *
15
- * SPDX-License-Identifier: Apache-2.0
16
- */
17
- export const RadialGradientTemplate = {
18
- props: {
19
- colors: {
20
- default: [0x000000ff, 0xffffffff],
21
- resolve(value) {
22
- if (value !== undefined && value.length > 0) {
23
- return value;
24
- }
25
- return [].concat(this.default);
26
- },
27
- },
28
- stops: {
29
- default: [0, 1],
30
- resolve(value, props) {
31
- if (value !== undefined && value.length === props.colors.length) {
32
- return value;
33
- }
34
- if (value === undefined) {
35
- value = [];
36
- }
37
- const len = props.colors.length;
38
- for (let i = 0; i < len; i++) {
39
- value[i] = i * (1 / (len - 1));
40
- }
41
- return value;
42
- },
43
- },
44
- width: 50,
45
- height: 50,
46
- pivot: [0.5, 0.5],
47
- },
48
- };
49
- //# sourceMappingURL=RadialGradientTemplate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RadialGradientTemplate.js","sourceRoot":"","sources":["../../../../../src/core/shaders/templates/RadialGradientTemplate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAkCH,MAAM,CAAC,MAAM,sBAAsB,GAAwC;IACzE,KAAK,EAAE;QACL,MAAM,EAAE;YACN,OAAO,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC;YACjC,OAAO,CAAC,KAAK;gBACX,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBAC5C,OAAO,KAAK,CAAC;gBACf,CAAC;gBACD,OAAQ,EAAe,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC/C,CAAC;SACF;QACD,KAAK,EAAE;YACL,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;YACf,OAAO,CAAC,KAAK,EAAE,KAAK;gBAClB,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;oBAChE,OAAO,KAAK,CAAC;gBACf,CAAC;gBACD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;oBACxB,KAAK,GAAG,EAAE,CAAC;gBACb,CAAC;gBACD,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC;gBAChC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;oBAC7B,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC;gBACjC,CAAC;gBACD,OAAO,KAAK,CAAC;YACf,CAAC;SACF;QACD,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,KAAK,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC;KAClB;CACF,CAAC"}
@@ -1,29 +0,0 @@
1
- import type { CoreShaderType } from '../../renderers/CoreShaderNode.js';
2
- /**
3
- * Properties of the {@link RoundedRectangle} shader
4
- */
5
- export interface RoundedProps {
6
- /**
7
- * Corner radius, in pixels, to cut out of the corners
8
- *
9
- * @defaultValue 0
10
- */
11
- radius: number | number[];
12
- /**
13
- * sets top-left corner
14
- */
15
- 'top-left': number;
16
- /**
17
- * sets top-right corner
18
- */
19
- 'top-right': number;
20
- /**
21
- * sets bottom-right corner
22
- */
23
- 'bottom-right': number;
24
- /**
25
- * sets bottom-left corner
26
- */
27
- 'bottom-left': number;
28
- }
29
- export declare const RoundedTemplate: CoreShaderType<RoundedProps>;