@shopify/react-native-skia 1.12.1 → 1.12.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apple/MetalContext.h +129 -0
- package/apple/MetalContext.mm +34 -0
- package/apple/MetalWindowContext.h +39 -0
- package/apple/MetalWindowContext.mm +64 -0
- package/apple/RNSkApplePlatformContext.h +79 -0
- package/apple/RNSkApplePlatformContext.mm +303 -0
- package/apple/RNSkAppleVideo.h +51 -0
- package/apple/RNSkAppleVideo.mm +137 -0
- package/apple/RNSkAppleView.h +37 -0
- package/apple/RNSkAppleView.mm +35 -0
- package/apple/RNSkMetalCanvasProvider.h +38 -0
- package/apple/RNSkMetalCanvasProvider.mm +108 -0
- package/apple/RNSkiaModule.h +20 -0
- package/apple/RNSkiaModule.mm +55 -0
- package/apple/SkiaCVPixelBufferUtils.h +119 -0
- package/apple/SkiaCVPixelBufferUtils.mm +344 -0
- package/apple/SkiaManager.h +25 -0
- package/apple/SkiaManager.mm +62 -0
- package/apple/SkiaPictureView.h +7 -0
- package/apple/SkiaPictureView.mm +66 -0
- package/apple/SkiaPictureViewManager.h +8 -0
- package/apple/SkiaPictureViewManager.mm +55 -0
- package/apple/SkiaUIView.h +45 -0
- package/apple/SkiaUIView.mm +172 -0
- package/apple/ViewScreenshotService.h +25 -0
- package/apple/ViewScreenshotService.mm +89 -0
- package/cpp/api/JsiSkShaderFactory.h +43 -8
- package/cpp/api/JsiSkVertices.h +14 -3
- package/lib/commonjs/__tests__/setup.d.ts +18 -0
- package/lib/commonjs/headless/index.d.ts +1 -0
- package/lib/commonjs/headless/index.js +12 -0
- package/lib/commonjs/headless/index.js.map +1 -1
- package/lib/commonjs/skia/web/Host.d.ts +3 -3
- package/lib/commonjs/skia/web/Host.js +16 -4
- package/lib/commonjs/skia/web/Host.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkCanvas.js +15 -15
- package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js +1 -1
- package/lib/commonjs/skia/web/JsiSkColorFilterFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkFont.js +2 -2
- package/lib/commonjs/skia/web/JsiSkFont.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkImage.js +6 -6
- package/lib/commonjs/skia/web/JsiSkImage.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkImageFactory.js +2 -2
- package/lib/commonjs/skia/web/JsiSkImageFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js +3 -3
- package/lib/commonjs/skia/web/JsiSkImageFilterFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkMaskFilterFactory.js +1 -1
- package/lib/commonjs/skia/web/JsiSkMaskFilterFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPaint.js +3 -3
- package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPath.js +4 -4
- package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js +1 -1
- package/lib/commonjs/skia/web/JsiSkPathEffectFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPathFactory.js +1 -1
- package/lib/commonjs/skia/web/JsiSkPathFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPicture.js +1 -1
- package/lib/commonjs/skia/web/JsiSkPicture.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkShaderFactory.js +5 -5
- package/lib/commonjs/skia/web/JsiSkShaderFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkVerticesFactory.js +1 -1
- package/lib/commonjs/skia/web/JsiSkVerticesFactory.js.map +1 -1
- package/lib/module/__tests__/setup.d.ts +18 -0
- package/lib/module/headless/index.d.ts +1 -0
- package/lib/module/headless/index.js +1 -0
- package/lib/module/headless/index.js.map +1 -1
- package/lib/module/skia/web/Host.d.ts +3 -3
- package/lib/module/skia/web/Host.js +16 -4
- package/lib/module/skia/web/Host.js.map +1 -1
- package/lib/module/skia/web/JsiSkCanvas.js +15 -15
- package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/module/skia/web/JsiSkColorFilterFactory.js +1 -1
- package/lib/module/skia/web/JsiSkColorFilterFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkFont.js +2 -2
- package/lib/module/skia/web/JsiSkFont.js.map +1 -1
- package/lib/module/skia/web/JsiSkImage.js +6 -6
- package/lib/module/skia/web/JsiSkImage.js.map +1 -1
- package/lib/module/skia/web/JsiSkImageFactory.js +2 -2
- package/lib/module/skia/web/JsiSkImageFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkImageFilterFactory.js +3 -3
- package/lib/module/skia/web/JsiSkImageFilterFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkMaskFilterFactory.js +1 -1
- package/lib/module/skia/web/JsiSkMaskFilterFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkPaint.js +3 -3
- package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
- package/lib/module/skia/web/JsiSkPath.js +4 -4
- package/lib/module/skia/web/JsiSkPath.js.map +1 -1
- package/lib/module/skia/web/JsiSkPathEffectFactory.js +1 -1
- package/lib/module/skia/web/JsiSkPathEffectFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkPathFactory.js +1 -1
- package/lib/module/skia/web/JsiSkPathFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkPicture.js +1 -1
- package/lib/module/skia/web/JsiSkPicture.js.map +1 -1
- package/lib/module/skia/web/JsiSkShaderFactory.js +5 -5
- package/lib/module/skia/web/JsiSkShaderFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkVerticesFactory.js +1 -1
- package/lib/module/skia/web/JsiSkVerticesFactory.js.map +1 -1
- package/lib/typescript/lib/commonjs/mock/index.d.ts +1 -1
- package/lib/typescript/lib/commonjs/skia/index.d.ts +1 -1
- package/lib/typescript/lib/commonjs/skia/web/Host.d.ts +2 -2
- package/lib/typescript/lib/module/headless/index.d.ts +1 -0
- package/lib/typescript/lib/module/mock/index.d.ts +1 -1
- package/lib/typescript/lib/module/skia/Skia.d.ts +1 -1
- package/lib/typescript/lib/module/skia/web/Host.d.ts +2 -2
- package/lib/typescript/src/__tests__/setup.d.ts +18 -0
- package/lib/typescript/src/headless/index.d.ts +1 -0
- package/lib/typescript/src/skia/web/Host.d.ts +3 -3
- package/package.json +4 -4
- package/src/__tests__/setup.ts +67 -1
- package/src/headless/index.ts +2 -1
- package/src/renderer/__tests__/e2e/Matrix4.spec.tsx +1 -2
- package/src/renderer/__tests__/e2e/Paths.spec.tsx +13 -11
- package/src/skia/__tests__/Enums.spec.ts +24 -2
- package/src/skia/__tests__/Path.spec.ts +2 -2
- package/src/skia/web/Host.ts +24 -7
- package/src/skia/web/JsiSkCanvas.ts +17 -17
- package/src/skia/web/JsiSkColorFilterFactory.ts +1 -1
- package/src/skia/web/JsiSkFont.ts +2 -2
- package/src/skia/web/JsiSkImage.ts +14 -10
- package/src/skia/web/JsiSkImageFactory.ts +2 -2
- package/src/skia/web/JsiSkImageFilterFactory.ts +4 -4
- package/src/skia/web/JsiSkMaskFilterFactory.ts +1 -1
- package/src/skia/web/JsiSkPaint.ts +3 -3
- package/src/skia/web/JsiSkPath.ts +4 -4
- package/src/skia/web/JsiSkPathEffectFactory.ts +1 -1
- package/src/skia/web/JsiSkPathFactory.ts +1 -1
- package/src/skia/web/JsiSkPicture.ts +3 -3
- package/src/skia/web/JsiSkShaderFactory.ts +5 -5
- package/src/skia/web/JsiSkVerticesFactory.ts +1 -1
- package/lib/commonjs/skia/types/Image/ColorType.web.d.ts +0 -19
- package/lib/commonjs/skia/types/Image/ColorType.web.js +0 -43
- package/lib/commonjs/skia/types/Image/ColorType.web.js.map +0 -1
- package/lib/module/skia/types/Image/ColorType.web.d.ts +0 -19
- package/lib/module/skia/types/Image/ColorType.web.js +0 -37
- package/lib/module/skia/types/Image/ColorType.web.js.map +0 -1
- package/lib/typescript/lib/commonjs/skia/types/Image/ColorType.web.d.ts +0 -2
- package/lib/typescript/lib/module/skia/types/Image/ColorType.web.d.ts +0 -1
- package/lib/typescript/src/skia/types/Image/ColorType.web.d.ts +0 -19
- package/src/skia/types/Image/ColorType.web.ts +0 -19
@@ -4,6 +4,7 @@ import {
|
|
4
4
|
AlphaType,
|
5
5
|
BlurStyle,
|
6
6
|
ClipOp,
|
7
|
+
ColorType,
|
7
8
|
FillType,
|
8
9
|
FilterMode,
|
9
10
|
FontEdging,
|
@@ -26,7 +27,6 @@ import {
|
|
26
27
|
import { Path1DEffectStyle } from "../types/PathEffect";
|
27
28
|
import { BlendMode } from "../types/Paint/BlendMode";
|
28
29
|
import { mapKeys } from "../../renderer/typeddash";
|
29
|
-
import { ColorTypeCanvasKit } from "../types/Image/ColorType.web";
|
30
30
|
|
31
31
|
import { setupSkia } from "./setup";
|
32
32
|
|
@@ -71,7 +71,7 @@ describe("Enums", () => {
|
|
71
71
|
});
|
72
72
|
it("Should match Image enums values with CanvasKit", () => {
|
73
73
|
const { CanvasKit } = setupSkia();
|
74
|
-
checkEnum(
|
74
|
+
checkEnum(ColorType, CanvasKit.ColorType);
|
75
75
|
checkEnum(AlphaType, CanvasKit.AlphaType);
|
76
76
|
checkEnum(ImageFormat, CanvasKit.ImageFormat);
|
77
77
|
checkEnum(MipmapMode, CanvasKit.MipmapMode);
|
@@ -111,4 +111,26 @@ describe("Enums", () => {
|
|
111
111
|
);
|
112
112
|
checkEnum(ClipOp, CanvasKit.ClipOp);
|
113
113
|
});
|
114
|
+
it("Should match color types with CanvasKit", () => {
|
115
|
+
const { CanvasKit } = setupSkia();
|
116
|
+
//expect(CanvasKit.ColorType.Unknown.value).toBe(ColorType.Unknown);
|
117
|
+
expect(CanvasKit.ColorType.Alpha_8.value).toBe(ColorType.Alpha_8);
|
118
|
+
expect(CanvasKit.ColorType.RGB_565.value).toBe(ColorType.RGB_565);
|
119
|
+
//expect(CanvasKit.ColorType.ARGB_4444.value).toBe(ColorType.ARGB_4444);
|
120
|
+
expect(CanvasKit.ColorType.RGBA_8888.value).toBe(ColorType.RGBA_8888);
|
121
|
+
//expect(CanvasKit.ColorType.RGB_888x.value).toBe(ColorType.RGB_888x);
|
122
|
+
expect(CanvasKit.ColorType.BGRA_8888.value).toBe(ColorType.BGRA_8888);
|
123
|
+
expect(CanvasKit.ColorType.RGBA_1010102.value).toBe(ColorType.RGBA_1010102);
|
124
|
+
//expect(CanvasKit.ColorType.BGRA_1010102.value).toBe(ColorType.BGRA_1010102);
|
125
|
+
expect(CanvasKit.ColorType.RGB_101010x.value).toBe(ColorType.RGB_101010x);
|
126
|
+
//expect(CanvasKit.ColorType.BGR_101010x.value).toBe(ColorType.BGR_101010x);
|
127
|
+
//expect(CanvasKit.ColorType.BGR_101010x_XR.value).toBe(ColorType.BGR_101010x_XR);
|
128
|
+
//expect(CanvasKit.ColorType.BGRA_10101010_XR.value).toBe(ColorType.BGRA_10101010_XR);
|
129
|
+
//expect(CanvasKit.ColorType.RGBA_10x6.value).toBe(ColorType.RGBA_10x6);
|
130
|
+
expect(CanvasKit.ColorType.Gray_8.value).toBe(ColorType.Gray_8);
|
131
|
+
//expect(CanvasKit.ColorType.RGBA_F16Norm.value).toBe(ColorType.RGBA_F16Norm);
|
132
|
+
expect(CanvasKit.ColorType.RGBA_F16.value).toBe(ColorType.RGBA_F16);
|
133
|
+
//expect(CanvasKit.ColorType.RGB_F16F16F16x.value).toBe(ColorType.RGB_F16F16F16x);
|
134
|
+
expect(CanvasKit.ColorType.RGBA_F32.value).toBe(ColorType.RGBA_F32);
|
135
|
+
});
|
114
136
|
});
|
@@ -18,14 +18,14 @@ describe("Path", () => {
|
|
18
18
|
const svg2 =
|
19
19
|
"M128 191.877C104.213 216.339 80.8869 228.058 66.7826 219.915C52.6783 211.772 51.1647 185.712 60.4559 152.88C27.3773 144.511 5.56522 130.17 5.56522 113.884C5.56522 97.5975 27.3773 83.2565 60.4559 74.8871C51.1647 42.0555 52.6783 15.9952 66.7826 7.85209C80.8869 -0.291009 104.213 11.4283 128 35.8905C151.787 11.4283 175.113 -0.291018 189.217 7.85208C203.322 15.9952 204.835 42.0555 195.544 74.8871C228.623 83.2565 250.435 97.5975 250.435 113.884C250.435 130.17 228.623 144.511 195.544 152.88C204.835 185.712 203.322 211.772 189.217 219.915C175.113 228.058 151.787 216.339 128 191.877ZM71.7826 211.255C69.497 209.936 67.0111 206.926 65.6137 200.393C64.2166 193.861 64.1969 184.917 65.9598 173.914C66.9004 168.042 68.3234 161.739 70.2187 155.109C79.9755 157.106 90.5237 158.614 101.637 159.545C108.001 168.704 114.58 177.085 121.189 184.536C116.395 189.493 111.647 193.877 107.033 197.627C98.385 204.655 90.6292 209.111 84.2739 211.167C77.9172 213.223 74.0682 212.575 71.7826 211.255ZM185.781 72.6589C187.677 66.0285 189.1 59.7251 190.04 53.8539C191.803 42.8506 191.783 33.9062 190.386 27.3744C188.989 20.8411 186.503 17.8319 184.217 16.5123C181.932 15.1928 178.083 14.5444 171.726 16.6009C165.371 18.6569 157.615 23.112 148.967 30.1404C144.353 33.8906 139.605 38.2747 134.811 43.2312C141.42 50.6819 147.999 59.0631 154.363 68.2223C165.476 69.1534 176.025 70.6611 185.781 72.6589ZM121.189 43.2312C116.395 38.2747 111.647 33.8906 107.033 30.1404C98.385 23.112 90.6292 18.6569 84.2739 16.6009C77.9172 14.5445 74.0682 15.1928 71.7826 16.5123C69.497 17.8319 67.0111 20.8411 65.6137 27.3744C64.2166 33.9062 64.1969 42.8506 65.9598 53.8539C66.9004 59.7251 68.3234 66.0286 70.2187 72.6589C79.9755 70.6611 90.5237 69.1534 101.637 68.2223C108.001 59.0631 114.58 50.682 121.189 43.2312ZM114.51 67.4164C118.965 61.3763 123.485 55.7626 128 50.6258C132.515 55.7626 137.035 61.3763 141.49 67.4164C137.06 67.231 132.559 67.1359 128 67.1359C123.441 67.1359 118.94 67.231 114.51 67.4164ZM94.503 78.9676C87.0448 79.8054 79.9231 80.9132 73.2171 82.2548C75.4082 88.7331 78.0097 95.4546 81.0133 102.333C83.0676 98.4035 85.2357 94.4581 87.5152 90.5098C89.7947 86.5615 92.1276 82.7112 94.503 78.9676ZM86.3696 113.884C89.3439 107.821 92.6143 101.678 96.1754 95.5098C99.7366 89.3416 103.422 83.4378 107.185 77.8307C113.922 77.3752 120.878 77.1359 128 77.1359C135.122 77.1359 142.078 77.3752 148.815 77.8307C152.578 83.4378 156.263 89.3416 159.825 95.5098C163.386 101.678 166.656 107.821 169.63 113.884C166.656 119.946 163.386 126.089 159.825 132.258C156.263 138.426 152.578 144.33 148.815 149.937C142.078 150.392 135.122 150.632 128 150.632C120.878 150.632 113.922 150.392 107.185 149.937C103.422 144.33 99.7366 138.426 96.1754 132.258C92.6143 126.089 89.3439 119.946 86.3696 113.884ZM75.2747 113.884C70.5243 103.793 66.5558 93.9046 63.4076 84.4561C56.7179 86.1298 50.5474 88.0492 44.9926 90.1702C34.5819 94.1452 26.8457 98.6344 21.8875 103.11C16.9283 107.587 15.5652 111.245 15.5652 113.884C15.5652 116.523 16.9283 120.18 21.8875 124.657C26.8457 129.133 34.5819 133.622 44.9926 137.597C50.5474 139.718 56.7179 141.638 63.4076 143.311C66.5558 133.863 70.5243 123.974 75.2747 113.884ZM73.2171 145.513C75.4082 139.034 78.0097 132.313 81.0133 125.435C83.0676 129.364 85.2357 133.309 87.5152 137.258C89.7947 141.206 92.1276 145.056 94.503 148.8C87.0448 147.962 79.9231 146.854 73.2171 145.513ZM154.363 159.545C165.476 158.614 176.024 157.106 185.781 155.109C187.677 161.739 189.1 168.042 190.04 173.914C191.803 184.917 191.783 193.861 190.386 200.393C188.989 206.926 186.503 209.936 184.217 211.255C181.932 212.575 178.083 213.223 171.726 211.167C165.371 209.111 157.615 204.655 148.967 197.627C144.353 193.877 139.605 189.493 134.811 184.536C141.42 177.085 147.999 168.704 154.363 159.545ZM141.49 160.351C137.035 166.391 132.515 172.005 128 177.142C123.485 172.005 118.965 166.391 114.51 160.351C118.94 160.536 123.441 160.632 128 160.632C132.559 160.632 137.06 160.536 141.49 160.351ZM161.497 148.8C163.872 145.056 166.205 141.206 168.485 137.258C170.764 133.309 172.932 129.364 174.987 125.435C177.99 132.313 180.592 139.034 182.783 145.513C176.077 146.854 168.955 147.962 161.497 148.8ZM180.725 113.884C185.476 123.974 189.444 133.863 192.592 143.311C199.282 141.638 205.453 139.718 211.007 137.597C221.418 133.622 229.154 129.133 234.112 124.657C239.072 120.18 240.435 116.523 240.435 113.884C240.435 111.245 239.072 107.587 234.112 103.11C229.154 98.6344 221.418 94.1452 211.007 90.1702C205.453 88.0492 199.282 86.1298 192.592 84.4561C189.444 93.9046 185.476 103.793 180.725 113.884ZM174.987 102.333C177.99 95.4546 180.592 88.7331 182.783 82.2548C176.077 80.9132 168.955 79.8054 161.497 78.9676C163.872 82.7112 166.205 86.5615 168.485 90.5098C170.764 94.4581 172.932 98.4035 174.987 102.333Z";
|
20
20
|
const p1 = roundtrip(Skia, Skia.Path.MakeFromSVGString(svg1)!);
|
21
|
-
expect(p1.toSVGString()).
|
21
|
+
expect(p1.toSVGString()).toBeApproximatelyEqual(svg1);
|
22
22
|
|
23
23
|
const paint = Skia.Paint();
|
24
24
|
paint.setAntiAlias(true);
|
25
25
|
paint.setColor(Skia.Color("cyan"));
|
26
26
|
canvas.drawPath(p1, paint);
|
27
27
|
const p2 = roundtrip(Skia, Skia.Path.MakeFromSVGString(svg2)!);
|
28
|
-
expect(p2.toSVGString()).
|
28
|
+
expect(p2.toSVGString()).toBeApproximatelyEqual(svg2);
|
29
29
|
|
30
30
|
p2.setFillType(FillType.EvenOdd);
|
31
31
|
canvas.drawPath(p2, paint);
|
package/src/skia/web/Host.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { CanvasKit, EmbindEnumEntity
|
1
|
+
import type { CanvasKit, EmbindEnumEntity } from "canvaskit-wasm";
|
2
2
|
|
3
3
|
import type { SkJSIInstance } from "../types";
|
4
4
|
|
@@ -42,11 +42,28 @@ export abstract class HostObject<T, N extends string> extends BaseHostObject<
|
|
42
42
|
}
|
43
43
|
}
|
44
44
|
|
45
|
-
export const getEnum = (
|
46
|
-
|
45
|
+
export const getEnum = (
|
46
|
+
CanvasKit: CanvasKit,
|
47
|
+
name: keyof CanvasKit,
|
48
|
+
v: number
|
49
|
+
): EmbindEnumEntity => {
|
50
|
+
const e = CanvasKit[name];
|
51
|
+
if (typeof e !== "function") {
|
52
|
+
throw new Error(`${name} is not an number`);
|
53
|
+
}
|
54
|
+
const result = Object.values(e).find(({ value }) => value === v);
|
55
|
+
if (!result) {
|
56
|
+
throw new Error(
|
57
|
+
`Enum ${name} does not have value ${v} on React Native Web`
|
58
|
+
);
|
59
|
+
}
|
60
|
+
return result;
|
61
|
+
};
|
47
62
|
|
48
63
|
export const optEnum = (
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
64
|
+
CanvasKit: CanvasKit,
|
65
|
+
name: keyof CanvasKit,
|
66
|
+
v: number | undefined
|
67
|
+
): EmbindEnumEntity | undefined => {
|
68
|
+
return v === undefined ? undefined : getEnum(CanvasKit, name, v);
|
69
|
+
};
|
@@ -124,8 +124,8 @@ export class JsiSkCanvas
|
|
124
124
|
JsiSkImage.fromValue(img),
|
125
125
|
left,
|
126
126
|
top,
|
127
|
-
getEnum(this.CanvasKit
|
128
|
-
getEnum(this.CanvasKit
|
127
|
+
getEnum(this.CanvasKit, "FilterMode", fm),
|
128
|
+
getEnum(this.CanvasKit, "MipmapMode", mm),
|
129
129
|
paint ? JsiSkPaint.fromValue(paint) : paint
|
130
130
|
);
|
131
131
|
}
|
@@ -141,7 +141,7 @@ export class JsiSkCanvas
|
|
141
141
|
JsiSkImage.fromValue(img),
|
142
142
|
Array.from(JsiSkRect.fromValue(this.CanvasKit, center)),
|
143
143
|
JsiSkRect.fromValue(this.CanvasKit, dest),
|
144
|
-
getEnum(this.CanvasKit
|
144
|
+
getEnum(this.CanvasKit, "FilterMode", filter),
|
145
145
|
paint ? JsiSkPaint.fromValue(paint) : paint
|
146
146
|
);
|
147
147
|
}
|
@@ -176,8 +176,8 @@ export class JsiSkCanvas
|
|
176
176
|
JsiSkImage.fromValue(img),
|
177
177
|
JsiSkRect.fromValue(this.CanvasKit, src),
|
178
178
|
JsiSkRect.fromValue(this.CanvasKit, dest),
|
179
|
-
getEnum(this.CanvasKit
|
180
|
-
getEnum(this.CanvasKit
|
179
|
+
getEnum(this.CanvasKit, "FilterMode", fm),
|
180
|
+
getEnum(this.CanvasKit, "MipmapMode", mm),
|
181
181
|
paint ? JsiSkPaint.fromValue(paint) : paint
|
182
182
|
);
|
183
183
|
}
|
@@ -197,7 +197,7 @@ export class JsiSkCanvas
|
|
197
197
|
drawVertices(verts: SkVertices, mode: BlendMode, paint: SkPaint) {
|
198
198
|
this.ref.drawVertices(
|
199
199
|
JsiSkVertices.fromValue(verts),
|
200
|
-
getEnum(this.CanvasKit
|
200
|
+
getEnum(this.CanvasKit, "BlendMode", mode),
|
201
201
|
JsiSkPaint.fromValue(paint)
|
202
202
|
);
|
203
203
|
}
|
@@ -213,7 +213,7 @@ export class JsiSkCanvas
|
|
213
213
|
cubics.map(({ x, y }) => [x, y]).flat(),
|
214
214
|
colors,
|
215
215
|
texs ? texs.flatMap((p) => Array.from(JsiSkPoint.fromValue(p))) : texs,
|
216
|
-
mode ? getEnum(this.CanvasKit
|
216
|
+
mode ? getEnum(this.CanvasKit, "BlendMode", mode) : null,
|
217
217
|
paint ? JsiSkPaint.fromValue(paint) : undefined
|
218
218
|
);
|
219
219
|
}
|
@@ -224,7 +224,7 @@ export class JsiSkCanvas
|
|
224
224
|
|
225
225
|
drawPoints(mode: PointMode, points: SkPoint[], paint: SkPaint) {
|
226
226
|
this.ref.drawPoints(
|
227
|
-
getEnum(this.CanvasKit
|
227
|
+
getEnum(this.CanvasKit, "PointMode", mode),
|
228
228
|
points.map(({ x, y }) => [x, y]).flat(),
|
229
229
|
JsiSkPaint.fromValue(paint)
|
230
230
|
);
|
@@ -357,7 +357,7 @@ export class JsiSkCanvas
|
|
357
357
|
drawColor(color: SkColor, blendMode?: BlendMode) {
|
358
358
|
this.ref.drawColor(
|
359
359
|
color,
|
360
|
-
blendMode ? getEnum(this.CanvasKit
|
360
|
+
blendMode ? getEnum(this.CanvasKit, "BlendMode", blendMode) : undefined
|
361
361
|
);
|
362
362
|
}
|
363
363
|
|
@@ -368,7 +368,7 @@ export class JsiSkCanvas
|
|
368
368
|
clipPath(path: SkPath, op: ClipOp, doAntiAlias: boolean) {
|
369
369
|
this.ref.clipPath(
|
370
370
|
JsiSkPath.fromValue(path),
|
371
|
-
getEnum(this.CanvasKit
|
371
|
+
getEnum(this.CanvasKit, "PathOp", op),
|
372
372
|
doAntiAlias
|
373
373
|
);
|
374
374
|
}
|
@@ -376,7 +376,7 @@ export class JsiSkCanvas
|
|
376
376
|
clipRect(rect: SkRect, op: ClipOp, doAntiAlias: boolean) {
|
377
377
|
this.ref.clipRect(
|
378
378
|
JsiSkRect.fromValue(this.CanvasKit, rect),
|
379
|
-
getEnum(this.CanvasKit
|
379
|
+
getEnum(this.CanvasKit, "PathOp", op),
|
380
380
|
doAntiAlias
|
381
381
|
);
|
382
382
|
}
|
@@ -384,7 +384,7 @@ export class JsiSkCanvas
|
|
384
384
|
clipRRect(rrect: InputRRect, op: ClipOp, doAntiAlias: boolean) {
|
385
385
|
this.ref.clipRRect(
|
386
386
|
JsiSkRRect.fromValue(this.CanvasKit, rrect),
|
387
|
-
getEnum(this.CanvasKit
|
387
|
+
getEnum(this.CanvasKit, "PathOp", op),
|
388
388
|
doAntiAlias
|
389
389
|
);
|
390
390
|
}
|
@@ -426,9 +426,9 @@ export class JsiSkCanvas
|
|
426
426
|
ckSampling = sampling;
|
427
427
|
} else if (sampling) {
|
428
428
|
ckSampling = {
|
429
|
-
filter: getEnum(this.CanvasKit
|
429
|
+
filter: getEnum(this.CanvasKit, "FilterMode", sampling.filter),
|
430
430
|
mipmap: sampling.mipmap
|
431
|
-
? getEnum(this.CanvasKit
|
431
|
+
? getEnum(this.CanvasKit, "MipmapMode", sampling.mipmap)
|
432
432
|
: this.CanvasKit.MipmapMode.None,
|
433
433
|
};
|
434
434
|
}
|
@@ -438,7 +438,7 @@ export class JsiSkCanvas
|
|
438
438
|
dst,
|
439
439
|
JsiSkPaint.fromValue(paint),
|
440
440
|
blendMode
|
441
|
-
? getEnum(this.CanvasKit
|
441
|
+
? getEnum(this.CanvasKit, "BlendMode", blendMode)
|
442
442
|
: this.CanvasKit.BlendMode.DstOver,
|
443
443
|
cls,
|
444
444
|
ckSampling
|
@@ -450,8 +450,8 @@ export class JsiSkCanvas
|
|
450
450
|
width: imageInfo.width,
|
451
451
|
height: imageInfo.height,
|
452
452
|
colorSpace: this.CanvasKit.ColorSpace.SRGB,
|
453
|
-
alphaType: getEnum(this.CanvasKit
|
454
|
-
colorType: getEnum(this.CanvasKit
|
453
|
+
alphaType: getEnum(this.CanvasKit, "AlphaType", imageInfo.alphaType),
|
454
|
+
colorType: getEnum(this.CanvasKit, "ColorType", imageInfo.colorType),
|
455
455
|
};
|
456
456
|
return this.ref.readPixels(srcX, srcY, pxInfo);
|
457
457
|
}
|
@@ -100,7 +100,7 @@ export class JsiSkFont extends HostObject<Font, "Font"> implements SkFont {
|
|
100
100
|
}
|
101
101
|
|
102
102
|
setEdging(edging: FontEdging) {
|
103
|
-
this.ref.setEdging(getEnum(this.CanvasKit
|
103
|
+
this.ref.setEdging(getEnum(this.CanvasKit, "FontEdging", edging));
|
104
104
|
}
|
105
105
|
|
106
106
|
setEmbeddedBitmaps(embeddedBitmaps: boolean) {
|
@@ -108,7 +108,7 @@ export class JsiSkFont extends HostObject<Font, "Font"> implements SkFont {
|
|
108
108
|
}
|
109
109
|
|
110
110
|
setHinting(hinting: FontHinting) {
|
111
|
-
this.ref.setHinting(getEnum(this.CanvasKit
|
111
|
+
this.ref.setHinting(getEnum(this.CanvasKit, "FontHinting", hinting));
|
112
112
|
}
|
113
113
|
|
114
114
|
setLinearMetrics(linearMetrics: boolean) {
|
@@ -77,10 +77,10 @@ export class JsiSkImage extends HostObject<Image, "Image"> implements SkImage {
|
|
77
77
|
return new JsiSkShader(
|
78
78
|
this.CanvasKit,
|
79
79
|
this.ref.makeShaderOptions(
|
80
|
-
getEnum(this.CanvasKit
|
81
|
-
getEnum(this.CanvasKit
|
82
|
-
getEnum(this.CanvasKit
|
83
|
-
getEnum(this.CanvasKit
|
80
|
+
getEnum(this.CanvasKit, "TileMode", tx),
|
81
|
+
getEnum(this.CanvasKit, "TileMode", ty),
|
82
|
+
getEnum(this.CanvasKit, "FilterMode", fm),
|
83
|
+
getEnum(this.CanvasKit, "MipmapMode", mm),
|
84
84
|
localMatrix ? JsiSkMatrix.fromValue(localMatrix) : undefined
|
85
85
|
)
|
86
86
|
);
|
@@ -96,8 +96,8 @@ export class JsiSkImage extends HostObject<Image, "Image"> implements SkImage {
|
|
96
96
|
return new JsiSkShader(
|
97
97
|
this.CanvasKit,
|
98
98
|
this.ref.makeShaderCubic(
|
99
|
-
getEnum(this.CanvasKit
|
100
|
-
getEnum(this.CanvasKit
|
99
|
+
getEnum(this.CanvasKit, "TileMode", tx),
|
100
|
+
getEnum(this.CanvasKit, "TileMode", ty),
|
101
101
|
B,
|
102
102
|
C,
|
103
103
|
localMatrix ? JsiSkMatrix.fromValue(localMatrix) : undefined
|
@@ -109,11 +109,13 @@ export class JsiSkImage extends HostObject<Image, "Image"> implements SkImage {
|
|
109
109
|
let result: Uint8Array | null;
|
110
110
|
if (fmt && quality) {
|
111
111
|
result = this.ref.encodeToBytes(
|
112
|
-
getEnum(this.CanvasKit
|
112
|
+
getEnum(this.CanvasKit, "ImageFormat", fmt),
|
113
113
|
quality
|
114
114
|
);
|
115
115
|
} else if (fmt) {
|
116
|
-
result = this.ref.encodeToBytes(
|
116
|
+
result = this.ref.encodeToBytes(
|
117
|
+
getEnum(this.CanvasKit, "ImageFormat", fmt)
|
118
|
+
);
|
117
119
|
} else {
|
118
120
|
result = this.ref.encodeToBytes();
|
119
121
|
}
|
@@ -137,11 +139,13 @@ export class JsiSkImage extends HostObject<Image, "Image"> implements SkImage {
|
|
137
139
|
width: imageInfo?.width ?? info.width,
|
138
140
|
height: imageInfo?.height ?? info.height,
|
139
141
|
alphaType: getEnum(
|
140
|
-
this.CanvasKit
|
142
|
+
this.CanvasKit,
|
143
|
+
"AlphaType",
|
141
144
|
(imageInfo ?? info).alphaType
|
142
145
|
),
|
143
146
|
colorType: getEnum(
|
144
|
-
this.CanvasKit
|
147
|
+
this.CanvasKit,
|
148
|
+
"ColorType",
|
145
149
|
(imageInfo ?? info).colorType
|
146
150
|
),
|
147
151
|
};
|
@@ -83,9 +83,9 @@ export class JsiSkImageFactory extends Host implements ImageFactory {
|
|
83
83
|
// see toSkImageInfo() from canvaskit
|
84
84
|
const image = this.CanvasKit.MakeImage(
|
85
85
|
{
|
86
|
-
alphaType: getEnum(this.CanvasKit
|
86
|
+
alphaType: getEnum(this.CanvasKit, "AlphaType", info.alphaType),
|
87
87
|
colorSpace: this.CanvasKit.ColorSpace.SRGB,
|
88
|
-
colorType: getEnum(this.CanvasKit
|
88
|
+
colorType: getEnum(this.CanvasKit, "ColorType", info.colorType),
|
89
89
|
height: info.height,
|
90
90
|
width: info.width,
|
91
91
|
},
|
@@ -42,8 +42,8 @@ export class JsiSkImageFilterFactory
|
|
42
42
|
const inputFilter =
|
43
43
|
input === null ? null : JsiSkImageFilter.fromValue<ImageFilter>(input);
|
44
44
|
const filter = this.CanvasKit.ImageFilter.MakeDisplacementMap(
|
45
|
-
getEnum(this.CanvasKit
|
46
|
-
getEnum(this.CanvasKit
|
45
|
+
getEnum(this.CanvasKit, "ColorChannel", channelX),
|
46
|
+
getEnum(this.CanvasKit, "ColorChannel", channelY),
|
47
47
|
scale,
|
48
48
|
JsiSkImageFilter.fromValue(in1),
|
49
49
|
inputFilter
|
@@ -69,7 +69,7 @@ export class JsiSkImageFilterFactory
|
|
69
69
|
this.CanvasKit.ImageFilter.MakeBlur(
|
70
70
|
sigmaX,
|
71
71
|
sigmaY,
|
72
|
-
getEnum(this.CanvasKit
|
72
|
+
getEnum(this.CanvasKit, "TileMode", mode),
|
73
73
|
input === null ? null : JsiSkImageFilter.fromValue(input)
|
74
74
|
)
|
75
75
|
);
|
@@ -189,7 +189,7 @@ export class JsiSkImageFilterFactory
|
|
189
189
|
throwNotImplementedOnRNWeb<SkImageFilter>();
|
190
190
|
}
|
191
191
|
const filter = this.CanvasKit.ImageFilter.MakeBlend(
|
192
|
-
getEnum(this.CanvasKit
|
192
|
+
getEnum(this.CanvasKit, "BlendMode", mode),
|
193
193
|
JsiSkImageFilter.fromValue(background),
|
194
194
|
inputFilter
|
195
195
|
);
|
@@ -15,7 +15,7 @@ export class JsiSkMaskFilterFactory extends Host implements MaskFilterFactory {
|
|
15
15
|
return new JsiSkMaskFilter(
|
16
16
|
this.CanvasKit,
|
17
17
|
this.CanvasKit.MaskFilter.MakeBlur(
|
18
|
-
getEnum(this.CanvasKit
|
18
|
+
getEnum(this.CanvasKit, "BlurStyle", style),
|
19
19
|
sigma,
|
20
20
|
respectCTM
|
21
21
|
)
|
@@ -79,7 +79,7 @@ export class JsiSkPaint extends HostObject<Paint, "Paint"> implements SkPaint {
|
|
79
79
|
}
|
80
80
|
|
81
81
|
setBlendMode(blendMode: BlendMode) {
|
82
|
-
this.ref.setBlendMode(getEnum(this.CanvasKit
|
82
|
+
this.ref.setBlendMode(getEnum(this.CanvasKit, "BlendMode", blendMode));
|
83
83
|
}
|
84
84
|
|
85
85
|
setColor(color: SkColor) {
|
@@ -107,11 +107,11 @@ export class JsiSkPaint extends HostObject<Paint, "Paint"> implements SkPaint {
|
|
107
107
|
}
|
108
108
|
|
109
109
|
setStrokeCap(cap: StrokeCap) {
|
110
|
-
this.ref.setStrokeCap(getEnum(this.CanvasKit
|
110
|
+
this.ref.setStrokeCap(getEnum(this.CanvasKit, "StrokeCap", cap));
|
111
111
|
}
|
112
112
|
|
113
113
|
setStrokeJoin(join: StrokeJoin) {
|
114
|
-
this.ref.setStrokeJoin(getEnum(this.CanvasKit
|
114
|
+
this.ref.setStrokeJoin(getEnum(this.CanvasKit, "StrokeJoin", join));
|
115
115
|
}
|
116
116
|
|
117
117
|
setStrokeMiter(limit: number) {
|
@@ -150,7 +150,7 @@ export class JsiSkPath extends HostObject<Path, "Path"> implements SkPath {
|
|
150
150
|
}
|
151
151
|
|
152
152
|
setFillType(fill: FillType) {
|
153
|
-
this.ref.setFillType(getEnum(this.CanvasKit
|
153
|
+
this.ref.setFillType(getEnum(this.CanvasKit, "FillType", fill));
|
154
154
|
return this;
|
155
155
|
}
|
156
156
|
|
@@ -168,8 +168,8 @@ export class JsiSkPath extends HostObject<Path, "Path"> implements SkPath {
|
|
168
168
|
// eslint-disable-next-line camelcase
|
169
169
|
miter_limit: opts.width,
|
170
170
|
precision: opts.width,
|
171
|
-
join: optEnum(this.CanvasKit
|
172
|
-
cap: optEnum(this.CanvasKit
|
171
|
+
join: optEnum(this.CanvasKit, "StrokeJoin", opts.join),
|
172
|
+
cap: optEnum(this.CanvasKit, "StrokeCap", opts.cap),
|
173
173
|
}
|
174
174
|
);
|
175
175
|
return result === null ? result : this;
|
@@ -318,7 +318,7 @@ export class JsiSkPath extends HostObject<Path, "Path"> implements SkPath {
|
|
318
318
|
op(path: SkPath, op: PathOp) {
|
319
319
|
return this.ref.op(
|
320
320
|
JsiSkPath.fromValue(path),
|
321
|
-
getEnum(this.CanvasKit
|
321
|
+
getEnum(this.CanvasKit, "PathOp", op)
|
322
322
|
);
|
323
323
|
}
|
324
324
|
|
@@ -69,7 +69,7 @@ export class JsiSkPathEffectFactory extends Host implements PathEffectFactory {
|
|
69
69
|
JsiSkPath.fromValue(path),
|
70
70
|
advance,
|
71
71
|
phase,
|
72
|
-
getEnum(this.CanvasKit
|
72
|
+
getEnum(this.CanvasKit, "Path1DEffect", style)
|
73
73
|
);
|
74
74
|
if (pe === null) {
|
75
75
|
return null;
|
@@ -27,7 +27,7 @@ export class JsiSkPathFactory extends Host implements PathFactory {
|
|
27
27
|
const path = this.CanvasKit.Path.MakeFromOp(
|
28
28
|
JsiSkPath.fromValue(one),
|
29
29
|
JsiSkPath.fromValue(two),
|
30
|
-
getEnum(this.CanvasKit
|
30
|
+
getEnum(this.CanvasKit, "PathOp", op)
|
31
31
|
);
|
32
32
|
if (path === null) {
|
33
33
|
return null;
|
@@ -36,9 +36,9 @@ export class JsiSkPicture
|
|
36
36
|
return new JsiSkShader(
|
37
37
|
this.CanvasKit,
|
38
38
|
this.ref.makeShader(
|
39
|
-
getEnum(this.CanvasKit
|
40
|
-
getEnum(this.CanvasKit
|
41
|
-
getEnum(this.CanvasKit
|
39
|
+
getEnum(this.CanvasKit, "TileMode", tmx),
|
40
|
+
getEnum(this.CanvasKit, "TileMode", tmy),
|
41
|
+
getEnum(this.CanvasKit, "FilterMode", mode),
|
42
42
|
localMatrix ? JsiSkMatrix.fromValue(localMatrix) : undefined,
|
43
43
|
tileRect ? JsiSkRect.fromValue(this.CanvasKit, tileRect) : undefined
|
44
44
|
)
|
@@ -36,7 +36,7 @@ export class JsiSkShaderFactory extends Host implements ShaderFactory {
|
|
36
36
|
JsiSkPoint.fromValue(end),
|
37
37
|
colors,
|
38
38
|
pos,
|
39
|
-
getEnum(this.CanvasKit
|
39
|
+
getEnum(this.CanvasKit, "TileMode", mode),
|
40
40
|
localMatrix === undefined
|
41
41
|
? undefined
|
42
42
|
: JsiSkMatrix.fromValue(localMatrix),
|
@@ -61,7 +61,7 @@ export class JsiSkShaderFactory extends Host implements ShaderFactory {
|
|
61
61
|
radius,
|
62
62
|
colors,
|
63
63
|
pos,
|
64
|
-
getEnum(this.CanvasKit
|
64
|
+
getEnum(this.CanvasKit, "TileMode", mode),
|
65
65
|
localMatrix === undefined
|
66
66
|
? undefined
|
67
67
|
: JsiSkMatrix.fromValue(localMatrix),
|
@@ -90,7 +90,7 @@ export class JsiSkShaderFactory extends Host implements ShaderFactory {
|
|
90
90
|
endRadius,
|
91
91
|
colors,
|
92
92
|
pos,
|
93
|
-
getEnum(this.CanvasKit
|
93
|
+
getEnum(this.CanvasKit, "TileMode", mode),
|
94
94
|
localMatrix === undefined
|
95
95
|
? undefined
|
96
96
|
: JsiSkMatrix.fromValue(localMatrix),
|
@@ -117,7 +117,7 @@ export class JsiSkShaderFactory extends Host implements ShaderFactory {
|
|
117
117
|
cy,
|
118
118
|
colors,
|
119
119
|
pos,
|
120
|
-
getEnum(this.CanvasKit
|
120
|
+
getEnum(this.CanvasKit, "TileMode", mode),
|
121
121
|
localMatrix === undefined || localMatrix === null
|
122
122
|
? undefined
|
123
123
|
: JsiSkMatrix.fromValue(localMatrix),
|
@@ -174,7 +174,7 @@ export class JsiSkShaderFactory extends Host implements ShaderFactory {
|
|
174
174
|
return new JsiSkShader(
|
175
175
|
this.CanvasKit,
|
176
176
|
this.CanvasKit.Shader.MakeBlend(
|
177
|
-
getEnum(this.CanvasKit
|
177
|
+
getEnum(this.CanvasKit, "BlendMode", mode),
|
178
178
|
JsiSkShader.fromValue(one),
|
179
179
|
JsiSkShader.fromValue(two)
|
180
180
|
)
|
@@ -31,7 +31,7 @@ export const MakeVertices = (
|
|
31
31
|
new JsiSkVertices(
|
32
32
|
CanvasKit,
|
33
33
|
CanvasKit.MakeVertices(
|
34
|
-
getEnum(CanvasKit
|
34
|
+
getEnum(CanvasKit, "VertexMode", mode),
|
35
35
|
positions.map(({ x, y }) => [x, y]).flat(),
|
36
36
|
(textureCoordinates || []).map(({ x, y }) => [x, y]).flat(),
|
37
37
|
!colors ? null : colors.reduce((a, c) => concat(a, c)),
|
@@ -1,19 +0,0 @@
|
|
1
|
-
export declare enum ColorTypeCanvasKit {
|
2
|
-
Unknown = 0,// uninitialized
|
3
|
-
Alpha_8 = 1,// pixel with alpha in 8-bit byte
|
4
|
-
RGB_565 = 2,// pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word
|
5
|
-
ARGB_4444 = 3,// pixel with 4 bits for alpha, red, green, blue; in 16-bit word
|
6
|
-
RGBA_8888 = 4,// pixel with 8 bits for red, green, blue, alpha; in 32-bit word
|
7
|
-
RGB_888x = 5,// pixel with 8 bits each for red, green, blue; in 32-bit word
|
8
|
-
BGRA_8888 = 6,// pixel with 8 bits for blue, green, red, alpha; in 32-bit word
|
9
|
-
RGBA_1010102 = 7,// 10 bits for red, green, blue; 2 bits for alpha; in 32-bit word
|
10
|
-
BGRA_1010102 = 8,// 10 bits for blue, green, red; 2 bits for alpha; in 32-bit word
|
11
|
-
RGB_101010x = 9,// pixel with 10 bits each for red, green, blue; in 32-bit word
|
12
|
-
BGR_101010x = 10,// pixel with 10 bits each for blue, green, red; in 32-bit word
|
13
|
-
BGR_101010x_XR = 11,// pixel with 10 bits each for blue, green, red; in 32-bit word, extended range
|
14
|
-
RGBA_10x6 = 12,// pixel with 10 used bits (most significant) followed by 6 unused
|
15
|
-
Gray_8 = 13,// pixel with grayscale level in 8-bit byte
|
16
|
-
RGBA_F16Norm = 14,// pixel with half floats in [0,1] for red, green, blue, alpha; in 64-bit word
|
17
|
-
RGBA_F16 = 15,// pixel with half floats for red, green, blue, alpha; in 64-bit word
|
18
|
-
RGBA_F32 = 16
|
19
|
-
}
|
@@ -1,43 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.ColorTypeCanvasKit = void 0;
|
7
|
-
let ColorTypeCanvasKit = exports.ColorTypeCanvasKit = /*#__PURE__*/function (ColorTypeCanvasKit) {
|
8
|
-
ColorTypeCanvasKit[ColorTypeCanvasKit["Unknown"] = 0] = "Unknown";
|
9
|
-
// uninitialized
|
10
|
-
ColorTypeCanvasKit[ColorTypeCanvasKit["Alpha_8"] = 1] = "Alpha_8";
|
11
|
-
// pixel with alpha in 8-bit byte
|
12
|
-
ColorTypeCanvasKit[ColorTypeCanvasKit["RGB_565"] = 2] = "RGB_565";
|
13
|
-
// pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word
|
14
|
-
ColorTypeCanvasKit[ColorTypeCanvasKit["ARGB_4444"] = 3] = "ARGB_4444";
|
15
|
-
// pixel with 4 bits for alpha, red, green, blue; in 16-bit word
|
16
|
-
ColorTypeCanvasKit[ColorTypeCanvasKit["RGBA_8888"] = 4] = "RGBA_8888";
|
17
|
-
// pixel with 8 bits for red, green, blue, alpha; in 32-bit word
|
18
|
-
ColorTypeCanvasKit[ColorTypeCanvasKit["RGB_888x"] = 5] = "RGB_888x";
|
19
|
-
// pixel with 8 bits each for red, green, blue; in 32-bit word
|
20
|
-
ColorTypeCanvasKit[ColorTypeCanvasKit["BGRA_8888"] = 6] = "BGRA_8888";
|
21
|
-
// pixel with 8 bits for blue, green, red, alpha; in 32-bit word
|
22
|
-
ColorTypeCanvasKit[ColorTypeCanvasKit["RGBA_1010102"] = 7] = "RGBA_1010102";
|
23
|
-
// 10 bits for red, green, blue; 2 bits for alpha; in 32-bit word
|
24
|
-
ColorTypeCanvasKit[ColorTypeCanvasKit["BGRA_1010102"] = 8] = "BGRA_1010102";
|
25
|
-
// 10 bits for blue, green, red; 2 bits for alpha; in 32-bit word
|
26
|
-
ColorTypeCanvasKit[ColorTypeCanvasKit["RGB_101010x"] = 9] = "RGB_101010x";
|
27
|
-
// pixel with 10 bits each for red, green, blue; in 32-bit word
|
28
|
-
ColorTypeCanvasKit[ColorTypeCanvasKit["BGR_101010x"] = 10] = "BGR_101010x";
|
29
|
-
// pixel with 10 bits each for blue, green, red; in 32-bit word
|
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
|
32
|
-
ColorTypeCanvasKit[ColorTypeCanvasKit["RGBA_10x6"] = 12] = "RGBA_10x6";
|
33
|
-
// pixel with 10 used bits (most significant) followed by 6 unused
|
34
|
-
ColorTypeCanvasKit[ColorTypeCanvasKit["Gray_8"] = 13] = "Gray_8";
|
35
|
-
// pixel with grayscale level in 8-bit byte
|
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
|
38
|
-
ColorTypeCanvasKit[ColorTypeCanvasKit["RGBA_F16"] = 15] = "RGBA_F16";
|
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
|
41
|
-
return ColorTypeCanvasKit;
|
42
|
-
}({});
|
43
|
-
//# sourceMappingURL=ColorType.web.js.map
|
@@ -1 +0,0 @@
|
|
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":[]}
|
@@ -1,19 +0,0 @@
|
|
1
|
-
export declare enum ColorTypeCanvasKit {
|
2
|
-
Unknown = 0,// uninitialized
|
3
|
-
Alpha_8 = 1,// pixel with alpha in 8-bit byte
|
4
|
-
RGB_565 = 2,// pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word
|
5
|
-
ARGB_4444 = 3,// pixel with 4 bits for alpha, red, green, blue; in 16-bit word
|
6
|
-
RGBA_8888 = 4,// pixel with 8 bits for red, green, blue, alpha; in 32-bit word
|
7
|
-
RGB_888x = 5,// pixel with 8 bits each for red, green, blue; in 32-bit word
|
8
|
-
BGRA_8888 = 6,// pixel with 8 bits for blue, green, red, alpha; in 32-bit word
|
9
|
-
RGBA_1010102 = 7,// 10 bits for red, green, blue; 2 bits for alpha; in 32-bit word
|
10
|
-
BGRA_1010102 = 8,// 10 bits for blue, green, red; 2 bits for alpha; in 32-bit word
|
11
|
-
RGB_101010x = 9,// pixel with 10 bits each for red, green, blue; in 32-bit word
|
12
|
-
BGR_101010x = 10,// pixel with 10 bits each for blue, green, red; in 32-bit word
|
13
|
-
BGR_101010x_XR = 11,// pixel with 10 bits each for blue, green, red; in 32-bit word, extended range
|
14
|
-
RGBA_10x6 = 12,// pixel with 10 used bits (most significant) followed by 6 unused
|
15
|
-
Gray_8 = 13,// pixel with grayscale level in 8-bit byte
|
16
|
-
RGBA_F16Norm = 14,// pixel with half floats in [0,1] for red, green, blue, alpha; in 64-bit word
|
17
|
-
RGBA_F16 = 15,// pixel with half floats for red, green, blue, alpha; in 64-bit word
|
18
|
-
RGBA_F32 = 16
|
19
|
-
}
|