@shopify/react-native-skia 1.11.5 → 1.11.6

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 (136) hide show
  1. package/android/CMakeLists.txt +0 -1
  2. package/cpp/api/JsiSkParagraph.h +1 -3
  3. package/cpp/api/recorder/Convertor.h +19 -17
  4. package/cpp/api/recorder/Drawings.h +7 -10
  5. package/cpp/jsi/ViewProperty.h +1 -3
  6. package/lib/commonjs/animation/functions/interpolateColors.d.ts +1 -1
  7. package/lib/commonjs/dom/nodes/datatypes/Gradient.d.ts +2 -2
  8. package/lib/commonjs/dom/types/NodeType.js +8 -0
  9. package/lib/commonjs/dom/types/NodeType.js.map +1 -1
  10. package/lib/commonjs/external/reanimated/buffers.d.ts +1 -1
  11. package/lib/commonjs/renderer/__tests__/setup.d.ts +1 -1
  12. package/lib/commonjs/skia/types/Image/ColorType.js +20 -2
  13. package/lib/commonjs/skia/types/Image/ColorType.js.map +1 -1
  14. package/lib/commonjs/skia/types/Image/ColorType.web.js +18 -2
  15. package/lib/commonjs/skia/types/Image/ColorType.web.js.map +1 -1
  16. package/lib/commonjs/skia/types/ImageFilter/ImageFilter.js +14 -0
  17. package/lib/commonjs/skia/types/ImageFilter/ImageFilter.js.map +1 -1
  18. package/lib/commonjs/skia/types/MaskFilter.js +5 -2
  19. package/lib/commonjs/skia/types/MaskFilter.js.map +1 -1
  20. package/lib/commonjs/skia/types/Paint/BlendMode.js +31 -2
  21. package/lib/commonjs/skia/types/Paint/BlendMode.js.map +1 -1
  22. package/lib/commonjs/skia/types/Paragraph/ParagraphBuilder.js +14 -0
  23. package/lib/commonjs/skia/types/Paragraph/ParagraphBuilder.js.map +1 -1
  24. package/lib/commonjs/skia/types/Path/Path.js +4 -0
  25. package/lib/commonjs/skia/types/Path/Path.js.map +1 -1
  26. package/lib/commonjs/skia/web/JsiSkCanvas.d.ts +1 -1
  27. package/lib/commonjs/skia/web/JsiSkImage.d.ts +2 -2
  28. package/lib/commonjs/skia/web/JsiSkPaint.d.ts +1 -1
  29. package/lib/commonjs/skia/web/JsiSkPicture.d.ts +1 -1
  30. package/lib/commonjs/skia/web/JsiSkPoint.d.ts +1 -1
  31. package/lib/commonjs/skia/web/JsiSkRRect.d.ts +1 -1
  32. package/lib/commonjs/skia/web/JsiSkRSXform.d.ts +1 -1
  33. package/lib/commonjs/skia/web/JsiSkRect.d.ts +1 -1
  34. package/lib/commonjs/sksg/Container.d.ts +1 -4
  35. package/lib/commonjs/sksg/Container.js +8 -9
  36. package/lib/commonjs/sksg/Container.js.map +1 -1
  37. package/lib/commonjs/sksg/Recorder/Core.js +2 -0
  38. package/lib/commonjs/sksg/Recorder/Core.js.map +1 -1
  39. package/lib/commonjs/specs/NativeSkiaModule.web.d.ts +6 -0
  40. package/lib/commonjs/specs/NativeSkiaModule.web.js +33 -0
  41. package/lib/commonjs/specs/NativeSkiaModule.web.js.map +1 -1
  42. package/lib/commonjs/specs/SkiaPictureViewNativeComponent.web.d.ts +9 -0
  43. package/lib/commonjs/specs/SkiaPictureViewNativeComponent.web.js +32 -0
  44. package/lib/commonjs/specs/SkiaPictureViewNativeComponent.web.js.map +1 -0
  45. package/lib/commonjs/views/types.d.ts +1 -0
  46. package/lib/commonjs/views/types.js.map +1 -1
  47. package/lib/commonjs/web/LoadSkiaWeb.js +1 -2
  48. package/lib/commonjs/web/LoadSkiaWeb.js.map +1 -1
  49. package/lib/module/animation/functions/interpolateColors.d.ts +1 -1
  50. package/lib/module/dom/nodes/datatypes/Gradient.d.ts +2 -2
  51. package/lib/module/dom/types/NodeType.js +8 -0
  52. package/lib/module/dom/types/NodeType.js.map +1 -1
  53. package/lib/module/external/reanimated/buffers.d.ts +1 -1
  54. package/lib/module/renderer/__tests__/setup.d.ts +1 -1
  55. package/lib/module/skia/types/Image/ColorType.js +20 -2
  56. package/lib/module/skia/types/Image/ColorType.js.map +1 -1
  57. package/lib/module/skia/types/Image/ColorType.web.js +18 -2
  58. package/lib/module/skia/types/Image/ColorType.web.js.map +1 -1
  59. package/lib/module/skia/types/ImageFilter/ImageFilter.js +14 -0
  60. package/lib/module/skia/types/ImageFilter/ImageFilter.js.map +1 -1
  61. package/lib/module/skia/types/MaskFilter.js +5 -2
  62. package/lib/module/skia/types/MaskFilter.js.map +1 -1
  63. package/lib/module/skia/types/Paint/BlendMode.js +31 -2
  64. package/lib/module/skia/types/Paint/BlendMode.js.map +1 -1
  65. package/lib/module/skia/types/Paragraph/ParagraphBuilder.js +14 -0
  66. package/lib/module/skia/types/Paragraph/ParagraphBuilder.js.map +1 -1
  67. package/lib/module/skia/types/Path/Path.js +4 -0
  68. package/lib/module/skia/types/Path/Path.js.map +1 -1
  69. package/lib/module/skia/web/JsiSkCanvas.d.ts +1 -1
  70. package/lib/module/skia/web/JsiSkImage.d.ts +2 -2
  71. package/lib/module/skia/web/JsiSkPaint.d.ts +1 -1
  72. package/lib/module/skia/web/JsiSkPicture.d.ts +1 -1
  73. package/lib/module/skia/web/JsiSkPoint.d.ts +1 -1
  74. package/lib/module/skia/web/JsiSkRRect.d.ts +1 -1
  75. package/lib/module/skia/web/JsiSkRSXform.d.ts +1 -1
  76. package/lib/module/skia/web/JsiSkRect.d.ts +1 -1
  77. package/lib/module/sksg/Container.d.ts +1 -4
  78. package/lib/module/sksg/Container.js +8 -9
  79. package/lib/module/sksg/Container.js.map +1 -1
  80. package/lib/module/sksg/Recorder/Core.js +2 -0
  81. package/lib/module/sksg/Recorder/Core.js.map +1 -1
  82. package/lib/module/specs/NativeSkiaModule.web.d.ts +6 -0
  83. package/lib/module/specs/NativeSkiaModule.web.js +30 -1
  84. package/lib/module/specs/NativeSkiaModule.web.js.map +1 -1
  85. package/lib/module/specs/SkiaPictureViewNativeComponent.web.d.ts +9 -0
  86. package/lib/module/specs/SkiaPictureViewNativeComponent.web.js +26 -0
  87. package/lib/module/specs/SkiaPictureViewNativeComponent.web.js.map +1 -0
  88. package/lib/module/views/types.d.ts +1 -0
  89. package/lib/module/views/types.js.map +1 -1
  90. package/lib/typescript/lib/commonjs/animation/functions/interpolateColors.d.ts +1 -1
  91. package/lib/typescript/lib/commonjs/renderer/components/image/ImageShader.d.ts +1 -1
  92. package/lib/typescript/lib/commonjs/skia/web/JsiSkColor.d.ts +1 -1
  93. package/lib/typescript/lib/commonjs/skia/web/JsiSkia.d.ts +1 -1
  94. package/lib/typescript/lib/commonjs/specs/NativeSkiaModule.web.d.ts +1 -0
  95. package/lib/typescript/lib/commonjs/specs/SkiaPictureViewNativeComponent.web.d.ts +10 -0
  96. package/lib/typescript/lib/module/animation/functions/interpolateColors.d.ts +1 -1
  97. package/lib/typescript/lib/module/mock/index.d.ts +2 -2
  98. package/lib/typescript/lib/module/renderer/components/image/ImageShader.d.ts +1 -1
  99. package/lib/typescript/lib/module/skia/Skia.web.d.ts +1 -1
  100. package/lib/typescript/lib/module/skia/web/JsiSkColor.d.ts +1 -1
  101. package/lib/typescript/lib/module/skia/web/JsiSkia.d.ts +1 -1
  102. package/lib/typescript/lib/module/specs/NativeSkiaModule.web.d.ts +1 -0
  103. package/lib/typescript/lib/module/specs/SkiaPictureViewNativeComponent.web.d.ts +9 -0
  104. package/lib/typescript/src/animation/functions/interpolateColors.d.ts +1 -1
  105. package/lib/typescript/src/dom/nodes/datatypes/Gradient.d.ts +2 -2
  106. package/lib/typescript/src/external/reanimated/buffers.d.ts +1 -1
  107. package/lib/typescript/src/renderer/__tests__/setup.d.ts +1 -1
  108. package/lib/typescript/src/skia/web/JsiSkCanvas.d.ts +1 -1
  109. package/lib/typescript/src/skia/web/JsiSkImage.d.ts +2 -2
  110. package/lib/typescript/src/skia/web/JsiSkPaint.d.ts +1 -1
  111. package/lib/typescript/src/skia/web/JsiSkPicture.d.ts +1 -1
  112. package/lib/typescript/src/skia/web/JsiSkPoint.d.ts +1 -1
  113. package/lib/typescript/src/skia/web/JsiSkRRect.d.ts +1 -1
  114. package/lib/typescript/src/skia/web/JsiSkRSXform.d.ts +1 -1
  115. package/lib/typescript/src/skia/web/JsiSkRect.d.ts +1 -1
  116. package/lib/typescript/src/sksg/Container.d.ts +1 -4
  117. package/lib/typescript/src/specs/NativeSkiaModule.web.d.ts +6 -0
  118. package/lib/typescript/src/specs/SkiaPictureViewNativeComponent.web.d.ts +9 -0
  119. package/lib/typescript/src/views/types.d.ts +1 -0
  120. package/package.json +1 -1
  121. package/src/sksg/Container.ts +7 -12
  122. package/src/specs/NativeSkiaModule.web.ts +38 -0
  123. package/src/specs/SkiaPictureViewNativeComponent.web.ts +39 -0
  124. package/src/views/types.ts +1 -0
  125. package/cpp/jsi/JsiValue.cpp +0 -345
  126. package/cpp/jsi/JsiValue.h +0 -222
  127. package/lib/commonjs/renderer/Canvas.web.d.ts +0 -11
  128. package/lib/commonjs/renderer/Canvas.web.js +0 -112
  129. package/lib/commonjs/renderer/Canvas.web.js.map +0 -1
  130. package/lib/module/renderer/Canvas.web.d.ts +0 -11
  131. package/lib/module/renderer/Canvas.web.js +0 -105
  132. package/lib/module/renderer/Canvas.web.js.map +0 -1
  133. package/lib/typescript/lib/commonjs/renderer/Canvas.web.d.ts +0 -2
  134. package/lib/typescript/lib/module/renderer/Canvas.web.d.ts +0 -2
  135. package/lib/typescript/src/renderer/Canvas.web.d.ts +0 -11
  136. package/src/renderer/Canvas.web.tsx +0 -134
@@ -80,7 +80,6 @@ add_library(
80
80
  "${PROJECT_SOURCE_DIR}/cpp/rnskia-android/RNSkAndroidVideo.cpp"
81
81
 
82
82
  "${PROJECT_SOURCE_DIR}/../cpp/jsi/JsiHostObject.cpp"
83
- "${PROJECT_SOURCE_DIR}/../cpp/jsi/JsiValue.cpp"
84
83
  "${PROJECT_SOURCE_DIR}/../cpp/jsi/RuntimeLifecycleMonitor.cpp"
85
84
  "${PROJECT_SOURCE_DIR}/../cpp/jsi/RuntimeAwareCache.cpp"
86
85
  "${PROJECT_SOURCE_DIR}/../cpp/jsi/JsiPromises.cpp"
@@ -150,9 +150,7 @@ public:
150
150
  _paragraph = paragraphBuilder->Build();
151
151
  }
152
152
 
153
- para::Paragraph *getParagraph() { return _paragraph.get(); }
154
-
155
- private:
153
+ public:
156
154
  std::unique_ptr<para::Paragraph> _paragraph;
157
155
  };
158
156
 
@@ -39,7 +39,6 @@ struct GlyphData {
39
39
  std::vector<SkPoint> positions;
40
40
  };
41
41
 
42
-
43
42
  bool isSharedValue(jsi::Runtime &runtime, const jsi::Value &value) {
44
43
  return value.isObject() &&
45
44
  value.asObject(runtime).hasProperty(runtime,
@@ -393,17 +392,15 @@ GlyphData getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
393
392
  size_t size = array.size(runtime);
394
393
  result.glyphIds.reserve(size);
395
394
  result.positions.reserve(size);
396
-
395
+
397
396
  for (size_t i = 0; i < size; i++) {
398
397
  auto glyph = array.getValueAtIndex(runtime, i).asObject(runtime);
399
398
  // Get the glyph id
400
399
  result.glyphIds.push_back(
401
- static_cast<SkGlyphID>(glyph.getProperty(runtime, "id").asNumber())
402
- );
400
+ static_cast<SkGlyphID>(glyph.getProperty(runtime, "id").asNumber()));
403
401
  // Get the position
404
402
  result.positions.push_back(
405
- processPoint(runtime, glyph.getProperty(runtime, "pos"))
406
- );
403
+ processPoint(runtime, glyph.getProperty(runtime, "pos")));
407
404
  }
408
405
  return result;
409
406
  }
@@ -422,7 +419,8 @@ SkRSXform getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
422
419
  }
423
420
 
424
421
  template <>
425
- sk_sp<SkSVGDOM> getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
422
+ sk_sp<SkSVGDOM> getPropertyValue(jsi::Runtime &runtime,
423
+ const jsi::Value &value) {
426
424
  if (value.isObject() && value.asObject(runtime).isHostObject(runtime)) {
427
425
  auto ptr = std::dynamic_pointer_cast<JsiSkSVG>(
428
426
  value.asObject(runtime).asHostObject(runtime));
@@ -432,7 +430,8 @@ sk_sp<SkSVGDOM> getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value)
432
430
  } else if (value.isNull()) {
433
431
  return nullptr;
434
432
  }
435
- throw std::runtime_error("Expected SkSvgDom object or null for the svg property.");
433
+ throw std::runtime_error(
434
+ "Expected SkSvgDom object or null for the svg property.");
436
435
  }
437
436
 
438
437
  template <>
@@ -458,18 +457,21 @@ SkPaint getPropertyValue(jsi::Runtime &runtime, const jsi::Value &value) {
458
457
  }
459
458
 
460
459
  template <>
461
- para::Paragraph *getPropertyValue(jsi::Runtime &runtime,
462
- const jsi::Value &value) {
460
+ std::shared_ptr<JsiSkParagraph> getPropertyValue(jsi::Runtime &runtime,
461
+ const jsi::Value &value) {
463
462
  if (value.isObject()) {
464
- auto para = value.asObject(runtime)
465
- .asHostObject<JsiSkParagraph>(runtime)
466
- ->getParagraph();
463
+ auto hostObject = value.asObject(runtime).asHostObject(runtime);
464
+ if (!hostObject) {
465
+ return nullptr;
466
+ }
467
+ auto para = std::dynamic_pointer_cast<JsiSkParagraph>(hostObject);
468
+ if (!para) {
469
+ return nullptr;
470
+ }
471
+ // Return a shared_ptr instead of raw pointer
467
472
  return para;
468
473
  }
469
- if (value.isNull()) {
470
- return nullptr;
471
- }
472
- throw std::runtime_error("Invalid prop value for Paragraph received");
474
+ return nullptr;
473
475
  }
474
476
 
475
477
  template <>
@@ -766,15 +766,12 @@ public:
766
766
  convertProperty(runtime, object, "glyphs", props.glyphs, variables);
767
767
  }
768
768
 
769
- void draw(DrawingCtx *ctx) {
769
+ void draw(DrawingCtx *ctx) {
770
770
  if (props.font.has_value()) {
771
771
  ctx->canvas->drawGlyphs(
772
772
  static_cast<int>(props.glyphs.glyphIds.size()),
773
- props.glyphs.glyphIds.data(),
774
- props.glyphs.positions.data(),
775
- SkPoint::Make(props.x, props.y),
776
- props.font.value(),
777
- ctx->getPaint());
773
+ props.glyphs.glyphIds.data(), props.glyphs.positions.data(),
774
+ SkPoint::Make(props.x, props.y), props.font.value(), ctx->getPaint());
778
775
  }
779
776
  }
780
777
  };
@@ -856,7 +853,7 @@ public:
856
853
  };
857
854
 
858
855
  struct ParagraphCmdProps {
859
- para::Paragraph *paragraph;
856
+ std::shared_ptr<JsiSkParagraph> paragraph;
860
857
  float x;
861
858
  float y;
862
859
  float width;
@@ -877,9 +874,9 @@ public:
877
874
  }
878
875
 
879
876
  void draw(DrawingCtx *ctx) {
880
- if (props.paragraph) {
881
- props.paragraph->layout(props.width);
882
- props.paragraph->paint(ctx->canvas, props.x, props.y);
877
+ if (props.paragraph && props.paragraph->_paragraph) {
878
+ props.paragraph->_paragraph->layout(props.width);
879
+ props.paragraph->_paragraph->paint(ctx->canvas, props.x, props.y);
883
880
  }
884
881
  }
885
882
  };
@@ -28,11 +28,9 @@ public:
28
28
 
29
29
  bool isNull() { return std::holds_alternative<nullptr_t>(_value); }
30
30
 
31
-
32
31
  sk_sp<SkPicture> getPicture() { return std::get<sk_sp<SkPicture>>(_value); }
33
32
 
34
33
  private:
35
- std::variant<nullptr_t, sk_sp<SkPicture>>
36
- _value = nullptr;
34
+ std::variant<nullptr_t, sk_sp<SkPicture>> _value = nullptr;
37
35
  };
38
36
  } // namespace RNJsi
@@ -1,3 +1,3 @@
1
1
  import type { Color } from "../../skia";
2
2
  export declare const interpolateColors: (value: number, inputRange: number[], _outputRange: Color[]) => number[];
3
- export declare const mixColors: (value: number, x: Color, y: Color) => Float32Array;
3
+ export declare const mixColors: (value: number, x: Color, y: Color) => Float32Array<ArrayBuffer>;
@@ -242,9 +242,9 @@ export declare const transformOrigin: (origin: Vector, transform: Transforms3d)
242
242
  rotateY: number;
243
243
  matrix: import("../../../skia/types").Matrix4;
244
244
  }, "matrix">)[];
245
- export declare const processColor: (Skia: Skia, color: number | string | Float32Array | number[]) => Float32Array;
245
+ export declare const processColor: (Skia: Skia, color: number | string | Float32Array | number[]) => import("../../../skia/types").SkColor;
246
246
  export declare const processGradientProps: (Skia: Skia, { colors, positions, mode, flags, ...transform }: GradientProps) => {
247
- colors: Float32Array[];
247
+ colors: import("../../../skia/types").SkColor[];
248
248
  positions: number[] | null;
249
249
  mode: TileMode;
250
250
  flags: number | undefined;
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.NodeType = void 0;
7
7
  let NodeType = exports.NodeType = /*#__PURE__*/function (NodeType) {
8
+ // Shaders
8
9
  NodeType["Layer"] = "skLayer";
9
10
  NodeType["Shader"] = "skShader";
10
11
  NodeType["ImageShader"] = "skImageShader";
@@ -15,7 +16,9 @@ let NodeType = exports.NodeType = /*#__PURE__*/function (NodeType) {
15
16
  NodeType["RadialGradient"] = "skRadialGradient";
16
17
  NodeType["SweepGradient"] = "skSweepGradient";
17
18
  NodeType["TwoPointConicalGradient"] = "skTwoPointConicalGradient";
19
+ // Mask Filters
18
20
  NodeType["BlurMaskFilter"] = "skBlurMaskFilter";
21
+ // Path Effects
19
22
  NodeType["DiscretePathEffect"] = "skDiscretePathEffect";
20
23
  NodeType["DashPathEffect"] = "skDashPathEffect";
21
24
  NodeType["Path1DPathEffect"] = "skPath1DPathEffect";
@@ -23,12 +26,14 @@ let NodeType = exports.NodeType = /*#__PURE__*/function (NodeType) {
23
26
  NodeType["CornerPathEffect"] = "skCornerPathEffect";
24
27
  NodeType["SumPathEffect"] = "skSumPathEffect";
25
28
  NodeType["Line2DPathEffect"] = "skLine2DPathEffect";
29
+ // Color Filters
26
30
  NodeType["MatrixColorFilter"] = "skMatrixColorFilter";
27
31
  NodeType["BlendColorFilter"] = "skBlendColorFilter";
28
32
  NodeType["LinearToSRGBGammaColorFilter"] = "skLinearToSRGBGammaColorFilter";
29
33
  NodeType["SRGBToLinearGammaColorFilter"] = "skSRGBToLinearGammaColorFilter";
30
34
  NodeType["LumaColorFilter"] = "skLumaColorFilter";
31
35
  NodeType["LerpColorFilter"] = "skLerpColorFilter";
36
+ // Image Filters
32
37
  NodeType["OffsetImageFilter"] = "skOffsetImageFilter";
33
38
  NodeType["DisplacementMapImageFilter"] = "skDisplacementMapImageFilter";
34
39
  NodeType["BlurImageFilter"] = "skBlurImageFilter";
@@ -36,10 +41,12 @@ let NodeType = exports.NodeType = /*#__PURE__*/function (NodeType) {
36
41
  NodeType["MorphologyImageFilter"] = "skMorphologyImageFilter";
37
42
  NodeType["BlendImageFilter"] = "skBlendImageFilter";
38
43
  NodeType["RuntimeShaderImageFilter"] = "skRuntimeShaderImageFilter";
44
+ // Mixed
39
45
  NodeType["Blend"] = "skBlend";
40
46
  NodeType["BackdropFilter"] = "skBackdropFilter";
41
47
  NodeType["Box"] = "skBox";
42
48
  NodeType["BoxShadow"] = "skBoxShadow";
49
+ // Drawings
43
50
  NodeType["Group"] = "skGroup";
44
51
  NodeType["Paint"] = "skPaint";
45
52
  NodeType["Circle"] = "skCircle";
@@ -61,6 +68,7 @@ let NodeType = exports.NodeType = /*#__PURE__*/function (NodeType) {
61
68
  NodeType["Picture"] = "skPicture";
62
69
  NodeType["ImageSVG"] = "skImageSVG";
63
70
  NodeType["Atlas"] = "skAtlas";
71
+ // Paragraph
64
72
  NodeType["Paragraph"] = "skParagraph";
65
73
  return NodeType;
66
74
  }({});
@@ -1 +1 @@
1
- {"version":3,"names":["NodeType","exports"],"sources":["NodeType.ts"],"sourcesContent":["export const enum NodeType {\n // Shaders\n Layer = \"skLayer\",\n Shader = \"skShader\",\n ImageShader = \"skImageShader\",\n ColorShader = \"skColorShader\",\n Turbulence = \"skTurbulence\",\n FractalNoise = \"skFractalNoise\",\n LinearGradient = \"skLinearGradient\",\n RadialGradient = \"skRadialGradient\",\n SweepGradient = \"skSweepGradient\",\n TwoPointConicalGradient = \"skTwoPointConicalGradient\",\n\n // Mask Filters\n BlurMaskFilter = \"skBlurMaskFilter\",\n\n // Path Effects\n DiscretePathEffect = \"skDiscretePathEffect\",\n DashPathEffect = \"skDashPathEffect\",\n Path1DPathEffect = \"skPath1DPathEffect\",\n Path2DPathEffect = \"skPath2DPathEffect\",\n CornerPathEffect = \"skCornerPathEffect\",\n SumPathEffect = \"skSumPathEffect\",\n Line2DPathEffect = \"skLine2DPathEffect\",\n\n // Color Filters\n MatrixColorFilter = \"skMatrixColorFilter\",\n BlendColorFilter = \"skBlendColorFilter\",\n LinearToSRGBGammaColorFilter = \"skLinearToSRGBGammaColorFilter\",\n SRGBToLinearGammaColorFilter = \"skSRGBToLinearGammaColorFilter\",\n LumaColorFilter = \"skLumaColorFilter\",\n LerpColorFilter = \"skLerpColorFilter\",\n\n // Image Filters\n OffsetImageFilter = \"skOffsetImageFilter\",\n DisplacementMapImageFilter = \"skDisplacementMapImageFilter\",\n BlurImageFilter = \"skBlurImageFilter\",\n DropShadowImageFilter = \"skDropShadowImageFilter\",\n MorphologyImageFilter = \"skMorphologyImageFilter\",\n BlendImageFilter = \"skBlendImageFilter\",\n RuntimeShaderImageFilter = \"skRuntimeShaderImageFilter\",\n\n // Mixed\n Blend = \"skBlend\",\n BackdropFilter = \"skBackdropFilter\",\n Box = \"skBox\",\n BoxShadow = \"skBoxShadow\",\n\n // Drawings\n Group = \"skGroup\",\n Paint = \"skPaint\",\n Circle = \"skCircle\",\n Fill = \"skFill\",\n Image = \"skImage\",\n Points = \"skPoints\",\n Path = \"skPath\",\n Rect = \"skRect\",\n RRect = \"skRRect\",\n Oval = \"skOval\",\n Line = \"skLine\",\n Patch = \"skPatch\",\n Vertices = \"skVertices\",\n DiffRect = \"skDiffRect\",\n Text = \"skText\",\n TextPath = \"skTextPath\",\n TextBlob = \"skTextBlob\",\n Glyphs = \"skGlyphs\",\n Picture = \"skPicture\",\n ImageSVG = \"skImageSVG\",\n Atlas = \"skAtlas\",\n\n // Paragraph\n Paragraph = \"skParagraph\",\n}\n"],"mappings":";;;;;;IAAkBA,QAAQ,GAAAC,OAAA,CAAAD,QAAA,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["NodeType","exports"],"sources":["NodeType.ts"],"sourcesContent":["export const enum NodeType {\n // Shaders\n Layer = \"skLayer\",\n Shader = \"skShader\",\n ImageShader = \"skImageShader\",\n ColorShader = \"skColorShader\",\n Turbulence = \"skTurbulence\",\n FractalNoise = \"skFractalNoise\",\n LinearGradient = \"skLinearGradient\",\n RadialGradient = \"skRadialGradient\",\n SweepGradient = \"skSweepGradient\",\n TwoPointConicalGradient = \"skTwoPointConicalGradient\",\n\n // Mask Filters\n BlurMaskFilter = \"skBlurMaskFilter\",\n\n // Path Effects\n DiscretePathEffect = \"skDiscretePathEffect\",\n DashPathEffect = \"skDashPathEffect\",\n Path1DPathEffect = \"skPath1DPathEffect\",\n Path2DPathEffect = \"skPath2DPathEffect\",\n CornerPathEffect = \"skCornerPathEffect\",\n SumPathEffect = \"skSumPathEffect\",\n Line2DPathEffect = \"skLine2DPathEffect\",\n\n // Color Filters\n MatrixColorFilter = \"skMatrixColorFilter\",\n BlendColorFilter = \"skBlendColorFilter\",\n LinearToSRGBGammaColorFilter = \"skLinearToSRGBGammaColorFilter\",\n SRGBToLinearGammaColorFilter = \"skSRGBToLinearGammaColorFilter\",\n LumaColorFilter = \"skLumaColorFilter\",\n LerpColorFilter = \"skLerpColorFilter\",\n\n // Image Filters\n OffsetImageFilter = \"skOffsetImageFilter\",\n DisplacementMapImageFilter = \"skDisplacementMapImageFilter\",\n BlurImageFilter = \"skBlurImageFilter\",\n DropShadowImageFilter = \"skDropShadowImageFilter\",\n MorphologyImageFilter = \"skMorphologyImageFilter\",\n BlendImageFilter = \"skBlendImageFilter\",\n RuntimeShaderImageFilter = \"skRuntimeShaderImageFilter\",\n\n // Mixed\n Blend = \"skBlend\",\n BackdropFilter = \"skBackdropFilter\",\n Box = \"skBox\",\n BoxShadow = \"skBoxShadow\",\n\n // Drawings\n Group = \"skGroup\",\n Paint = \"skPaint\",\n Circle = \"skCircle\",\n Fill = \"skFill\",\n Image = \"skImage\",\n Points = \"skPoints\",\n Path = \"skPath\",\n Rect = \"skRect\",\n RRect = \"skRRect\",\n Oval = \"skOval\",\n Line = \"skLine\",\n Patch = \"skPatch\",\n Vertices = \"skVertices\",\n DiffRect = \"skDiffRect\",\n Text = \"skText\",\n TextPath = \"skTextPath\",\n TextBlob = \"skTextBlob\",\n Glyphs = \"skGlyphs\",\n Picture = \"skPicture\",\n ImageSVG = \"skImageSVG\",\n Atlas = \"skAtlas\",\n\n // Paragraph\n Paragraph = \"skParagraph\",\n}\n"],"mappings":";;;;;;IAAkBA,QAAQ,GAAAC,OAAA,CAAAD,QAAA,0BAARA,QAAQ;EACxB;EADgBA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAaxB;EAbgBA,QAAQ;EAgBxB;EAhBgBA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAyBxB;EAzBgBA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAiCxB;EAjCgBA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EA0CxB;EA1CgBA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAgDxB;EAhDgBA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAuExB;EAvEgBA,QAAQ;EAAA,OAARA,QAAQ;AAAA","ignoreList":[]}
@@ -3,5 +3,5 @@ type Modifier<T> = (input: T, index: number) => void;
3
3
  export declare const useRectBuffer: (size: number, modifier: Modifier<SkHostRect>) => import("react-native-reanimated/lib/typescript/commonTypes").Mutable<SkHostRect[]>;
4
4
  export declare const useRSXformBuffer: (size: number, modifier: Modifier<SkRSXform>) => import("react-native-reanimated/lib/typescript/commonTypes").Mutable<SkRSXform[]>;
5
5
  export declare const usePointBuffer: (size: number, modifier: Modifier<SkPoint>) => import("react-native-reanimated/lib/typescript/commonTypes").Mutable<SkPoint[]>;
6
- export declare const useColorBuffer: (size: number, modifier: Modifier<SkColor>) => import("react-native-reanimated/lib/typescript/commonTypes").Mutable<Float32Array[]>;
6
+ export declare const useColorBuffer: (size: number, modifier: Modifier<SkColor>) => import("react-native-reanimated/lib/typescript/commonTypes").Mutable<SkColor[]>;
7
7
  export {};
@@ -24,7 +24,7 @@ export declare let fonts: {
24
24
  DinMedium: SkFont;
25
25
  };
26
26
  export declare const wait: (ms: number) => Promise<unknown>;
27
- export declare const resolveFile: (uri: string) => Buffer;
27
+ export declare const resolveFile: (uri: string) => Buffer<ArrayBufferLike>;
28
28
  export declare const resolveFont: (uri: string) => number[];
29
29
  export declare const testingFonts: {
30
30
  Roboto: number[][];
@@ -6,24 +6,42 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.ColorType = void 0;
7
7
  let ColorType = exports.ColorType = /*#__PURE__*/function (ColorType) {
8
8
  ColorType[ColorType["Unknown"] = 0] = "Unknown";
9
+ // uninitialized
9
10
  ColorType[ColorType["Alpha_8"] = 1] = "Alpha_8";
11
+ // pixel with alpha in 8-bit byte
10
12
  ColorType[ColorType["RGB_565"] = 2] = "RGB_565";
13
+ // pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word
11
14
  ColorType[ColorType["ARGB_4444"] = 3] = "ARGB_4444";
15
+ // pixel with 4 bits for alpha, red, green, blue; in 16-bit word
12
16
  ColorType[ColorType["RGBA_8888"] = 4] = "RGBA_8888";
17
+ // pixel with 8 bits for red, green, blue, alpha; in 32-bit word
13
18
  ColorType[ColorType["RGB_888x"] = 5] = "RGB_888x";
19
+ // pixel with 8 bits each for red, green, blue; in 32-bit word
14
20
  ColorType[ColorType["BGRA_8888"] = 6] = "BGRA_8888";
21
+ // pixel with 8 bits for blue, green, red, alpha; in 32-bit word
15
22
  ColorType[ColorType["RGBA_1010102"] = 7] = "RGBA_1010102";
23
+ // 10 bits for red, green, blue; 2 bits for alpha; in 32-bit word
16
24
  ColorType[ColorType["BGRA_1010102"] = 8] = "BGRA_1010102";
25
+ // 10 bits for blue, green, red; 2 bits for alpha; in 32-bit word
17
26
  ColorType[ColorType["RGB_101010x"] = 9] = "RGB_101010x";
27
+ // pixel with 10 bits each for red, green, blue; in 32-bit word
18
28
  ColorType[ColorType["BGR_101010x"] = 10] = "BGR_101010x";
29
+ // pixel with 10 bits each for blue, green, red; in 32-bit word
19
30
  ColorType[ColorType["BGR_101010x_XR"] = 11] = "BGR_101010x_XR";
31
+ // pixel with 10 bits each for blue, green, red; in 32-bit word, extended range
20
32
  ColorType[ColorType["BGRA_10101010_XR"] = 12] = "BGRA_10101010_XR";
33
+ // pixel with 10 bits each for blue, green, red, alpha; in 64-bit word, extended range
21
34
  ColorType[ColorType["RGBA_10x6"] = 13] = "RGBA_10x6";
35
+ // pixel with 10 used bits (most significant) followed by 6 unused
22
36
  ColorType[ColorType["Gray_8"] = 14] = "Gray_8";
37
+ // pixel with grayscale level in 8-bit byte
23
38
  ColorType[ColorType["RGBA_F16Norm"] = 15] = "RGBA_F16Norm";
39
+ // pixel with half floats in [0,1] for red, green, blue, alpha; in 64-bit word
24
40
  ColorType[ColorType["RGBA_F16"] = 16] = "RGBA_F16";
41
+ // pixel with half floats for red, green, blue, alpha; in 64-bit word
25
42
  ColorType[ColorType["RGB_F16F16F16x"] = 17] = "RGB_F16F16F16x";
26
- ColorType[ColorType["RGBA_F32"] = 18] = "RGBA_F32";
43
+ // pixel with half floats for red, green, blue; in 64-bit word
44
+ ColorType[ColorType["RGBA_F32"] = 18] = "RGBA_F32"; // pixel using C float for red, green, blue, alpha; in 128-bit word
27
45
  return ColorType;
28
- }({}); // pixel using C float for red, green, blue, alpha; in 128-bit word
46
+ }({});
29
47
  //# sourceMappingURL=ColorType.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ColorType","exports"],"sources":["ColorType.ts"],"sourcesContent":["export enum ColorType {\n Unknown, // uninitialized\n Alpha_8, // pixel with alpha in 8-bit byte\n RGB_565, // pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word\n ARGB_4444, // pixel with 4 bits for alpha, red, green, blue; in 16-bit word\n RGBA_8888, // pixel with 8 bits for red, green, blue, alpha; in 32-bit word\n RGB_888x, // pixel with 8 bits each for red, green, blue; in 32-bit word\n BGRA_8888, // pixel with 8 bits for blue, green, red, alpha; in 32-bit word\n RGBA_1010102, // 10 bits for red, green, blue; 2 bits for alpha; in 32-bit word\n BGRA_1010102, // 10 bits for blue, green, red; 2 bits for alpha; in 32-bit word\n RGB_101010x, // pixel with 10 bits each for red, green, blue; in 32-bit word\n BGR_101010x, // pixel with 10 bits each for blue, green, red; in 32-bit word\n BGR_101010x_XR, // pixel with 10 bits each for blue, green, red; in 32-bit word, extended range\n BGRA_10101010_XR, // pixel with 10 bits each for blue, green, red, alpha; in 64-bit word, extended range\n RGBA_10x6, // pixel with 10 used bits (most significant) followed by 6 unused\n Gray_8, // pixel with grayscale level in 8-bit byte\n RGBA_F16Norm, // pixel with half floats in [0,1] for red, green, blue, alpha; in 64-bit word\n RGBA_F16, // pixel with half floats for red, green, blue, alpha; in 64-bit word\n RGB_F16F16F16x, // pixel with half floats for red, green, blue; in 64-bit word\n RGBA_F32, // pixel using C float for red, green, blue, alpha; in 128-bit word\n}\n"],"mappings":";;;;;;IAAYA,SAAS,GAAAC,OAAA,CAAAD,SAAA,0BAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAAA,OAATA,SAAS;AAAA,OAmBT","ignoreList":[]}
1
+ {"version":3,"names":["ColorType","exports"],"sources":["ColorType.ts"],"sourcesContent":["export enum ColorType {\n Unknown, // uninitialized\n Alpha_8, // pixel with alpha in 8-bit byte\n RGB_565, // pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word\n ARGB_4444, // pixel with 4 bits for alpha, red, green, blue; in 16-bit word\n RGBA_8888, // pixel with 8 bits for red, green, blue, alpha; in 32-bit word\n RGB_888x, // pixel with 8 bits each for red, green, blue; in 32-bit word\n BGRA_8888, // pixel with 8 bits for blue, green, red, alpha; in 32-bit word\n RGBA_1010102, // 10 bits for red, green, blue; 2 bits for alpha; in 32-bit word\n BGRA_1010102, // 10 bits for blue, green, red; 2 bits for alpha; in 32-bit word\n RGB_101010x, // pixel with 10 bits each for red, green, blue; in 32-bit word\n BGR_101010x, // pixel with 10 bits each for blue, green, red; in 32-bit word\n BGR_101010x_XR, // pixel with 10 bits each for blue, green, red; in 32-bit word, extended range\n BGRA_10101010_XR, // pixel with 10 bits each for blue, green, red, alpha; in 64-bit word, extended range\n RGBA_10x6, // pixel with 10 used bits (most significant) followed by 6 unused\n Gray_8, // pixel with grayscale level in 8-bit byte\n RGBA_F16Norm, // pixel with half floats in [0,1] for red, green, blue, alpha; in 64-bit word\n RGBA_F16, // pixel with half floats for red, green, blue, alpha; in 64-bit word\n RGB_F16F16F16x, // pixel with half floats for red, green, blue; in 64-bit word\n RGBA_F32, // pixel using C float for red, green, blue, alpha; in 128-bit word\n}\n"],"mappings":";;;;;;IAAYA,SAAS,GAAAC,OAAA,CAAAD,SAAA,0BAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EACV;EADCA,SAAS,CAATA,SAAS;EAEV;EAFCA,SAAS,CAATA,SAAS;EAGV;EAHCA,SAAS,CAATA,SAAS;EAIR;EAJDA,SAAS,CAATA,SAAS;EAKR;EALDA,SAAS,CAATA,SAAS;EAMT;EANAA,SAAS,CAATA,SAAS;EAOR;EAPDA,SAAS,CAATA,SAAS;EAQL;EARJA,SAAS,CAATA,SAAS;EASL;EATJA,SAAS,CAATA,SAAS;EAUN;EAVHA,SAAS,CAATA,SAAS;EAWN;EAXHA,SAAS,CAATA,SAAS;EAYH;EAZNA,SAAS,CAATA,SAAS;EAaD;EAbRA,SAAS,CAATA,SAAS;EAcR;EAdDA,SAAS,CAATA,SAAS;EAeX;EAfEA,SAAS,CAATA,SAAS;EAgBL;EAhBJA,SAAS,CAATA,SAAS;EAiBT;EAjBAA,SAAS,CAATA,SAAS;EAkBH;EAlBNA,SAAS,CAATA,SAAS,iCAmBT;EAAA,OAnBAA,SAAS;AAAA","ignoreList":[]}
@@ -6,22 +6,38 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.ColorTypeCanvasKit = void 0;
7
7
  let ColorTypeCanvasKit = exports.ColorTypeCanvasKit = /*#__PURE__*/function (ColorTypeCanvasKit) {
8
8
  ColorTypeCanvasKit[ColorTypeCanvasKit["Unknown"] = 0] = "Unknown";
9
+ // uninitialized
9
10
  ColorTypeCanvasKit[ColorTypeCanvasKit["Alpha_8"] = 1] = "Alpha_8";
11
+ // pixel with alpha in 8-bit byte
10
12
  ColorTypeCanvasKit[ColorTypeCanvasKit["RGB_565"] = 2] = "RGB_565";
13
+ // pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word
11
14
  ColorTypeCanvasKit[ColorTypeCanvasKit["ARGB_4444"] = 3] = "ARGB_4444";
15
+ // pixel with 4 bits for alpha, red, green, blue; in 16-bit word
12
16
  ColorTypeCanvasKit[ColorTypeCanvasKit["RGBA_8888"] = 4] = "RGBA_8888";
17
+ // pixel with 8 bits for red, green, blue, alpha; in 32-bit word
13
18
  ColorTypeCanvasKit[ColorTypeCanvasKit["RGB_888x"] = 5] = "RGB_888x";
19
+ // pixel with 8 bits each for red, green, blue; in 32-bit word
14
20
  ColorTypeCanvasKit[ColorTypeCanvasKit["BGRA_8888"] = 6] = "BGRA_8888";
21
+ // pixel with 8 bits for blue, green, red, alpha; in 32-bit word
15
22
  ColorTypeCanvasKit[ColorTypeCanvasKit["RGBA_1010102"] = 7] = "RGBA_1010102";
23
+ // 10 bits for red, green, blue; 2 bits for alpha; in 32-bit word
16
24
  ColorTypeCanvasKit[ColorTypeCanvasKit["BGRA_1010102"] = 8] = "BGRA_1010102";
25
+ // 10 bits for blue, green, red; 2 bits for alpha; in 32-bit word
17
26
  ColorTypeCanvasKit[ColorTypeCanvasKit["RGB_101010x"] = 9] = "RGB_101010x";
27
+ // pixel with 10 bits each for red, green, blue; in 32-bit word
18
28
  ColorTypeCanvasKit[ColorTypeCanvasKit["BGR_101010x"] = 10] = "BGR_101010x";
29
+ // pixel with 10 bits each for blue, green, red; in 32-bit word
19
30
  ColorTypeCanvasKit[ColorTypeCanvasKit["BGR_101010x_XR"] = 11] = "BGR_101010x_XR";
31
+ // pixel with 10 bits each for blue, green, red; in 32-bit word, extended range
20
32
  ColorTypeCanvasKit[ColorTypeCanvasKit["RGBA_10x6"] = 12] = "RGBA_10x6";
33
+ // pixel with 10 used bits (most significant) followed by 6 unused
21
34
  ColorTypeCanvasKit[ColorTypeCanvasKit["Gray_8"] = 13] = "Gray_8";
35
+ // pixel with grayscale level in 8-bit byte
22
36
  ColorTypeCanvasKit[ColorTypeCanvasKit["RGBA_F16Norm"] = 14] = "RGBA_F16Norm";
37
+ // pixel with half floats in [0,1] for red, green, blue, alpha; in 64-bit word
23
38
  ColorTypeCanvasKit[ColorTypeCanvasKit["RGBA_F16"] = 15] = "RGBA_F16";
24
- ColorTypeCanvasKit[ColorTypeCanvasKit["RGBA_F32"] = 16] = "RGBA_F32";
39
+ // pixel with half floats for red, green, blue, alpha; in 64-bit word
40
+ ColorTypeCanvasKit[ColorTypeCanvasKit["RGBA_F32"] = 16] = "RGBA_F32"; // pixel using C float for red, green, blue, alpha; in 128-bit word
25
41
  return ColorTypeCanvasKit;
26
- }({}); // pixel using C float for red, green, blue, alpha; in 128-bit word
42
+ }({});
27
43
  //# sourceMappingURL=ColorType.web.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ColorTypeCanvasKit","exports"],"sources":["ColorType.web.ts"],"sourcesContent":["export enum ColorTypeCanvasKit {\n Unknown, // uninitialized\n Alpha_8, // pixel with alpha in 8-bit byte\n RGB_565, // pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word\n ARGB_4444, // pixel with 4 bits for alpha, red, green, blue; in 16-bit word\n RGBA_8888, // pixel with 8 bits for red, green, blue, alpha; in 32-bit word\n RGB_888x, // pixel with 8 bits each for red, green, blue; in 32-bit word\n BGRA_8888, // pixel with 8 bits for blue, green, red, alpha; in 32-bit word\n RGBA_1010102, // 10 bits for red, green, blue; 2 bits for alpha; in 32-bit word\n BGRA_1010102, // 10 bits for blue, green, red; 2 bits for alpha; in 32-bit word\n RGB_101010x, // pixel with 10 bits each for red, green, blue; in 32-bit word\n BGR_101010x, // pixel with 10 bits each for blue, green, red; in 32-bit word\n BGR_101010x_XR, // pixel with 10 bits each for blue, green, red; in 32-bit word, extended range\n RGBA_10x6, // pixel with 10 used bits (most significant) followed by 6 unused\n Gray_8, // pixel with grayscale level in 8-bit byte\n RGBA_F16Norm, // pixel with half floats in [0,1] for red, green, blue, alpha; in 64-bit word\n RGBA_F16, // pixel with half floats for red, green, blue, alpha; in 64-bit word\n RGBA_F32, // pixel using C float for red, green, blue, alpha; in 128-bit word\n}\n"],"mappings":";;;;;;IAAYA,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,0BAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EAAA,OAAlBA,kBAAkB;AAAA,OAiBlB","ignoreList":[]}
1
+ {"version":3,"names":["ColorTypeCanvasKit","exports"],"sources":["ColorType.web.ts"],"sourcesContent":["export enum ColorTypeCanvasKit {\n Unknown, // uninitialized\n Alpha_8, // pixel with alpha in 8-bit byte\n RGB_565, // pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word\n ARGB_4444, // pixel with 4 bits for alpha, red, green, blue; in 16-bit word\n RGBA_8888, // pixel with 8 bits for red, green, blue, alpha; in 32-bit word\n RGB_888x, // pixel with 8 bits each for red, green, blue; in 32-bit word\n BGRA_8888, // pixel with 8 bits for blue, green, red, alpha; in 32-bit word\n RGBA_1010102, // 10 bits for red, green, blue; 2 bits for alpha; in 32-bit word\n BGRA_1010102, // 10 bits for blue, green, red; 2 bits for alpha; in 32-bit word\n RGB_101010x, // pixel with 10 bits each for red, green, blue; in 32-bit word\n BGR_101010x, // pixel with 10 bits each for blue, green, red; in 32-bit word\n BGR_101010x_XR, // pixel with 10 bits each for blue, green, red; in 32-bit word, extended range\n RGBA_10x6, // pixel with 10 used bits (most significant) followed by 6 unused\n Gray_8, // pixel with grayscale level in 8-bit byte\n RGBA_F16Norm, // pixel with half floats in [0,1] for red, green, blue, alpha; in 64-bit word\n RGBA_F16, // pixel with half floats for red, green, blue, alpha; in 64-bit word\n RGBA_F32, // pixel using C float for red, green, blue, alpha; in 128-bit word\n}\n"],"mappings":";;;;;;IAAYA,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,0BAAlBA,kBAAkB;EAAlBA,kBAAkB,CAAlBA,kBAAkB;EACnB;EADCA,kBAAkB,CAAlBA,kBAAkB;EAEnB;EAFCA,kBAAkB,CAAlBA,kBAAkB;EAGnB;EAHCA,kBAAkB,CAAlBA,kBAAkB;EAIjB;EAJDA,kBAAkB,CAAlBA,kBAAkB;EAKjB;EALDA,kBAAkB,CAAlBA,kBAAkB;EAMlB;EANAA,kBAAkB,CAAlBA,kBAAkB;EAOjB;EAPDA,kBAAkB,CAAlBA,kBAAkB;EAQd;EARJA,kBAAkB,CAAlBA,kBAAkB;EASd;EATJA,kBAAkB,CAAlBA,kBAAkB;EAUf;EAVHA,kBAAkB,CAAlBA,kBAAkB;EAWf;EAXHA,kBAAkB,CAAlBA,kBAAkB;EAYZ;EAZNA,kBAAkB,CAAlBA,kBAAkB;EAajB;EAbDA,kBAAkB,CAAlBA,kBAAkB;EAcpB;EAdEA,kBAAkB,CAAlBA,kBAAkB;EAed;EAfJA,kBAAkB,CAAlBA,kBAAkB;EAgBlB;EAhBAA,kBAAkB,CAAlBA,kBAAkB,iCAiBlB;EAAA,OAjBAA,kBAAkB;AAAA","ignoreList":[]}
@@ -5,9 +5,23 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.isImageFilter = exports.TileMode = void 0;
7
7
  let TileMode = exports.TileMode = /*#__PURE__*/function (TileMode) {
8
+ /**
9
+ * Replicate the edge color if the shader draws outside of its
10
+ * original bounds.
11
+ */
8
12
  TileMode[TileMode["Clamp"] = 0] = "Clamp";
13
+ /**
14
+ * Repeat the shader's image horizontally and vertically.
15
+ */
9
16
  TileMode[TileMode["Repeat"] = 1] = "Repeat";
17
+ /**
18
+ * Repeat the shader's image horizontally and vertically, alternating
19
+ * mirror images so that adjacent images always seam.
20
+ */
10
21
  TileMode[TileMode["Mirror"] = 2] = "Mirror";
22
+ /**
23
+ * Only draw within the original domain, return transparent-black everywhere else.
24
+ */
11
25
  TileMode[TileMode["Decal"] = 3] = "Decal";
12
26
  return TileMode;
13
27
  }({});
@@ -1 +1 @@
1
- {"version":3,"names":["TileMode","exports","isImageFilter","obj","__typename__"],"sources":["ImageFilter.ts"],"sourcesContent":["import type { SkJSIInstance } from \"../JsiInstance\";\n\nexport enum TileMode {\n /**\n * Replicate the edge color if the shader draws outside of its\n * original bounds.\n */\n Clamp,\n\n /**\n * Repeat the shader's image horizontally and vertically.\n */\n Repeat,\n\n /**\n * Repeat the shader's image horizontally and vertically, alternating\n * mirror images so that adjacent images always seam.\n */\n Mirror,\n\n /**\n * Only draw within the original domain, return transparent-black everywhere else.\n */\n Decal,\n}\n\nexport const isImageFilter = (\n obj: SkJSIInstance<string> | null\n): obj is SkImageFilter => obj !== null && obj.__typename__ === \"ImageFilter\";\n\nexport type SkImageFilter = SkJSIInstance<\"ImageFilter\">;\n"],"mappings":";;;;;;IAEYA,QAAQ,GAAAC,OAAA,CAAAD,QAAA,0BAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAARA,QAAQ,CAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;AAwBb,MAAME,aAAa,GACxBC,GAAiC,IACRA,GAAG,KAAK,IAAI,IAAIA,GAAG,CAACC,YAAY,KAAK,aAAa;AAACH,OAAA,CAAAC,aAAA,GAAAA,aAAA","ignoreList":[]}
1
+ {"version":3,"names":["TileMode","exports","isImageFilter","obj","__typename__"],"sources":["ImageFilter.ts"],"sourcesContent":["import type { SkJSIInstance } from \"../JsiInstance\";\n\nexport enum TileMode {\n /**\n * Replicate the edge color if the shader draws outside of its\n * original bounds.\n */\n Clamp,\n\n /**\n * Repeat the shader's image horizontally and vertically.\n */\n Repeat,\n\n /**\n * Repeat the shader's image horizontally and vertically, alternating\n * mirror images so that adjacent images always seam.\n */\n Mirror,\n\n /**\n * Only draw within the original domain, return transparent-black everywhere else.\n */\n Decal,\n}\n\nexport const isImageFilter = (\n obj: SkJSIInstance<string> | null\n): obj is SkImageFilter => obj !== null && obj.__typename__ === \"ImageFilter\";\n\nexport type SkImageFilter = SkJSIInstance<\"ImageFilter\">;\n"],"mappings":";;;;;;IAEYA,QAAQ,GAAAC,OAAA,CAAAD,QAAA,0BAARA,QAAQ;EAClB;AACF;AACA;AACA;EAJYA,QAAQ,CAARA,QAAQ;EAOlB;AACF;AACA;EATYA,QAAQ,CAARA,QAAQ;EAYlB;AACF;AACA;AACA;EAfYA,QAAQ,CAARA,QAAQ;EAkBlB;AACF;AACA;EApBYA,QAAQ,CAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;AAwBb,MAAME,aAAa,GACxBC,GAAiC,IACRA,GAAG,KAAK,IAAI,IAAIA,GAAG,CAACC,YAAY,KAAK,aAAa;AAACH,OAAA,CAAAC,aAAA,GAAAA,aAAA","ignoreList":[]}
@@ -6,11 +6,14 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.isMaskFilter = exports.BlurStyle = void 0;
7
7
  let BlurStyle = exports.BlurStyle = /*#__PURE__*/function (BlurStyle) {
8
8
  BlurStyle[BlurStyle["Normal"] = 0] = "Normal";
9
+ //!< fuzzy inside and outside
9
10
  BlurStyle[BlurStyle["Solid"] = 1] = "Solid";
11
+ //!< solid inside, fuzzy outside
10
12
  BlurStyle[BlurStyle["Outer"] = 2] = "Outer";
11
- BlurStyle[BlurStyle["Inner"] = 3] = "Inner";
13
+ //!< nothing inside, fuzzy outside
14
+ BlurStyle[BlurStyle["Inner"] = 3] = "Inner"; //!< fuzzy inside, nothing outside
12
15
  return BlurStyle;
13
- }({}); //!< fuzzy inside, nothing outside
16
+ }({});
14
17
  const isMaskFilter = obj => obj !== null && obj.__typename__ === "MaskFilter";
15
18
 
16
19
  /**
@@ -1 +1 @@
1
- {"version":3,"names":["BlurStyle","exports","isMaskFilter","obj","__typename__"],"sources":["MaskFilter.ts"],"sourcesContent":["import type { SkJSIInstance } from \"./JsiInstance\";\n\nexport enum BlurStyle {\n Normal, //!< fuzzy inside and outside\n Solid, //!< solid inside, fuzzy outside\n Outer, //!< nothing inside, fuzzy outside\n Inner, //!< fuzzy inside, nothing outside\n}\n\nexport const isMaskFilter = (\n obj: SkJSIInstance<string> | null\n): obj is SkMaskFilter => obj !== null && obj.__typename__ === \"MaskFilter\";\n\nexport type SkMaskFilter = SkJSIInstance<\"MaskFilter\">;\n\n/**\n * See SkMaskFilter.h for more details.\n */\nexport interface MaskFilterFactory {\n /**\n * Create a blur maskfilter\n * @param style\n * @param sigma - Standard deviation of the Gaussian blur to apply. Must be > 0.\n * @param respectCTM - if true the blur's sigma is modified by the CTM.\n */\n MakeBlur(style: BlurStyle, sigma: number, respectCTM: boolean): SkMaskFilter;\n}\n"],"mappings":";;;;;;IAEYA,SAAS,GAAAC,OAAA,CAAAD,SAAA,0BAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAAA,OAATA,SAAS;AAAA,OAIZ;AAGF,MAAME,YAAY,GACvBC,GAAiC,IACTA,GAAG,KAAK,IAAI,IAAIA,GAAG,CAACC,YAAY,KAAK,YAAY;;AAI3E;AACA;AACA;AAFAH,OAAA,CAAAC,YAAA,GAAAA,YAAA","ignoreList":[]}
1
+ {"version":3,"names":["BlurStyle","exports","isMaskFilter","obj","__typename__"],"sources":["MaskFilter.ts"],"sourcesContent":["import type { SkJSIInstance } from \"./JsiInstance\";\n\nexport enum BlurStyle {\n Normal, //!< fuzzy inside and outside\n Solid, //!< solid inside, fuzzy outside\n Outer, //!< nothing inside, fuzzy outside\n Inner, //!< fuzzy inside, nothing outside\n}\n\nexport const isMaskFilter = (\n obj: SkJSIInstance<string> | null\n): obj is SkMaskFilter => obj !== null && obj.__typename__ === \"MaskFilter\";\n\nexport type SkMaskFilter = SkJSIInstance<\"MaskFilter\">;\n\n/**\n * See SkMaskFilter.h for more details.\n */\nexport interface MaskFilterFactory {\n /**\n * Create a blur maskfilter\n * @param style\n * @param sigma - Standard deviation of the Gaussian blur to apply. Must be > 0.\n * @param respectCTM - if true the blur's sigma is modified by the CTM.\n */\n MakeBlur(style: BlurStyle, sigma: number, respectCTM: boolean): SkMaskFilter;\n}\n"],"mappings":";;;;;;IAEYA,SAAS,GAAAC,OAAA,CAAAD,SAAA,0BAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EACX;EADEA,SAAS,CAATA,SAAS;EAEZ;EAFGA,SAAS,CAATA,SAAS;EAGZ;EAHGA,SAAS,CAATA,SAAS,0BAIZ;EAAA,OAJGA,SAAS;AAAA;AAOd,MAAME,YAAY,GACvBC,GAAiC,IACTA,GAAG,KAAK,IAAI,IAAIA,GAAG,CAACC,YAAY,KAAK,YAAY;;AAI3E;AACA;AACA;AAFAH,OAAA,CAAAC,YAAA,GAAAA,YAAA","ignoreList":[]}
@@ -33,34 +33,63 @@ exports.BlendMode = void 0;
33
33
  */
34
34
  let BlendMode = exports.BlendMode = /*#__PURE__*/function (BlendMode) {
35
35
  BlendMode[BlendMode["Clear"] = 0] = "Clear";
36
+ //!< r = 0
36
37
  BlendMode[BlendMode["Src"] = 1] = "Src";
38
+ //!< r = s
37
39
  BlendMode[BlendMode["Dst"] = 2] = "Dst";
40
+ //!< r = d
38
41
  BlendMode[BlendMode["SrcOver"] = 3] = "SrcOver";
42
+ //!< r = s + (1-sa)*d
39
43
  BlendMode[BlendMode["DstOver"] = 4] = "DstOver";
44
+ //!< r = d + (1-da)*s
40
45
  BlendMode[BlendMode["SrcIn"] = 5] = "SrcIn";
46
+ //!< r = s * da
41
47
  BlendMode[BlendMode["DstIn"] = 6] = "DstIn";
48
+ //!< r = d * sa
42
49
  BlendMode[BlendMode["SrcOut"] = 7] = "SrcOut";
50
+ //!< r = s * (1-da)
43
51
  BlendMode[BlendMode["DstOut"] = 8] = "DstOut";
52
+ //!< r = d * (1-sa)
44
53
  BlendMode[BlendMode["SrcATop"] = 9] = "SrcATop";
54
+ //!< r = s*da + d*(1-sa)
45
55
  BlendMode[BlendMode["DstATop"] = 10] = "DstATop";
56
+ //!< r = d*sa + s*(1-da)
46
57
  BlendMode[BlendMode["Xor"] = 11] = "Xor";
58
+ //!< r = s*(1-da) + d*(1-sa)
47
59
  BlendMode[BlendMode["Plus"] = 12] = "Plus";
60
+ //!< r = min(s + d, 1)
48
61
  BlendMode[BlendMode["Modulate"] = 13] = "Modulate";
62
+ //!< r = s*d
49
63
  BlendMode[BlendMode["Screen"] = 14] = "Screen";
64
+ //!< r = s + d - s*d
50
65
  BlendMode[BlendMode["Overlay"] = 15] = "Overlay";
66
+ //!< multiply or screen, depending on destination
51
67
  BlendMode[BlendMode["Darken"] = 16] = "Darken";
68
+ //!< rc = s + d - max(s*da, d*sa), ra = kSrcOver
52
69
  BlendMode[BlendMode["Lighten"] = 17] = "Lighten";
70
+ //!< rc = s + d - min(s*da, d*sa), ra = kSrcOver
53
71
  BlendMode[BlendMode["ColorDodge"] = 18] = "ColorDodge";
72
+ //!< brighten destination to reflect source
54
73
  BlendMode[BlendMode["ColorBurn"] = 19] = "ColorBurn";
74
+ //!< darken destination to reflect source
55
75
  BlendMode[BlendMode["HardLight"] = 20] = "HardLight";
76
+ //!< multiply or screen, depending on source
56
77
  BlendMode[BlendMode["SoftLight"] = 21] = "SoftLight";
78
+ //!< lighten or darken, depending on source
57
79
  BlendMode[BlendMode["Difference"] = 22] = "Difference";
80
+ //!< rc = s + d - 2*(min(s*da, d*sa)), ra = kSrcOver
58
81
  BlendMode[BlendMode["Exclusion"] = 23] = "Exclusion";
82
+ //!< rc = s + d - two(s*d), ra = kSrcOver
59
83
  BlendMode[BlendMode["Multiply"] = 24] = "Multiply";
84
+ //!< r = s*(1-da) + d*(1-sa) + s*d
60
85
  BlendMode[BlendMode["Hue"] = 25] = "Hue";
86
+ //!< hue of source with saturation and luminosity of destination
61
87
  BlendMode[BlendMode["Saturation"] = 26] = "Saturation";
88
+ //!< saturation of source with hue and luminosity of
89
+ //!< destination
62
90
  BlendMode[BlendMode["Color"] = 27] = "Color";
63
- BlendMode[BlendMode["Luminosity"] = 28] = "Luminosity";
91
+ //!< hue and saturation of source with luminosity of destination
92
+ BlendMode[BlendMode["Luminosity"] = 28] = "Luminosity"; //!< luminosity of source with hue and saturation of
64
93
  return BlendMode;
65
- }({}); //!< luminosity of source with hue and saturation of
94
+ }({});
66
95
  //# sourceMappingURL=BlendMode.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["BlendMode","exports"],"sources":["BlendMode.ts"],"sourcesContent":["/**\n * Blends are operators that take in two colors (source, destination) and\n * return a new color. Many of these operate the same on all 4 components: red,\n * green, blue, alpha. For these, we just document what happens to one\n * component, rather than naming each one separately.\n *\n * Different SkColorTypes have different representations for color components:\n * 8-bit: 0..255\n * 6-bit: 0..63\n * 5-bit: 0..31\n * 4-bit: 0..15\n * floats: 0...1\n *\n * The documentation is expressed as if the component values are always 0..1\n * (floats).\n *\n * For brevity, the documentation uses the following abbreviations\n * s : source\n * d : destination\n * sa : source alpha\n * da : destination alpha\n *\n * Results are abbreviated\n * r : if all 4 components are computed in the same manner\n * ra : result alpha component\n * rc : result \"color\": red, green, blue components\n */\nexport enum BlendMode {\n Clear, //!< r = 0\n Src, //!< r = s\n Dst, //!< r = d\n SrcOver, //!< r = s + (1-sa)*d\n DstOver, //!< r = d + (1-da)*s\n SrcIn, //!< r = s * da\n DstIn, //!< r = d * sa\n SrcOut, //!< r = s * (1-da)\n DstOut, //!< r = d * (1-sa)\n SrcATop, //!< r = s*da + d*(1-sa)\n DstATop, //!< r = d*sa + s*(1-da)\n Xor, //!< r = s*(1-da) + d*(1-sa)\n Plus, //!< r = min(s + d, 1)\n Modulate, //!< r = s*d\n Screen, //!< r = s + d - s*d\n\n Overlay, //!< multiply or screen, depending on destination\n Darken, //!< rc = s + d - max(s*da, d*sa), ra = kSrcOver\n Lighten, //!< rc = s + d - min(s*da, d*sa), ra = kSrcOver\n ColorDodge, //!< brighten destination to reflect source\n ColorBurn, //!< darken destination to reflect source\n HardLight, //!< multiply or screen, depending on source\n SoftLight, //!< lighten or darken, depending on source\n Difference, //!< rc = s + d - 2*(min(s*da, d*sa)), ra = kSrcOver\n Exclusion, //!< rc = s + d - two(s*d), ra = kSrcOver\n Multiply, //!< r = s*(1-da) + d*(1-sa) + s*d\n\n Hue, //!< hue of source with saturation and luminosity of destination\n Saturation, //!< saturation of source with hue and luminosity of\n //!< destination\n Color, //!< hue and saturation of source with luminosity of destination\n Luminosity, //!< luminosity of source with hue and saturation of\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA1BA,IA2BYA,SAAS,GAAAC,OAAA,CAAAD,SAAA,0BAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EAAA,OAATA,SAAS;AAAA,OAgCP","ignoreList":[]}
1
+ {"version":3,"names":["BlendMode","exports"],"sources":["BlendMode.ts"],"sourcesContent":["/**\n * Blends are operators that take in two colors (source, destination) and\n * return a new color. Many of these operate the same on all 4 components: red,\n * green, blue, alpha. For these, we just document what happens to one\n * component, rather than naming each one separately.\n *\n * Different SkColorTypes have different representations for color components:\n * 8-bit: 0..255\n * 6-bit: 0..63\n * 5-bit: 0..31\n * 4-bit: 0..15\n * floats: 0...1\n *\n * The documentation is expressed as if the component values are always 0..1\n * (floats).\n *\n * For brevity, the documentation uses the following abbreviations\n * s : source\n * d : destination\n * sa : source alpha\n * da : destination alpha\n *\n * Results are abbreviated\n * r : if all 4 components are computed in the same manner\n * ra : result alpha component\n * rc : result \"color\": red, green, blue components\n */\nexport enum BlendMode {\n Clear, //!< r = 0\n Src, //!< r = s\n Dst, //!< r = d\n SrcOver, //!< r = s + (1-sa)*d\n DstOver, //!< r = d + (1-da)*s\n SrcIn, //!< r = s * da\n DstIn, //!< r = d * sa\n SrcOut, //!< r = s * (1-da)\n DstOut, //!< r = d * (1-sa)\n SrcATop, //!< r = s*da + d*(1-sa)\n DstATop, //!< r = d*sa + s*(1-da)\n Xor, //!< r = s*(1-da) + d*(1-sa)\n Plus, //!< r = min(s + d, 1)\n Modulate, //!< r = s*d\n Screen, //!< r = s + d - s*d\n\n Overlay, //!< multiply or screen, depending on destination\n Darken, //!< rc = s + d - max(s*da, d*sa), ra = kSrcOver\n Lighten, //!< rc = s + d - min(s*da, d*sa), ra = kSrcOver\n ColorDodge, //!< brighten destination to reflect source\n ColorBurn, //!< darken destination to reflect source\n HardLight, //!< multiply or screen, depending on source\n SoftLight, //!< lighten or darken, depending on source\n Difference, //!< rc = s + d - 2*(min(s*da, d*sa)), ra = kSrcOver\n Exclusion, //!< rc = s + d - two(s*d), ra = kSrcOver\n Multiply, //!< r = s*(1-da) + d*(1-sa) + s*d\n\n Hue, //!< hue of source with saturation and luminosity of destination\n Saturation, //!< saturation of source with hue and luminosity of\n //!< destination\n Color, //!< hue and saturation of source with luminosity of destination\n Luminosity, //!< luminosity of source with hue and saturation of\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA1BA,IA2BYA,SAAS,GAAAC,OAAA,CAAAD,SAAA,0BAATA,SAAS;EAATA,SAAS,CAATA,SAAS;EACZ;EADGA,SAAS,CAATA,SAAS;EAEd;EAFKA,SAAS,CAATA,SAAS;EAGd;EAHKA,SAAS,CAATA,SAAS;EAIV;EAJCA,SAAS,CAATA,SAAS;EAKV;EALCA,SAAS,CAATA,SAAS;EAMZ;EANGA,SAAS,CAATA,SAAS;EAOZ;EAPGA,SAAS,CAATA,SAAS;EAQX;EAREA,SAAS,CAATA,SAAS;EASX;EATEA,SAAS,CAATA,SAAS;EAUV;EAVCA,SAAS,CAATA,SAAS;EAWV;EAXCA,SAAS,CAATA,SAAS;EAYd;EAZKA,SAAS,CAATA,SAAS;EAab;EAbIA,SAAS,CAATA,SAAS;EAcT;EAdAA,SAAS,CAATA,SAAS;EAeX;EAfEA,SAAS,CAATA,SAAS;EAiBV;EAjBCA,SAAS,CAATA,SAAS;EAkBX;EAlBEA,SAAS,CAATA,SAAS;EAmBV;EAnBCA,SAAS,CAATA,SAAS;EAoBP;EApBFA,SAAS,CAATA,SAAS;EAqBR;EArBDA,SAAS,CAATA,SAAS;EAsBR;EAtBDA,SAAS,CAATA,SAAS;EAuBR;EAvBDA,SAAS,CAATA,SAAS;EAwBP;EAxBFA,SAAS,CAATA,SAAS;EAyBR;EAzBDA,SAAS,CAATA,SAAS;EA0BT;EA1BAA,SAAS,CAATA,SAAS;EA4Bd;EA5BKA,SAAS,CAATA,SAAS;EA6BP;EACZ;EA9BUA,SAAS,CAATA,SAAS;EA+BZ;EA/BGA,SAAS,CAATA,SAAS,qCAgCP;EAAA,OAhCFA,SAAS;AAAA","ignoreList":[]}
@@ -5,11 +5,25 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.PlaceholderAlignment = void 0;
7
7
  let PlaceholderAlignment = exports.PlaceholderAlignment = /*#__PURE__*/function (PlaceholderAlignment) {
8
+ /// Match the baseline of the placeholder with the baseline.
8
9
  PlaceholderAlignment[PlaceholderAlignment["Baseline"] = 0] = "Baseline";
10
+ /// Align the bottom edge of the placeholder with the baseline such that the
11
+ /// placeholder sits on top of the baseline.
9
12
  PlaceholderAlignment[PlaceholderAlignment["AboveBaseline"] = 1] = "AboveBaseline";
13
+ /// Align the top edge of the placeholder with the baseline specified in
14
+ /// such that the placeholder hangs below the baseline.
10
15
  PlaceholderAlignment[PlaceholderAlignment["BelowBaseline"] = 2] = "BelowBaseline";
16
+ /// Align the top edge of the placeholder with the top edge of the font.
17
+ /// When the placeholder is very tall, the extra space will hang from
18
+ /// the top and extend through the bottom of the line.
11
19
  PlaceholderAlignment[PlaceholderAlignment["Top"] = 3] = "Top";
20
+ /// Align the bottom edge of the placeholder with the top edge of the font.
21
+ /// When the placeholder is very tall, the extra space will rise from
22
+ /// the bottom and extend through the top of the line.
12
23
  PlaceholderAlignment[PlaceholderAlignment["Bottom"] = 4] = "Bottom";
24
+ /// Align the middle of the placeholder with the middle of the text. When the
25
+ /// placeholder is very tall, the extra space will grow equally from
26
+ /// the top and bottom of the line.
13
27
  PlaceholderAlignment[PlaceholderAlignment["Middle"] = 5] = "Middle";
14
28
  return PlaceholderAlignment;
15
29
  }({});
@@ -1 +1 @@
1
- {"version":3,"names":["PlaceholderAlignment","exports"],"sources":["ParagraphBuilder.ts"],"sourcesContent":["import type { SkJSIInstance } from \"../JsiInstance\";\nimport type { SkPaint } from \"../Paint\";\n\nimport type { SkParagraph } from \"./Paragraph\";\nimport type { SkParagraphStyle } from \"./ParagraphStyle\";\nimport type { SkTextStyle, TextBaseline } from \"./TextStyle\";\nimport type { SkTypefaceFontProvider } from \"./TypefaceFontProvider\";\n\nexport interface ParagraphBuilderFactory {\n /**\n * Creates a new ParagraphBuilder object from custom fonts.\n * @param paragraphStyle Initial paragraph style\n * @param typefaceProvider Typeface provider\n */\n Make(\n paragraphStyle?: SkParagraphStyle,\n typefaceProvider?: SkTypefaceFontProvider\n ): SkParagraphBuilder;\n}\n\nexport enum PlaceholderAlignment {\n /// Match the baseline of the placeholder with the baseline.\n Baseline = 0,\n\n /// Align the bottom edge of the placeholder with the baseline such that the\n /// placeholder sits on top of the baseline.\n AboveBaseline,\n\n /// Align the top edge of the placeholder with the baseline specified in\n /// such that the placeholder hangs below the baseline.\n BelowBaseline,\n\n /// Align the top edge of the placeholder with the top edge of the font.\n /// When the placeholder is very tall, the extra space will hang from\n /// the top and extend through the bottom of the line.\n Top,\n\n /// Align the bottom edge of the placeholder with the top edge of the font.\n /// When the placeholder is very tall, the extra space will rise from\n /// the bottom and extend through the top of the line.\n Bottom,\n\n /// Align the middle of the placeholder with the middle of the text. When the\n /// placeholder is very tall, the extra space will grow equally from\n /// the top and bottom of the line.\n Middle,\n}\n\nexport interface SkParagraphBuilder extends SkJSIInstance<\"ParagraphBuilder\"> {\n /**\n * Creates a Paragraph object from the builder and the inputs given to the builder.\n */\n build(): SkParagraph;\n /**\n * Restores the builder to its initial empty state.\n */\n reset(): void;\n /**\n * Pushes a text-style to the builder\n * @param style Style to push\n * @param foregroundPaint Foreground paint object\n * @param backgroundPaint Background paint object\n * @returns The builder\n */\n pushStyle: (\n style: SkTextStyle,\n foregroundPaint?: SkPaint | undefined,\n backgroundPaint?: SkPaint | undefined\n ) => SkParagraphBuilder;\n /**\n * Pops the current text style from the builder\n * @returns The builder\n */\n pop: () => SkParagraphBuilder;\n /**\n * Adds text to the builder\n * @param text\n * @returns The builder\n */\n addText: (text: string) => SkParagraphBuilder;\n /**\n * Pushes the information required to leave an open space.\n * @param width\n * @param height\n * @param alignment\n * @param baseline\n * @param offset\n */\n addPlaceholder(\n width?: number,\n height?: number,\n alignment?: PlaceholderAlignment,\n baseline?: TextBaseline,\n offset?: number\n ): SkParagraphBuilder;\n}\n"],"mappings":";;;;;;IAoBYA,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,0BAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAApBA,oBAAoB,CAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["PlaceholderAlignment","exports"],"sources":["ParagraphBuilder.ts"],"sourcesContent":["import type { SkJSIInstance } from \"../JsiInstance\";\nimport type { SkPaint } from \"../Paint\";\n\nimport type { SkParagraph } from \"./Paragraph\";\nimport type { SkParagraphStyle } from \"./ParagraphStyle\";\nimport type { SkTextStyle, TextBaseline } from \"./TextStyle\";\nimport type { SkTypefaceFontProvider } from \"./TypefaceFontProvider\";\n\nexport interface ParagraphBuilderFactory {\n /**\n * Creates a new ParagraphBuilder object from custom fonts.\n * @param paragraphStyle Initial paragraph style\n * @param typefaceProvider Typeface provider\n */\n Make(\n paragraphStyle?: SkParagraphStyle,\n typefaceProvider?: SkTypefaceFontProvider\n ): SkParagraphBuilder;\n}\n\nexport enum PlaceholderAlignment {\n /// Match the baseline of the placeholder with the baseline.\n Baseline = 0,\n\n /// Align the bottom edge of the placeholder with the baseline such that the\n /// placeholder sits on top of the baseline.\n AboveBaseline,\n\n /// Align the top edge of the placeholder with the baseline specified in\n /// such that the placeholder hangs below the baseline.\n BelowBaseline,\n\n /// Align the top edge of the placeholder with the top edge of the font.\n /// When the placeholder is very tall, the extra space will hang from\n /// the top and extend through the bottom of the line.\n Top,\n\n /// Align the bottom edge of the placeholder with the top edge of the font.\n /// When the placeholder is very tall, the extra space will rise from\n /// the bottom and extend through the top of the line.\n Bottom,\n\n /// Align the middle of the placeholder with the middle of the text. When the\n /// placeholder is very tall, the extra space will grow equally from\n /// the top and bottom of the line.\n Middle,\n}\n\nexport interface SkParagraphBuilder extends SkJSIInstance<\"ParagraphBuilder\"> {\n /**\n * Creates a Paragraph object from the builder and the inputs given to the builder.\n */\n build(): SkParagraph;\n /**\n * Restores the builder to its initial empty state.\n */\n reset(): void;\n /**\n * Pushes a text-style to the builder\n * @param style Style to push\n * @param foregroundPaint Foreground paint object\n * @param backgroundPaint Background paint object\n * @returns The builder\n */\n pushStyle: (\n style: SkTextStyle,\n foregroundPaint?: SkPaint | undefined,\n backgroundPaint?: SkPaint | undefined\n ) => SkParagraphBuilder;\n /**\n * Pops the current text style from the builder\n * @returns The builder\n */\n pop: () => SkParagraphBuilder;\n /**\n * Adds text to the builder\n * @param text\n * @returns The builder\n */\n addText: (text: string) => SkParagraphBuilder;\n /**\n * Pushes the information required to leave an open space.\n * @param width\n * @param height\n * @param alignment\n * @param baseline\n * @param offset\n */\n addPlaceholder(\n width?: number,\n height?: number,\n alignment?: PlaceholderAlignment,\n baseline?: TextBaseline,\n offset?: number\n ): SkParagraphBuilder;\n}\n"],"mappings":";;;;;;IAoBYA,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,0BAApBA,oBAAoB;EAC9B;EADUA,oBAAoB,CAApBA,oBAAoB;EAI9B;EACA;EALUA,oBAAoB,CAApBA,oBAAoB;EAQ9B;EACA;EATUA,oBAAoB,CAApBA,oBAAoB;EAY9B;EACA;EACA;EAdUA,oBAAoB,CAApBA,oBAAoB;EAiB9B;EACA;EACA;EAnBUA,oBAAoB,CAApBA,oBAAoB;EAsB9B;EACA;EACA;EAxBUA,oBAAoB,CAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA","ignoreList":[]}
@@ -16,9 +16,13 @@ let FillType = exports.FillType = /*#__PURE__*/function (FillType) {
16
16
  }({});
17
17
  let PathOp = exports.PathOp = /*#__PURE__*/function (PathOp) {
18
18
  PathOp[PathOp["Difference"] = 0] = "Difference";
19
+ //!< subtract the op path from the first path
19
20
  PathOp[PathOp["Intersect"] = 1] = "Intersect";
21
+ //!< intersect the two paths
20
22
  PathOp[PathOp["Union"] = 2] = "Union";
23
+ //!< union (inclusive-or) the two paths
21
24
  PathOp[PathOp["XOR"] = 3] = "XOR";
25
+ //!< exclusive-or the two paths
22
26
  PathOp[PathOp["ReverseDifference"] = 4] = "ReverseDifference";
23
27
  return PathOp;
24
28
  }({});