@shopify/react-native-skia 1.11.5 → 1.11.7
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.
- package/android/CMakeLists.txt +0 -1
- package/cpp/api/JsiSkParagraph.h +1 -3
- package/cpp/api/recorder/Convertor.h +19 -17
- package/cpp/api/recorder/Drawings.h +7 -10
- package/cpp/jsi/ViewProperty.h +1 -3
- package/lib/commonjs/animation/functions/interpolateColors.d.ts +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Gradient.d.ts +2 -2
- package/lib/commonjs/dom/types/NodeType.js +8 -0
- package/lib/commonjs/dom/types/NodeType.js.map +1 -1
- package/lib/commonjs/external/reanimated/buffers.d.ts +1 -1
- package/lib/commonjs/renderer/Canvas.d.ts +3 -2
- package/lib/commonjs/renderer/Canvas.js +4 -2
- package/lib/commonjs/renderer/Canvas.js.map +1 -1
- package/lib/commonjs/renderer/__tests__/setup.d.ts +1 -1
- package/lib/commonjs/skia/types/Image/ColorType.js +20 -2
- package/lib/commonjs/skia/types/Image/ColorType.js.map +1 -1
- package/lib/commonjs/skia/types/Image/ColorType.web.js +18 -2
- package/lib/commonjs/skia/types/Image/ColorType.web.js.map +1 -1
- package/lib/commonjs/skia/types/ImageFilter/ImageFilter.js +14 -0
- package/lib/commonjs/skia/types/ImageFilter/ImageFilter.js.map +1 -1
- package/lib/commonjs/skia/types/MaskFilter.js +5 -2
- package/lib/commonjs/skia/types/MaskFilter.js.map +1 -1
- package/lib/commonjs/skia/types/Paint/BlendMode.js +31 -2
- package/lib/commonjs/skia/types/Paint/BlendMode.js.map +1 -1
- package/lib/commonjs/skia/types/Paragraph/ParagraphBuilder.js +14 -0
- package/lib/commonjs/skia/types/Paragraph/ParagraphBuilder.js.map +1 -1
- package/lib/commonjs/skia/types/Path/Path.js +4 -0
- package/lib/commonjs/skia/types/Path/Path.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkCanvas.d.ts +1 -1
- package/lib/commonjs/skia/web/JsiSkImage.d.ts +2 -2
- package/lib/commonjs/skia/web/JsiSkPaint.d.ts +1 -1
- package/lib/commonjs/skia/web/JsiSkPicture.d.ts +1 -1
- package/lib/commonjs/skia/web/JsiSkPoint.d.ts +1 -1
- package/lib/commonjs/skia/web/JsiSkRRect.d.ts +1 -1
- package/lib/commonjs/skia/web/JsiSkRSXform.d.ts +1 -1
- package/lib/commonjs/skia/web/JsiSkRect.d.ts +1 -1
- package/lib/commonjs/sksg/Container.d.ts +1 -4
- package/lib/commonjs/sksg/Container.js +8 -9
- package/lib/commonjs/sksg/Container.js.map +1 -1
- package/lib/commonjs/sksg/Recorder/Core.js +2 -0
- package/lib/commonjs/sksg/Recorder/Core.js.map +1 -1
- package/lib/commonjs/specs/NativeSkiaModule.web.d.ts +6 -0
- package/lib/commonjs/specs/NativeSkiaModule.web.js +33 -0
- package/lib/commonjs/specs/NativeSkiaModule.web.js.map +1 -1
- package/lib/commonjs/specs/SkiaPictureViewNativeComponent.web.d.ts +9 -0
- package/lib/commonjs/specs/SkiaPictureViewNativeComponent.web.js +32 -0
- package/lib/commonjs/specs/SkiaPictureViewNativeComponent.web.js.map +1 -0
- package/lib/commonjs/views/types.d.ts +1 -0
- package/lib/commonjs/views/types.js.map +1 -1
- package/lib/commonjs/web/LoadSkiaWeb.js +1 -2
- package/lib/commonjs/web/LoadSkiaWeb.js.map +1 -1
- package/lib/module/animation/functions/interpolateColors.d.ts +1 -1
- package/lib/module/dom/nodes/datatypes/Gradient.d.ts +2 -2
- package/lib/module/dom/types/NodeType.js +8 -0
- package/lib/module/dom/types/NodeType.js.map +1 -1
- package/lib/module/external/reanimated/buffers.d.ts +1 -1
- package/lib/module/renderer/Canvas.d.ts +3 -2
- package/lib/module/renderer/Canvas.js +1 -1
- package/lib/module/renderer/Canvas.js.map +1 -1
- package/lib/module/renderer/__tests__/setup.d.ts +1 -1
- package/lib/module/skia/types/Image/ColorType.js +20 -2
- package/lib/module/skia/types/Image/ColorType.js.map +1 -1
- package/lib/module/skia/types/Image/ColorType.web.js +18 -2
- package/lib/module/skia/types/Image/ColorType.web.js.map +1 -1
- package/lib/module/skia/types/ImageFilter/ImageFilter.js +14 -0
- package/lib/module/skia/types/ImageFilter/ImageFilter.js.map +1 -1
- package/lib/module/skia/types/MaskFilter.js +5 -2
- package/lib/module/skia/types/MaskFilter.js.map +1 -1
- package/lib/module/skia/types/Paint/BlendMode.js +31 -2
- package/lib/module/skia/types/Paint/BlendMode.js.map +1 -1
- package/lib/module/skia/types/Paragraph/ParagraphBuilder.js +14 -0
- package/lib/module/skia/types/Paragraph/ParagraphBuilder.js.map +1 -1
- package/lib/module/skia/types/Path/Path.js +4 -0
- package/lib/module/skia/types/Path/Path.js.map +1 -1
- package/lib/module/skia/web/JsiSkCanvas.d.ts +1 -1
- package/lib/module/skia/web/JsiSkImage.d.ts +2 -2
- package/lib/module/skia/web/JsiSkPaint.d.ts +1 -1
- package/lib/module/skia/web/JsiSkPicture.d.ts +1 -1
- package/lib/module/skia/web/JsiSkPoint.d.ts +1 -1
- package/lib/module/skia/web/JsiSkRRect.d.ts +1 -1
- package/lib/module/skia/web/JsiSkRSXform.d.ts +1 -1
- package/lib/module/skia/web/JsiSkRect.d.ts +1 -1
- package/lib/module/sksg/Container.d.ts +1 -4
- package/lib/module/sksg/Container.js +8 -9
- package/lib/module/sksg/Container.js.map +1 -1
- package/lib/module/sksg/Recorder/Core.js +2 -0
- package/lib/module/sksg/Recorder/Core.js.map +1 -1
- package/lib/module/specs/NativeSkiaModule.web.d.ts +6 -0
- package/lib/module/specs/NativeSkiaModule.web.js +30 -1
- package/lib/module/specs/NativeSkiaModule.web.js.map +1 -1
- package/lib/module/specs/SkiaPictureViewNativeComponent.web.d.ts +9 -0
- package/lib/module/specs/SkiaPictureViewNativeComponent.web.js +26 -0
- package/lib/module/specs/SkiaPictureViewNativeComponent.web.js.map +1 -0
- package/lib/module/views/types.d.ts +1 -0
- package/lib/module/views/types.js.map +1 -1
- package/lib/typescript/lib/commonjs/animation/functions/interpolateColors.d.ts +1 -1
- package/lib/typescript/lib/commonjs/renderer/Canvas.d.ts +2 -3
- package/lib/typescript/lib/commonjs/renderer/components/image/ImageShader.d.ts +1 -1
- package/lib/typescript/lib/commonjs/skia/web/JsiSkColor.d.ts +1 -1
- package/lib/typescript/lib/commonjs/skia/web/JsiSkia.d.ts +1 -1
- package/lib/typescript/lib/commonjs/specs/NativeSkiaModule.web.d.ts +1 -0
- package/lib/typescript/lib/commonjs/specs/SkiaPictureViewNativeComponent.web.d.ts +10 -0
- package/lib/typescript/lib/module/animation/functions/interpolateColors.d.ts +1 -1
- package/lib/typescript/lib/module/mock/index.d.ts +2 -2
- package/lib/typescript/lib/module/renderer/Canvas.d.ts +3 -2
- package/lib/typescript/lib/module/renderer/components/image/ImageShader.d.ts +1 -1
- package/lib/typescript/lib/module/skia/Skia.web.d.ts +1 -1
- package/lib/typescript/lib/module/skia/web/JsiSkColor.d.ts +1 -1
- package/lib/typescript/lib/module/skia/web/JsiSkia.d.ts +1 -1
- package/lib/typescript/lib/module/specs/NativeSkiaModule.web.d.ts +1 -0
- package/lib/typescript/lib/module/specs/SkiaPictureViewNativeComponent.web.d.ts +9 -0
- package/lib/typescript/src/animation/functions/interpolateColors.d.ts +1 -1
- package/lib/typescript/src/dom/nodes/datatypes/Gradient.d.ts +2 -2
- package/lib/typescript/src/external/reanimated/buffers.d.ts +1 -1
- package/lib/typescript/src/renderer/Canvas.d.ts +3 -2
- package/lib/typescript/src/renderer/__tests__/setup.d.ts +1 -1
- package/lib/typescript/src/skia/web/JsiSkCanvas.d.ts +1 -1
- package/lib/typescript/src/skia/web/JsiSkImage.d.ts +2 -2
- package/lib/typescript/src/skia/web/JsiSkPaint.d.ts +1 -1
- package/lib/typescript/src/skia/web/JsiSkPicture.d.ts +1 -1
- package/lib/typescript/src/skia/web/JsiSkPoint.d.ts +1 -1
- package/lib/typescript/src/skia/web/JsiSkRRect.d.ts +1 -1
- package/lib/typescript/src/skia/web/JsiSkRSXform.d.ts +1 -1
- package/lib/typescript/src/skia/web/JsiSkRect.d.ts +1 -1
- package/lib/typescript/src/sksg/Container.d.ts +1 -4
- package/lib/typescript/src/specs/NativeSkiaModule.web.d.ts +6 -0
- package/lib/typescript/src/specs/SkiaPictureViewNativeComponent.web.d.ts +9 -0
- package/lib/typescript/src/views/types.d.ts +1 -0
- package/package.json +1 -1
- package/src/renderer/Canvas.tsx +1 -1
- package/src/sksg/Container.ts +7 -12
- package/src/specs/NativeSkiaModule.web.ts +38 -0
- package/src/specs/SkiaPictureViewNativeComponent.web.ts +39 -0
- package/src/views/types.ts +1 -0
- package/cpp/jsi/JsiValue.cpp +0 -345
- package/cpp/jsi/JsiValue.h +0 -222
- package/lib/commonjs/renderer/Canvas.web.d.ts +0 -11
- package/lib/commonjs/renderer/Canvas.web.js +0 -112
- package/lib/commonjs/renderer/Canvas.web.js.map +0 -1
- package/lib/module/renderer/Canvas.web.d.ts +0 -11
- package/lib/module/renderer/Canvas.web.js +0 -105
- package/lib/module/renderer/Canvas.web.js.map +0 -1
- package/lib/typescript/lib/commonjs/renderer/Canvas.web.d.ts +0 -2
- package/lib/typescript/lib/module/renderer/Canvas.web.d.ts +0 -2
- package/lib/typescript/src/renderer/Canvas.web.d.ts +0 -11
- package/src/renderer/Canvas.web.tsx +0 -134
package/android/CMakeLists.txt
CHANGED
|
@@ -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"
|
package/cpp/api/JsiSkParagraph.h
CHANGED
|
@@ -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
|
-
|
|
402
|
-
);
|
|
400
|
+
static_cast<SkGlyphID>(glyph.getProperty(runtime, "id").asNumber()));
|
|
403
401
|
// Get the position
|
|
404
402
|
result.positions.push_back(
|
|
405
|
-
|
|
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,
|
|
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(
|
|
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
|
-
|
|
462
|
-
|
|
460
|
+
std::shared_ptr<JsiSkParagraph> getPropertyValue(jsi::Runtime &runtime,
|
|
461
|
+
const jsi::Value &value) {
|
|
463
462
|
if (value.isObject()) {
|
|
464
|
-
auto
|
|
465
|
-
|
|
466
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
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
|
-
|
|
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
|
};
|
package/cpp/jsi/ViewProperty.h
CHANGED
|
@@ -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[]) =>
|
|
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:
|
|
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;
|
|
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<
|
|
6
|
+
export declare const useColorBuffer: (size: number, modifier: Modifier<SkColor>) => import("react-native-reanimated/lib/typescript/commonTypes").Mutable<SkColor[]>;
|
|
7
7
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { FC } from "react";
|
|
2
|
+
import React from "react";
|
|
2
3
|
import type { ViewProps } from "react-native";
|
|
3
4
|
import type { SharedValue } from "react-native-reanimated";
|
|
4
5
|
import type { SkImage, SkRect, SkSize } from "../skia/types";
|
|
@@ -8,12 +9,12 @@ interface CanvasRef extends FC<CanvasProps> {
|
|
|
8
9
|
redraw(): void;
|
|
9
10
|
getNativeId(): number;
|
|
10
11
|
}
|
|
11
|
-
export declare const useCanvasRef: () =>
|
|
12
|
+
export declare const useCanvasRef: () => React.RefObject<CanvasRef>;
|
|
12
13
|
export interface CanvasProps extends ViewProps {
|
|
13
14
|
debug?: boolean;
|
|
14
15
|
opaque?: boolean;
|
|
15
16
|
onSize?: SharedValue<SkSize>;
|
|
16
17
|
mode?: "continuous" | "default";
|
|
17
18
|
}
|
|
18
|
-
export declare const Canvas:
|
|
19
|
+
export declare const Canvas: React.ForwardRefExoticComponent<CanvasProps & React.RefAttributes<unknown>>;
|
|
19
20
|
export {};
|
|
@@ -4,12 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.useCanvasRef = exports.Canvas = void 0;
|
|
7
|
-
var _react = require("react");
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _SkiaViewNativeId = require("../views/SkiaViewNativeId");
|
|
9
9
|
var _SkiaPictureViewNativeComponent = _interopRequireDefault(require("../specs/SkiaPictureViewNativeComponent"));
|
|
10
10
|
var _Reconciler = require("../sksg/Reconciler");
|
|
11
11
|
var _skia = require("../skia");
|
|
12
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
14
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
15
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
14
16
|
const useCanvasRef = () => (0, _react.useRef)(null);
|
|
15
17
|
exports.useCanvasRef = useCanvasRef;
|
|
@@ -95,7 +97,7 @@ const Canvas = exports.Canvas = /*#__PURE__*/(0, _react.forwardRef)(({
|
|
|
95
97
|
return nativeId;
|
|
96
98
|
}
|
|
97
99
|
}));
|
|
98
|
-
return /*#__PURE__*/
|
|
100
|
+
return /*#__PURE__*/_react.default.createElement(NativeSkiaPictureView, _extends({
|
|
99
101
|
collapsable: false,
|
|
100
102
|
nativeID: `${nativeId}`,
|
|
101
103
|
debug: debug,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_SkiaViewNativeId","_SkiaPictureViewNativeComponent","_interopRequireDefault","_Reconciler","_skia","e","__esModule","default","
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_SkiaViewNativeId","_SkiaPictureViewNativeComponent","_interopRequireDefault","_Reconciler","_skia","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","useCanvasRef","useRef","exports","NativeSkiaPictureView","SkiaPictureViewNativeComponent","useOnSizeEvent","resultValue","onLayout","useCallback","event","width","height","nativeEvent","layout","value","Canvas","forwardRef","mode","debug","opaque","children","onSize","_onLayout","viewProps","ref","rafId","nativeId","useMemo","SkiaViewNativeId","current","root","SkiaSGRoot","Skia","useEffect","render","unmount","requestRedraw","requestAnimationFrame","console","warn","cancelAnimationFrame","useImperativeHandle","makeImageSnapshot","rect","SkiaViewApi","makeImageSnapshotAsync","redraw","getNativeId","createElement","collapsable","nativeID"],"sources":["Canvas.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport React, {\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n} from \"react\";\nimport type { LayoutChangeEvent, ViewProps } from \"react-native\";\nimport type { SharedValue } from \"react-native-reanimated\";\n\nimport { SkiaViewNativeId } from \"../views/SkiaViewNativeId\";\nimport SkiaPictureViewNativeComponent from \"../specs/SkiaPictureViewNativeComponent\";\nimport type { SkImage, SkRect, SkSize } from \"../skia/types\";\nimport { SkiaSGRoot } from \"../sksg/Reconciler\";\nimport { Skia } from \"../skia\";\nimport type { SkiaBaseViewProps } from \"../views\";\n\ninterface CanvasRef extends FC<CanvasProps> {\n makeImageSnapshot(rect?: SkRect): SkImage;\n makeImageSnapshotAsync(rect?: SkRect): Promise<SkImage>;\n redraw(): void;\n getNativeId(): number;\n}\n\nexport const useCanvasRef = () => useRef<CanvasRef>(null);\n\nconst NativeSkiaPictureView = SkiaPictureViewNativeComponent;\n\n// TODO: no need to go through the JS thread for this\nconst useOnSizeEvent = (\n resultValue: SkiaBaseViewProps[\"onSize\"],\n onLayout?: (event: LayoutChangeEvent) => void\n) => {\n return useCallback(\n (event: LayoutChangeEvent) => {\n if (onLayout) {\n onLayout(event);\n }\n const { width, height } = event.nativeEvent.layout;\n\n if (resultValue) {\n resultValue.value = { width, height };\n }\n },\n [onLayout, resultValue]\n );\n};\n\nexport interface CanvasProps extends ViewProps {\n debug?: boolean;\n opaque?: boolean;\n onSize?: SharedValue<SkSize>;\n mode?: \"continuous\" | \"default\";\n}\n\nexport const Canvas = forwardRef(\n (\n {\n mode,\n debug,\n opaque,\n children,\n onSize,\n onLayout: _onLayout,\n ...viewProps\n }: CanvasProps,\n ref\n ) => {\n const rafId = useRef<number | null>(null);\n const onLayout = useOnSizeEvent(onSize, _onLayout);\n // Native ID\n const nativeId = useMemo(() => {\n return SkiaViewNativeId.current++;\n }, []);\n\n // Root\n const root = useMemo(() => new SkiaSGRoot(Skia, nativeId), [nativeId]);\n\n // Render effects\n useEffect(() => {\n root.render(children);\n }, [children, root]);\n\n useEffect(() => {\n return () => {\n root.unmount();\n };\n }, [root]);\n\n const requestRedraw = useCallback(() => {\n rafId.current = requestAnimationFrame(() => {\n root.render(children);\n if (mode === \"continuous\") {\n requestRedraw();\n }\n });\n }, [children, mode, root]);\n\n useEffect(() => {\n if (mode === \"continuous\") {\n console.warn(\"The `mode` property in `Canvas` is deprecated.\");\n requestRedraw();\n }\n return () => {\n if (rafId.current !== null) {\n cancelAnimationFrame(rafId.current);\n }\n };\n }, [mode, requestRedraw]);\n // Component methods\n useImperativeHandle(ref, () => ({\n makeImageSnapshot: (rect?: SkRect) => {\n return SkiaViewApi.makeImageSnapshot(nativeId, rect);\n },\n makeImageSnapshotAsync: (rect?: SkRect) => {\n return SkiaViewApi.makeImageSnapshotAsync(nativeId, rect);\n },\n redraw: () => {\n SkiaViewApi.requestRedraw(nativeId);\n },\n getNativeId: () => {\n return nativeId;\n },\n }));\n return (\n <NativeSkiaPictureView\n collapsable={false}\n nativeID={`${nativeId}`}\n debug={debug}\n opaque={opaque}\n onLayout={onLayout}\n {...viewProps}\n />\n );\n }\n);\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -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
|
-
|
|
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
|
-
}({});
|
|
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;
|
|
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
|
-
|
|
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
|
-
}({});
|
|
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;
|
|
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;
|
|
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
|
-
|
|
13
|
+
//!< nothing inside, fuzzy outside
|
|
14
|
+
BlurStyle[BlurStyle["Inner"] = 3] = "Inner"; //!< fuzzy inside, nothing outside
|
|
12
15
|
return BlurStyle;
|
|
13
|
-
}({});
|
|
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;
|
|
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
|
-
|
|
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
|
-
}({});
|
|
94
|
+
}({});
|
|
66
95
|
//# sourceMappingURL=BlendMode.js.map
|