@shopify/react-native-skia 0.1.227 → 0.1.229
Sign up to get free protection for your applications and to get access to all the features.
- package/cpp/api/JsiSkCanvas.h +2 -1
- package/cpp/api/JsiSkMatrix.h +27 -11
- package/cpp/api/JsiSkTypeface.h +1 -0
- package/cpp/rnskia/dom/props/MatrixProp.h +14 -3
- package/lib/commonjs/dom/types/Common.d.ts +2 -2
- package/lib/commonjs/dom/types/Common.js.map +1 -1
- package/lib/commonjs/external/reanimated/interpolators.d.ts +1 -0
- package/lib/commonjs/external/reanimated/interpolators.js +16 -3
- package/lib/commonjs/external/reanimated/interpolators.js.map +1 -1
- package/lib/commonjs/external/reanimated/moduleWrapper.d.ts +2 -1
- package/lib/commonjs/external/reanimated/moduleWrapper.js +9 -7
- package/lib/commonjs/external/reanimated/moduleWrapper.js.map +1 -1
- package/lib/commonjs/renderer/Canvas.js +7 -13
- package/lib/commonjs/renderer/Canvas.js.map +1 -1
- package/lib/commonjs/skia/core/Vector.d.ts +0 -5
- package/lib/commonjs/skia/core/Vector.js +1 -17
- package/lib/commonjs/skia/core/Vector.js.map +1 -1
- package/lib/commonjs/skia/types/Canvas.d.ts +2 -2
- package/lib/commonjs/skia/types/Canvas.js.map +1 -1
- package/lib/commonjs/skia/types/Matrix.d.ts +3 -13
- package/lib/commonjs/skia/types/Matrix.js +1 -16
- package/lib/commonjs/skia/types/Matrix.js.map +1 -1
- package/lib/commonjs/skia/types/Matrix4.d.ts +60 -1
- package/lib/commonjs/skia/types/Matrix4.js +159 -14
- package/lib/commonjs/skia/types/Matrix4.js.map +1 -1
- package/lib/commonjs/skia/types/Path/Path.d.ts +2 -2
- package/lib/commonjs/skia/types/Path/Path.js.map +1 -1
- package/lib/commonjs/skia/web/Host.d.ts +2 -3
- package/lib/commonjs/skia/web/Host.js +4 -12
- package/lib/commonjs/skia/web/Host.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkCanvas.js +12 -12
- 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/JsiSkMatrix.d.ts +2 -2
- package/lib/commonjs/skia/web/JsiSkMatrix.js +6 -1
- package/lib/commonjs/skia/web/JsiSkMatrix.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 +3 -3
- package/lib/commonjs/skia/web/JsiSkVerticesFactory.js.map +1 -1
- package/lib/module/dom/types/Common.d.ts +2 -2
- package/lib/module/dom/types/Common.js.map +1 -1
- package/lib/module/external/reanimated/interpolators.d.ts +1 -0
- package/lib/module/external/reanimated/interpolators.js +14 -4
- package/lib/module/external/reanimated/interpolators.js.map +1 -1
- package/lib/module/external/reanimated/moduleWrapper.d.ts +2 -1
- package/lib/module/external/reanimated/moduleWrapper.js +7 -6
- package/lib/module/external/reanimated/moduleWrapper.js.map +1 -1
- package/lib/module/renderer/Canvas.js +7 -12
- package/lib/module/renderer/Canvas.js.map +1 -1
- package/lib/module/skia/core/Vector.d.ts +0 -5
- package/lib/module/skia/core/Vector.js +0 -13
- package/lib/module/skia/core/Vector.js.map +1 -1
- package/lib/module/skia/types/Canvas.d.ts +2 -2
- package/lib/module/skia/types/Canvas.js.map +1 -1
- package/lib/module/skia/types/Matrix.d.ts +3 -13
- package/lib/module/skia/types/Matrix.js +0 -14
- package/lib/module/skia/types/Matrix.js.map +1 -1
- package/lib/module/skia/types/Matrix4.d.ts +60 -1
- package/lib/module/skia/types/Matrix4.js +132 -18
- package/lib/module/skia/types/Matrix4.js.map +1 -1
- package/lib/module/skia/types/Path/Path.d.ts +2 -2
- package/lib/module/skia/types/Path/Path.js.map +1 -1
- package/lib/module/skia/web/Host.d.ts +2 -3
- package/lib/module/skia/web/Host.js +2 -7
- package/lib/module/skia/web/Host.js.map +1 -1
- package/lib/module/skia/web/JsiSkCanvas.js +13 -13
- package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/module/skia/web/JsiSkColorFilterFactory.js +2 -2
- package/lib/module/skia/web/JsiSkColorFilterFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkFont.js +3 -3
- package/lib/module/skia/web/JsiSkFont.js.map +1 -1
- package/lib/module/skia/web/JsiSkImage.js +7 -7
- package/lib/module/skia/web/JsiSkImage.js.map +1 -1
- package/lib/module/skia/web/JsiSkImageFactory.js +3 -3
- package/lib/module/skia/web/JsiSkImageFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkImageFilterFactory.js +4 -4
- package/lib/module/skia/web/JsiSkImageFilterFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkMaskFilterFactory.js +2 -2
- package/lib/module/skia/web/JsiSkMaskFilterFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkMatrix.d.ts +2 -2
- package/lib/module/skia/web/JsiSkMatrix.js +6 -1
- package/lib/module/skia/web/JsiSkMatrix.js.map +1 -1
- package/lib/module/skia/web/JsiSkPaint.js +4 -4
- package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
- package/lib/module/skia/web/JsiSkPath.js +5 -5
- package/lib/module/skia/web/JsiSkPath.js.map +1 -1
- package/lib/module/skia/web/JsiSkPathEffectFactory.js +2 -2
- package/lib/module/skia/web/JsiSkPathEffectFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkPathFactory.js +2 -2
- package/lib/module/skia/web/JsiSkPathFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkPicture.js +2 -2
- package/lib/module/skia/web/JsiSkPicture.js.map +1 -1
- package/lib/module/skia/web/JsiSkShaderFactory.js +6 -6
- package/lib/module/skia/web/JsiSkShaderFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkVerticesFactory.js +2 -2
- package/lib/module/skia/web/JsiSkVerticesFactory.js.map +1 -1
- package/lib/typescript/src/dom/types/Common.d.ts +2 -2
- package/lib/typescript/src/external/reanimated/interpolators.d.ts +1 -0
- package/lib/typescript/src/external/reanimated/moduleWrapper.d.ts +2 -1
- package/lib/typescript/src/skia/core/Vector.d.ts +0 -5
- package/lib/typescript/src/skia/types/Canvas.d.ts +2 -2
- package/lib/typescript/src/skia/types/Matrix.d.ts +3 -13
- package/lib/typescript/src/skia/types/Matrix4.d.ts +60 -1
- package/lib/typescript/src/skia/types/Path/Path.d.ts +2 -2
- package/lib/typescript/src/skia/web/Host.d.ts +2 -3
- package/lib/typescript/src/skia/web/JsiSkMatrix.d.ts +2 -2
- package/package.json +2 -1
- package/src/dom/types/Common.ts +2 -2
- package/src/external/reanimated/interpolators.ts +20 -5
- package/src/external/reanimated/moduleWrapper.ts +6 -0
- package/src/renderer/Canvas.tsx +6 -13
- package/src/skia/core/Vector.ts +0 -7
- package/src/skia/types/Canvas.ts +2 -2
- package/src/skia/types/Matrix.ts +4 -13
- package/src/skia/types/Matrix4.ts +190 -81
- package/src/skia/types/Path/Path.ts +2 -2
- package/src/skia/web/Host.ts +4 -3
- package/src/skia/web/JsiSkCanvas.ts +22 -15
- package/src/skia/web/JsiSkColorFilterFactory.ts +5 -2
- package/src/skia/web/JsiSkFont.ts +3 -3
- package/src/skia/web/JsiSkImage.ts +14 -11
- package/src/skia/web/JsiSkImageFactory.ts +3 -3
- package/src/skia/web/JsiSkImageFilterFactory.ts +5 -5
- package/src/skia/web/JsiSkMaskFilterFactory.ts +6 -2
- package/src/skia/web/JsiSkMatrix.ts +12 -3
- package/src/skia/web/JsiSkPaint.ts +4 -4
- package/src/skia/web/JsiSkPath.ts +8 -5
- package/src/skia/web/JsiSkPathEffectFactory.ts +2 -2
- package/src/skia/web/JsiSkPathFactory.ts +2 -2
- package/src/skia/web/JsiSkPicture.ts +4 -4
- package/src/skia/web/JsiSkShaderFactory.ts +6 -6
- package/src/skia/web/JsiSkVerticesFactory.ts +2 -2
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Host, NotImplementedOnRNWeb,
|
1
|
+
import { Host, NotImplementedOnRNWeb, getEnum } from "./Host";
|
2
2
|
import { JsiSkImageFilter } from "./JsiSkImageFilter";
|
3
3
|
import { JsiSkColorFilter } from "./JsiSkColorFilter";
|
4
4
|
export class JsiSkImageFilterFactory extends Host {
|
@@ -14,7 +14,7 @@ export class JsiSkImageFilterFactory extends Host {
|
|
14
14
|
|
15
15
|
MakeDisplacementMap(channelX, channelY, scale, in1, input) {
|
16
16
|
const inputFilter = input === null ? null : JsiSkImageFilter.fromValue(input);
|
17
|
-
const filter = this.CanvasKit.ImageFilter.MakeDisplacementMap(
|
17
|
+
const filter = this.CanvasKit.ImageFilter.MakeDisplacementMap(getEnum(this.CanvasKit.ColorChannel, channelX), getEnum(this.CanvasKit.ColorChannel, channelY), scale, JsiSkImageFilter.fromValue(in1), inputFilter);
|
18
18
|
return new JsiSkImageFilter(this.CanvasKit, filter);
|
19
19
|
}
|
20
20
|
|
@@ -24,7 +24,7 @@ export class JsiSkImageFilterFactory extends Host {
|
|
24
24
|
}
|
25
25
|
|
26
26
|
MakeBlur(sigmaX, sigmaY, mode, input) {
|
27
|
-
return new JsiSkImageFilter(this.CanvasKit, this.CanvasKit.ImageFilter.MakeBlur(sigmaX, sigmaY,
|
27
|
+
return new JsiSkImageFilter(this.CanvasKit, this.CanvasKit.ImageFilter.MakeBlur(sigmaX, sigmaY, getEnum(this.CanvasKit.TileMode, mode), input === null ? null : JsiSkImageFilter.fromValue(input)));
|
28
28
|
}
|
29
29
|
|
30
30
|
MakeColorFilter(cf, input) {
|
@@ -86,7 +86,7 @@ export class JsiSkImageFilterFactory extends Host {
|
|
86
86
|
throw new NotImplementedOnRNWeb("The cropRect argument is not yet supported on React Native Web.");
|
87
87
|
}
|
88
88
|
|
89
|
-
const filter = this.CanvasKit.ImageFilter.MakeBlend(
|
89
|
+
const filter = this.CanvasKit.ImageFilter.MakeBlend(getEnum(this.CanvasKit.BlendMode, mode), JsiSkImageFilter.fromValue(background), inputFilter);
|
90
90
|
return new JsiSkImageFilter(this.CanvasKit, filter);
|
91
91
|
}
|
92
92
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["Host","NotImplementedOnRNWeb","ckEnum","JsiSkImageFilter","JsiSkColorFilter","JsiSkImageFilterFactory","constructor","CanvasKit","MakeOffset","dx","dy","input","inputFilter","fromValue","filter","ImageFilter","MakeDisplacementMap","channelX","channelY","scale","in1","MakeShader","shader","_input","MakeBlur","sigmaX","sigmaY","mode","MakeColorFilter","cf","MakeCompose","outer","inner","MakeDropShadow","color","cropRect","MakeDropShadowOnly","MakeErode","rx","ry","MakeDilate","MakeBlend","background","foreground","MakeRuntimeShader","_builder","_childShaderName"],"sources":["JsiSkImageFilterFactory.ts"],"sourcesContent":["import type { CanvasKit, ImageFilter } from \"canvaskit-wasm\";\n\nimport type {\n ColorChannel,\n ImageFilterFactory,\n SkColor,\n SkColorFilter,\n SkImageFilter,\n BlendMode,\n SkRect,\n SkRuntimeShaderBuilder,\n SkShader,\n TileMode,\n} from \"../types\";\n\nimport { Host, NotImplementedOnRNWeb, ckEnum } from \"./Host\";\nimport { JsiSkImageFilter } from \"./JsiSkImageFilter\";\nimport { JsiSkColorFilter } from \"./JsiSkColorFilter\";\n\nexport class JsiSkImageFilterFactory\n extends Host\n implements ImageFilterFactory\n{\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeOffset(dx: number, dy: number, input: SkImageFilter | null) {\n const inputFilter =\n input === null ? null : JsiSkImageFilter.fromValue<ImageFilter>(input);\n const filter = this.CanvasKit.ImageFilter.MakeOffset(dx, dy, inputFilter);\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeDisplacementMap(\n channelX: ColorChannel,\n channelY: ColorChannel,\n scale: number,\n in1: SkImageFilter,\n input: SkImageFilter | null\n ): SkImageFilter {\n const inputFilter =\n input === null ? null : JsiSkImageFilter.fromValue<ImageFilter>(input);\n const filter = this.CanvasKit.ImageFilter.MakeDisplacementMap(\n ckEnum(channelX),\n ckEnum(channelY),\n scale,\n JsiSkImageFilter.fromValue(in1),\n inputFilter\n );\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeShader(shader: SkShader, _input: SkImageFilter | null): SkImageFilter {\n const filter = this.CanvasKit.ImageFilter.MakeShader(\n JsiSkImageFilter.fromValue(shader)\n );\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeBlur(\n sigmaX: number,\n sigmaY: number,\n mode: TileMode,\n input: SkImageFilter | null\n ) {\n return new JsiSkImageFilter(\n this.CanvasKit,\n this.CanvasKit.ImageFilter.MakeBlur(\n sigmaX,\n sigmaY,\n ckEnum(mode),\n input === null ? null : JsiSkImageFilter.fromValue(input)\n )\n );\n }\n\n MakeColorFilter(cf: SkColorFilter, input: SkImageFilter | null) {\n return new JsiSkImageFilter(\n this.CanvasKit,\n this.CanvasKit.ImageFilter.MakeColorFilter(\n JsiSkColorFilter.fromValue(cf),\n input === null ? null : JsiSkImageFilter.fromValue(input)\n )\n );\n }\n\n MakeCompose(outer: SkImageFilter | null, inner: SkImageFilter | null) {\n return new JsiSkImageFilter(\n this.CanvasKit,\n this.CanvasKit.ImageFilter.MakeCompose(\n outer === null ? null : JsiSkImageFilter.fromValue(outer),\n inner === null ? null : JsiSkImageFilter.fromValue(inner)\n )\n );\n }\n\n MakeDropShadow(\n dx: number,\n dy: number,\n sigmaX: number,\n sigmaY: number,\n color: SkColor,\n input: SkImageFilter | null,\n cropRect?: SkRect\n ): SkImageFilter {\n const inputFilter =\n input === null ? null : JsiSkImageFilter.fromValue<ImageFilter>(input);\n if (cropRect) {\n throw new NotImplementedOnRNWeb(\n \"The cropRect argument is not yet supported on React Native Web.\"\n );\n }\n const filter = this.CanvasKit.ImageFilter.MakeDropShadow(\n dx,\n dy,\n sigmaX,\n sigmaY,\n color,\n inputFilter\n );\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeDropShadowOnly(\n dx: number,\n dy: number,\n sigmaX: number,\n sigmaY: number,\n color: SkColor,\n input: SkImageFilter | null,\n cropRect?: SkRect\n ): SkImageFilter {\n const inputFilter =\n input === null ? null : JsiSkImageFilter.fromValue<ImageFilter>(input);\n if (cropRect) {\n throw new NotImplementedOnRNWeb(\n \"The cropRect argument is not yet supported on React Native Web.\"\n );\n }\n const filter = this.CanvasKit.ImageFilter.MakeDropShadowOnly(\n dx,\n dy,\n sigmaX,\n sigmaY,\n color,\n inputFilter\n );\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeErode(\n rx: number,\n ry: number,\n input: SkImageFilter | null,\n cropRect?: SkRect\n ): SkImageFilter {\n const inputFilter =\n input === null ? null : JsiSkImageFilter.fromValue<ImageFilter>(input);\n if (cropRect) {\n throw new NotImplementedOnRNWeb(\n \"The cropRect argument is not yet supported on React Native Web.\"\n );\n }\n const filter = this.CanvasKit.ImageFilter.MakeErode(rx, ry, inputFilter);\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeDilate(\n rx: number,\n ry: number,\n input: SkImageFilter | null,\n cropRect?: SkRect\n ): SkImageFilter {\n const inputFilter =\n input === null ? null : JsiSkImageFilter.fromValue<ImageFilter>(input);\n if (cropRect) {\n throw new NotImplementedOnRNWeb(\n \"The cropRect argument is not yet supported on React Native Web.\"\n );\n }\n const filter = this.CanvasKit.ImageFilter.MakeDilate(rx, ry, inputFilter);\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeBlend(\n mode: BlendMode,\n background: SkImageFilter,\n foreground: SkImageFilter | null,\n cropRect?: SkRect\n ): SkImageFilter {\n const inputFilter =\n foreground === null\n ? null\n : JsiSkImageFilter.fromValue<ImageFilter>(foreground);\n if (cropRect) {\n throw new NotImplementedOnRNWeb(\n \"The cropRect argument is not yet supported on React Native Web.\"\n );\n }\n const filter = this.CanvasKit.ImageFilter.MakeBlend(\n ckEnum(mode),\n JsiSkImageFilter.fromValue(background),\n inputFilter\n );\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeRuntimeShader(\n _builder: SkRuntimeShaderBuilder,\n _childShaderName: string | null,\n _input: SkImageFilter | null\n ): SkImageFilter {\n throw new NotImplementedOnRNWeb();\n }\n}\n"],"mappings":"AAeA,SAASA,IAAT,EAAeC,qBAAf,EAAsCC,MAAtC,QAAoD,QAApD;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AAEA,OAAO,MAAMC,uBAAN,SACGL,IADH,CAGP;EACEM,WAAW,CAACC,SAAD,EAAuB;IAChC,MAAMA,SAAN;EACD;;EAEDC,UAAU,CAACC,EAAD,EAAaC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EAKO;IACf,MAAMvB,WAAW,GACfD,KAAK,KAAK,IAAV,GAAiB,IAAjB,GAAwBR,gBAAgB,CAACU,SAAjB,CAAwCF,KAAxC,CAD1B;;IAEA,IAAIwB,QAAJ,EAAc;MACZ,MAAM,IAAIlC,qBAAJ,CACJ,iEADI,CAAN;IAGD;;IACD,MAAMa,MAAM,GAAG,KAAKP,SAAL,CAAeQ,WAAf,CAA2ByB,UAA3B,CAAsCF,EAAtC,EAA0CC,EAA1C,EAA8C3B,WAA9C,CAAf;IACA,OAAO,IAAIT,gBAAJ,CAAqB,KAAKI,SAA1B,EAAqCO,MAArC,CAAP;EACD;;EAED2B,SAAS,CACPd,IADO,EAEPe,UAFO,EAGPC,UAHO,EAIPR,QAJO,EAKQ;IACf,MAAMvB,WAAW,GACf+B,UAAU,KAAK,IAAf,GACI,IADJ,GAEIxC,gBAAgB,CAACU,SAAjB,CAAwC8B,UAAxC,CAHN;;IAIA,IAAIR,QAAJ,EAAc;MACZ,MAAM,IAAIlC,qBAAJ,CACJ,iEADI,CAAN;IAGD;;IACD,MAAMa,MAAM,GAAG,KAAKP,SAAL,CAAeQ,WAAf,CAA2B0B,SAA3B,CACbvC,MAAM,CAACyB,IAAD,CADO,EAEbxB,gBAAgB,CAACU,SAAjB,CAA2B6B,UAA3B,CAFa,EAGb9B,WAHa,CAAf;IAKA,OAAO,IAAIT,gBAAJ,CAAqB,KAAKI,SAA1B,EAAqCO,MAArC,CAAP;EACD;;EAED8B,iBAAiB,CACfC,QADe,EAEfC,gBAFe,EAGfvB,MAHe,EAIA;IACf,MAAM,IAAItB,qBAAJ,EAAN;EACD;;AAhMH"}
|
1
|
+
{"version":3,"names":["Host","NotImplementedOnRNWeb","getEnum","JsiSkImageFilter","JsiSkColorFilter","JsiSkImageFilterFactory","constructor","CanvasKit","MakeOffset","dx","dy","input","inputFilter","fromValue","filter","ImageFilter","MakeDisplacementMap","channelX","channelY","scale","in1","ColorChannel","MakeShader","shader","_input","MakeBlur","sigmaX","sigmaY","mode","TileMode","MakeColorFilter","cf","MakeCompose","outer","inner","MakeDropShadow","color","cropRect","MakeDropShadowOnly","MakeErode","rx","ry","MakeDilate","MakeBlend","background","foreground","BlendMode","MakeRuntimeShader","_builder","_childShaderName"],"sources":["JsiSkImageFilterFactory.ts"],"sourcesContent":["import type { CanvasKit, ImageFilter } from \"canvaskit-wasm\";\n\nimport type {\n ColorChannel,\n ImageFilterFactory,\n SkColor,\n SkColorFilter,\n SkImageFilter,\n BlendMode,\n SkRect,\n SkRuntimeShaderBuilder,\n SkShader,\n TileMode,\n} from \"../types\";\n\nimport { Host, NotImplementedOnRNWeb, getEnum } from \"./Host\";\nimport { JsiSkImageFilter } from \"./JsiSkImageFilter\";\nimport { JsiSkColorFilter } from \"./JsiSkColorFilter\";\n\nexport class JsiSkImageFilterFactory\n extends Host\n implements ImageFilterFactory\n{\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeOffset(dx: number, dy: number, input: SkImageFilter | null) {\n const inputFilter =\n input === null ? null : JsiSkImageFilter.fromValue<ImageFilter>(input);\n const filter = this.CanvasKit.ImageFilter.MakeOffset(dx, dy, inputFilter);\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeDisplacementMap(\n channelX: ColorChannel,\n channelY: ColorChannel,\n scale: number,\n in1: SkImageFilter,\n input: SkImageFilter | null\n ): SkImageFilter {\n const inputFilter =\n input === null ? null : JsiSkImageFilter.fromValue<ImageFilter>(input);\n const filter = this.CanvasKit.ImageFilter.MakeDisplacementMap(\n getEnum(this.CanvasKit.ColorChannel, channelX),\n getEnum(this.CanvasKit.ColorChannel, channelY),\n scale,\n JsiSkImageFilter.fromValue(in1),\n inputFilter\n );\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeShader(shader: SkShader, _input: SkImageFilter | null): SkImageFilter {\n const filter = this.CanvasKit.ImageFilter.MakeShader(\n JsiSkImageFilter.fromValue(shader)\n );\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeBlur(\n sigmaX: number,\n sigmaY: number,\n mode: TileMode,\n input: SkImageFilter | null\n ) {\n return new JsiSkImageFilter(\n this.CanvasKit,\n this.CanvasKit.ImageFilter.MakeBlur(\n sigmaX,\n sigmaY,\n getEnum(this.CanvasKit.TileMode, mode),\n input === null ? null : JsiSkImageFilter.fromValue(input)\n )\n );\n }\n\n MakeColorFilter(cf: SkColorFilter, input: SkImageFilter | null) {\n return new JsiSkImageFilter(\n this.CanvasKit,\n this.CanvasKit.ImageFilter.MakeColorFilter(\n JsiSkColorFilter.fromValue(cf),\n input === null ? null : JsiSkImageFilter.fromValue(input)\n )\n );\n }\n\n MakeCompose(outer: SkImageFilter | null, inner: SkImageFilter | null) {\n return new JsiSkImageFilter(\n this.CanvasKit,\n this.CanvasKit.ImageFilter.MakeCompose(\n outer === null ? null : JsiSkImageFilter.fromValue(outer),\n inner === null ? null : JsiSkImageFilter.fromValue(inner)\n )\n );\n }\n\n MakeDropShadow(\n dx: number,\n dy: number,\n sigmaX: number,\n sigmaY: number,\n color: SkColor,\n input: SkImageFilter | null,\n cropRect?: SkRect\n ): SkImageFilter {\n const inputFilter =\n input === null ? null : JsiSkImageFilter.fromValue<ImageFilter>(input);\n if (cropRect) {\n throw new NotImplementedOnRNWeb(\n \"The cropRect argument is not yet supported on React Native Web.\"\n );\n }\n const filter = this.CanvasKit.ImageFilter.MakeDropShadow(\n dx,\n dy,\n sigmaX,\n sigmaY,\n color,\n inputFilter\n );\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeDropShadowOnly(\n dx: number,\n dy: number,\n sigmaX: number,\n sigmaY: number,\n color: SkColor,\n input: SkImageFilter | null,\n cropRect?: SkRect\n ): SkImageFilter {\n const inputFilter =\n input === null ? null : JsiSkImageFilter.fromValue<ImageFilter>(input);\n if (cropRect) {\n throw new NotImplementedOnRNWeb(\n \"The cropRect argument is not yet supported on React Native Web.\"\n );\n }\n const filter = this.CanvasKit.ImageFilter.MakeDropShadowOnly(\n dx,\n dy,\n sigmaX,\n sigmaY,\n color,\n inputFilter\n );\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeErode(\n rx: number,\n ry: number,\n input: SkImageFilter | null,\n cropRect?: SkRect\n ): SkImageFilter {\n const inputFilter =\n input === null ? null : JsiSkImageFilter.fromValue<ImageFilter>(input);\n if (cropRect) {\n throw new NotImplementedOnRNWeb(\n \"The cropRect argument is not yet supported on React Native Web.\"\n );\n }\n const filter = this.CanvasKit.ImageFilter.MakeErode(rx, ry, inputFilter);\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeDilate(\n rx: number,\n ry: number,\n input: SkImageFilter | null,\n cropRect?: SkRect\n ): SkImageFilter {\n const inputFilter =\n input === null ? null : JsiSkImageFilter.fromValue<ImageFilter>(input);\n if (cropRect) {\n throw new NotImplementedOnRNWeb(\n \"The cropRect argument is not yet supported on React Native Web.\"\n );\n }\n const filter = this.CanvasKit.ImageFilter.MakeDilate(rx, ry, inputFilter);\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeBlend(\n mode: BlendMode,\n background: SkImageFilter,\n foreground: SkImageFilter | null,\n cropRect?: SkRect\n ): SkImageFilter {\n const inputFilter =\n foreground === null\n ? null\n : JsiSkImageFilter.fromValue<ImageFilter>(foreground);\n if (cropRect) {\n throw new NotImplementedOnRNWeb(\n \"The cropRect argument is not yet supported on React Native Web.\"\n );\n }\n const filter = this.CanvasKit.ImageFilter.MakeBlend(\n getEnum(this.CanvasKit.BlendMode, mode),\n JsiSkImageFilter.fromValue(background),\n inputFilter\n );\n return new JsiSkImageFilter(this.CanvasKit, filter);\n }\n\n MakeRuntimeShader(\n _builder: SkRuntimeShaderBuilder,\n _childShaderName: string | null,\n _input: SkImageFilter | null\n ): SkImageFilter {\n throw new NotImplementedOnRNWeb();\n }\n}\n"],"mappings":"AAeA,SAASA,IAAT,EAAeC,qBAAf,EAAsCC,OAAtC,QAAqD,QAArD;AACA,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EAAqCO,MAArC,CAAP;EACD;;EAEDiC,iBAAiB,CACfC,QADe,EAEfC,gBAFe,EAGfzB,MAHe,EAIA;IACf,MAAM,IAAIvB,qBAAJ,EAAN;EACD;;AAhMH"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Host,
|
1
|
+
import { Host, getEnum } from "./Host";
|
2
2
|
import { JsiSkMaskFilter } from "./JsiSkMaskFilter";
|
3
3
|
export class JsiSkMaskFilterFactory extends Host {
|
4
4
|
constructor(CanvasKit) {
|
@@ -6,7 +6,7 @@ export class JsiSkMaskFilterFactory extends Host {
|
|
6
6
|
}
|
7
7
|
|
8
8
|
MakeBlur(style, sigma, respectCTM) {
|
9
|
-
return new JsiSkMaskFilter(this.CanvasKit, this.CanvasKit.MaskFilter.MakeBlur(
|
9
|
+
return new JsiSkMaskFilter(this.CanvasKit, this.CanvasKit.MaskFilter.MakeBlur(getEnum(this.CanvasKit.BlurStyle, style), sigma, respectCTM));
|
10
10
|
}
|
11
11
|
|
12
12
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["Host","
|
1
|
+
{"version":3,"names":["Host","getEnum","JsiSkMaskFilter","JsiSkMaskFilterFactory","constructor","CanvasKit","MakeBlur","style","sigma","respectCTM","MaskFilter","BlurStyle"],"sources":["JsiSkMaskFilterFactory.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { BlurStyle } from \"../types\";\nimport type { MaskFilterFactory } from \"../types/MaskFilter\";\n\nimport { Host, getEnum } from \"./Host\";\nimport { JsiSkMaskFilter } from \"./JsiSkMaskFilter\";\n\nexport class JsiSkMaskFilterFactory extends Host implements MaskFilterFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeBlur(style: BlurStyle, sigma: number, respectCTM: boolean) {\n return new JsiSkMaskFilter(\n this.CanvasKit,\n this.CanvasKit.MaskFilter.MakeBlur(\n getEnum(this.CanvasKit.BlurStyle, style),\n sigma,\n respectCTM\n )\n );\n }\n}\n"],"mappings":"AAKA,SAASA,IAAT,EAAeC,OAAf,QAA8B,QAA9B;AACA,SAASC,eAAT,QAAgC,mBAAhC;AAEA,OAAO,MAAMC,sBAAN,SAAqCH,IAArC,CAAuE;EAC5EI,WAAW,CAACC,SAAD,EAAuB;IAChC,MAAMA,SAAN;EACD;;EAEDC,QAAQ,CAACC,KAAD,EAAmBC,KAAnB,EAAkCC,UAAlC,EAAuD;IAC7D,OAAO,IAAIP,eAAJ,CACL,KAAKG,SADA,EAEL,KAAKA,SAAL,CAAeK,UAAf,CAA0BJ,QAA1B,CACEL,OAAO,CAAC,KAAKI,SAAL,CAAeM,SAAhB,EAA2BJ,KAA3B,CADT,EAEEC,KAFF,EAGEC,UAHF,CAFK,CAAP;EAQD;;AAd2E"}
|
@@ -1,12 +1,12 @@
|
|
1
1
|
import type { CanvasKit, Matrix3x3 } from "canvaskit-wasm";
|
2
|
-
import type { SkMatrix } from "../types";
|
2
|
+
import type { SkMatrix, InputMatrix } from "../types";
|
3
3
|
import { HostObject } from "./Host";
|
4
4
|
export declare class JsiSkMatrix extends HostObject<Matrix3x3, "Matrix"> implements SkMatrix {
|
5
5
|
constructor(CanvasKit: CanvasKit, ref: Matrix3x3);
|
6
6
|
private preMultiply;
|
7
7
|
private postMultiply;
|
8
8
|
dispose: () => void;
|
9
|
-
concat(matrix:
|
9
|
+
concat(matrix: InputMatrix): this;
|
10
10
|
translate(x: number, y: number): this;
|
11
11
|
postTranslate(x: number, y: number): this;
|
12
12
|
scale(x: number, y?: number): this;
|
@@ -1,6 +1,10 @@
|
|
1
1
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
2
2
|
|
3
|
+
import { toMatrix3 } from "../types";
|
3
4
|
import { HostObject } from "./Host";
|
5
|
+
|
6
|
+
const isMatrixHostObject = obj => !Array.isArray(obj);
|
7
|
+
|
4
8
|
export class JsiSkMatrix extends HostObject {
|
5
9
|
constructor(CanvasKit, ref) {
|
6
10
|
super(CanvasKit, ref, "Matrix");
|
@@ -18,7 +22,8 @@ export class JsiSkMatrix extends HostObject {
|
|
18
22
|
}
|
19
23
|
|
20
24
|
concat(matrix) {
|
21
|
-
this.preMultiply(
|
25
|
+
this.preMultiply( // eslint-disable-next-line no-nested-ternary
|
26
|
+
isMatrixHostObject(matrix) ? JsiSkMatrix.fromValue(matrix) : matrix.length === 16 ? toMatrix3(matrix) : [...matrix]);
|
22
27
|
return this;
|
23
28
|
}
|
24
29
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["HostObject","JsiSkMatrix","constructor","CanvasKit","ref","preMultiply","matrix","set","Matrix","multiply","postMultiply","concat","
|
1
|
+
{"version":3,"names":["toMatrix3","HostObject","isMatrixHostObject","obj","Array","isArray","JsiSkMatrix","constructor","CanvasKit","ref","preMultiply","matrix","set","Matrix","multiply","postMultiply","concat","fromValue","length","translate","x","y","translated","postTranslate","scale","scaled","postScale","skew","skewed","postSkew","rotate","value","rotated","postRotate","identity","get","from"],"sources":["JsiSkMatrix.ts"],"sourcesContent":["import type { CanvasKit, Matrix3x3 } from \"canvaskit-wasm\";\n\nimport { toMatrix3 } from \"../types\";\nimport type { SkMatrix, InputMatrix, Matrix4 } from \"../types\";\n\nimport { HostObject } from \"./Host\";\n\nconst isMatrixHostObject = (obj: InputMatrix): obj is SkMatrix =>\n !Array.isArray(obj);\n\nexport class JsiSkMatrix\n extends HostObject<Matrix3x3, \"Matrix\">\n implements SkMatrix\n{\n constructor(CanvasKit: CanvasKit, ref: Matrix3x3) {\n super(CanvasKit, ref, \"Matrix\");\n }\n\n private preMultiply(matrix: number[]) {\n this.ref.set(this.CanvasKit.Matrix.multiply(this.ref, matrix));\n }\n\n private postMultiply(matrix: number[]) {\n this.ref.set(this.CanvasKit.Matrix.multiply(matrix, this.ref));\n }\n\n dispose = () => {\n // Do nothing - the matrix is represenetd by a Float32Array\n };\n\n concat(matrix: InputMatrix) {\n this.preMultiply(\n // eslint-disable-next-line no-nested-ternary\n isMatrixHostObject(matrix)\n ? JsiSkMatrix.fromValue(matrix)\n : matrix.length === 16\n ? toMatrix3(matrix as Matrix4)\n : [...matrix]\n );\n return this;\n }\n\n translate(x: number, y: number) {\n this.preMultiply(this.CanvasKit.Matrix.translated(x, y));\n return this;\n }\n\n postTranslate(x: number, y: number) {\n this.postMultiply(this.CanvasKit.Matrix.translated(x, y));\n return this;\n }\n\n scale(x: number, y?: number) {\n this.preMultiply(this.CanvasKit.Matrix.scaled(x, y ?? x));\n return this;\n }\n\n postScale(x: number, y?: number) {\n this.postMultiply(this.CanvasKit.Matrix.scaled(x, y ?? x));\n return this;\n }\n\n skew(x: number, y: number) {\n this.preMultiply(this.CanvasKit.Matrix.skewed(x, y));\n return this;\n }\n\n postSkew(x: number, y: number) {\n this.postMultiply(this.CanvasKit.Matrix.skewed(x, y));\n return this;\n }\n\n rotate(value: number) {\n this.preMultiply(this.CanvasKit.Matrix.rotated(value));\n return this;\n }\n\n postRotate(value: number) {\n this.postMultiply(this.CanvasKit.Matrix.rotated(value));\n return this;\n }\n\n identity() {\n this.ref.set(this.CanvasKit.Matrix.identity());\n return this;\n }\n\n get() {\n return Array.from(this.ref);\n }\n}\n"],"mappings":";;AAEA,SAASA,SAAT,QAA0B,UAA1B;AAGA,SAASC,UAAT,QAA2B,QAA3B;;AAEA,MAAMC,kBAAkB,GAAIC,GAAD,IACzB,CAACC,KAAK,CAACC,OAAN,CAAcF,GAAd,CADH;;AAGA,OAAO,MAAMG,WAAN,SACGL,UADH,CAGP;EACEM,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAuC;IAChD,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,QAAtB;;IADgD,iCAYxC,MAAM,CACd;IACD,CAdiD;EAEjD;;EAEOC,WAAW,CAACC,MAAD,EAAmB;IACpC,KAAKF,GAAL,CAASG,GAAT,CAAa,KAAKJ,SAAL,CAAeK,M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AAhC,cAAgCA,CAAhC,GAAqCD,CAArC,CAAlB;IACA,OAAO,IAAP;EACD;;EAEDO,IAAI,CAACP,CAAD,EAAYC,CAAZ,EAAuB;IACzB,KAAKX,WAAL,CAAiB,KAAKF,SAAL,CAAeK,MAAf,CAAsBe,MAAtB,CAA6BR,CAA7B,EAAgCC,CAAhC,CAAjB;IACA,OAAO,IAAP;EACD;;EAEDQ,QAAQ,CAACT,CAAD,EAAYC,CAAZ,EAAuB;IAC7B,KAAKN,YAAL,CAAkB,KAAKP,SAAL,CAAeK,MAAf,CAAsBe,MAAtB,CAA6BR,CAA7B,EAAgCC,CAAhC,CAAlB;IACA,OAAO,IAAP;EACD;;EAEDS,MAAM,CAACC,KAAD,EAAgB;IACpB,KAAKrB,WAAL,CAAiB,KAAKF,SAAL,CAAeK,MAAf,CAAsBmB,OAAtB,CAA8BD,KAA9B,CAAjB;IACA,OAAO,IAAP;EACD;;EAEDE,UAAU,CAACF,KAAD,EAAgB;IACxB,KAAKhB,YAAL,CAAkB,KAAKP,SAAL,CAAeK,MAAf,CAAsBmB,OAAtB,CAA8BD,KAA9B,CAAlB;IACA,OAAO,IAAP;EACD;;EAEDG,QAAQ,GAAG;IACT,KAAKzB,GAAL,CAASG,GAAT,CAAa,KAAKJ,SAAL,CAAeK,MAAf,CAAsBqB,QAAtB,EAAb;IACA,OAAO,IAAP;EACD;;EAEDC,GAAG,GAAG;IACJ,OAAO/B,KAAK,CAACgC,IAAN,CAAW,KAAK3B,GAAhB,CAAP;EACD;;AA5EH"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
2
2
|
|
3
|
-
import { HostObject,
|
3
|
+
import { HostObject, getEnum } from "./Host";
|
4
4
|
import { JsiSkColorFilter } from "./JsiSkColorFilter";
|
5
5
|
import { JsiSkImageFilter } from "./JsiSkImageFilter";
|
6
6
|
import { JsiSkMaskFilter } from "./JsiSkMaskFilter";
|
@@ -60,7 +60,7 @@ export class JsiSkPaint extends HostObject {
|
|
60
60
|
}
|
61
61
|
|
62
62
|
setBlendMode(blendMode) {
|
63
|
-
this.ref.setBlendMode(
|
63
|
+
this.ref.setBlendMode(getEnum(this.CanvasKit.BlendMode, blendMode));
|
64
64
|
}
|
65
65
|
|
66
66
|
setColor(color) {
|
@@ -88,11 +88,11 @@ export class JsiSkPaint extends HostObject {
|
|
88
88
|
}
|
89
89
|
|
90
90
|
setStrokeCap(cap) {
|
91
|
-
this.ref.setStrokeCap(
|
91
|
+
this.ref.setStrokeCap(getEnum(this.CanvasKit.StrokeCap, cap));
|
92
92
|
}
|
93
93
|
|
94
94
|
setStrokeJoin(join) {
|
95
|
-
this.ref.setStrokeJoin(
|
95
|
+
this.ref.setStrokeJoin(getEnum(this.CanvasKit.StrokeJoin, join));
|
96
96
|
}
|
97
97
|
|
98
98
|
setStrokeMiter(limit) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["HostObject","
|
1
|
+
{"version":3,"names":["HostObject","getEnum","JsiSkColorFilter","JsiSkImageFilter","JsiSkMaskFilter","JsiSkPathEffect","JsiSkShader","JsiSkPaint","constructor","CanvasKit","ref","delete","copy","reset","Paint","getAlphaf","getColor","getStrokeCap","value","getStrokeJoin","getStrokeMiter","getStrokeWidth","setAlphaf","alpha","setAntiAlias","aa","setDither","dither","setBlendMode","blendMode","BlendMode","setColor","color","setColorFilter","filter","fromValue","setImageFilter","setMaskFilter","setPathEffect","effect","setShader","shader","setStrokeCap","cap","StrokeCap","setStrokeJoin","join","StrokeJoin","setStrokeMiter","limit","setStrokeWidth","width","setStyle","style"],"sources":["JsiSkPaint.ts"],"sourcesContent":["import type { CanvasKit, Paint } from \"canvaskit-wasm\";\n\nimport type {\n StrokeJoin,\n BlendMode,\n SkColor,\n SkColorFilter,\n SkImageFilter,\n SkPaint,\n SkShader,\n StrokeCap,\n PaintStyle,\n SkMaskFilter,\n SkPathEffect,\n} from \"../types\";\n\nimport { HostObject, getEnum } from \"./Host\";\nimport { JsiSkColorFilter } from \"./JsiSkColorFilter\";\nimport { JsiSkImageFilter } from \"./JsiSkImageFilter\";\nimport { JsiSkMaskFilter } from \"./JsiSkMaskFilter\";\nimport { JsiSkPathEffect } from \"./JsiSkPathEffect\";\nimport { JsiSkShader } from \"./JsiSkShader\";\n\nexport class JsiSkPaint extends HostObject<Paint, \"Paint\"> implements SkPaint {\n constructor(CanvasKit: CanvasKit, ref: Paint) {\n super(CanvasKit, ref, \"Paint\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n copy() {\n return new JsiSkPaint(this.CanvasKit, this.ref.copy());\n }\n\n reset() {\n this.ref = new this.CanvasKit.Paint();\n }\n\n getAlphaf() {\n return this.getColor()[3];\n }\n\n getColor() {\n return this.ref.getColor();\n }\n\n getStrokeCap() {\n return this.ref.getStrokeCap().value;\n }\n\n getStrokeJoin() {\n return this.ref.getStrokeJoin().value;\n }\n\n getStrokeMiter() {\n return this.ref.getStrokeMiter();\n }\n\n getStrokeWidth() {\n return this.ref.getStrokeWidth();\n }\n\n setAlphaf(alpha: number) {\n this.ref.setAlphaf(alpha);\n }\n\n setAntiAlias(aa: boolean) {\n this.ref.setAntiAlias(aa);\n }\n\n setDither(dither: boolean) {\n this.ref.setDither(dither);\n }\n\n setBlendMode(blendMode: BlendMode) {\n this.ref.setBlendMode(getEnum(this.CanvasKit.BlendMode, blendMode));\n }\n\n setColor(color: SkColor) {\n this.ref.setColor(color);\n }\n\n setColorFilter(filter: SkColorFilter | null) {\n this.ref.setColorFilter(filter ? JsiSkColorFilter.fromValue(filter) : null);\n }\n\n setImageFilter(filter: SkImageFilter | null) {\n this.ref.setImageFilter(filter ? JsiSkImageFilter.fromValue(filter) : null);\n }\n\n setMaskFilter(filter: SkMaskFilter | null) {\n this.ref.setMaskFilter(filter ? JsiSkMaskFilter.fromValue(filter) : null);\n }\n\n setPathEffect(effect: SkPathEffect | null) {\n this.ref.setPathEffect(effect ? JsiSkPathEffect.fromValue(effect) : null);\n }\n\n setShader(shader: SkShader | null) {\n this.ref.setShader(shader ? JsiSkShader.fromValue(shader) : null);\n }\n\n setStrokeCap(cap: StrokeCap) {\n this.ref.setStrokeCap(getEnum(this.CanvasKit.StrokeCap, cap));\n }\n\n setStrokeJoin(join: StrokeJoin) {\n this.ref.setStrokeJoin(getEnum(this.CanvasKit.StrokeJoin, join));\n }\n\n setStrokeMiter(limit: number) {\n this.ref.setStrokeMiter(limit);\n }\n\n setStrokeWidth(width: number) {\n this.ref.setStrokeWidth(width);\n }\n\n setStyle(style: PaintStyle) {\n this.ref.setStyle({ value: style });\n }\n}\n"],"mappings":";;AAgBA,SAASA,UAAT,EAAqBC,OAArB,QAAoC,QAApC;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AACA,SAASC,eAAT,QAAgC,mBAAhC;AACA,SAASC,eAAT,QAAgC,mBAAhC;AACA,SAASC,WAAT,QAA4B,eAA5B;AAEA,OAAO,MAAMC,UAAN,SAAyBP,UAAzB,CAAuE;EAC5EQ,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAmC;IAC5C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,OAAtB;;IAD4C,iCAIpC,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CAN6C;EAE7C;;EAMDC,IAAI,GAAG;IACL,OAAO,IAAIL,UAAJ,CAAe,KAAKE,SAApB,EAA+B,KAAKC,GAAL,CAASE,IAAT,EAA/B,CAAP;EACD;;EAEDC,KAAK,GAAG;IACN,KAAKH,GAAL,GAAW,IAAI,KAAKD,SAAL,CAAeK,KAAnB,EAAX;EACD;;EAEDC,SAAS,GAAG;IACV,OAAO,KAAKC,QAAL,GAAgB,CAAhB,CAAP;EACD;;EAEDA,QAAQ,GAAG;IACT,OAAO,KAAKN,GAAL,CAASM,QAAT,EAAP;EACD;;EAEDC,Y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EACD;;EAEDI,aAAa,CAACC,MAAD,EAA8B;IACzC,KAAK7B,GAAL,CAAS4B,aAAT,CAAuBC,MAAM,GAAGlC,eAAe,CAAC8B,SAAhB,CAA0BI,MAA1B,CAAH,GAAuC,IAApE;EACD;;EAEDC,SAAS,CAACC,MAAD,EAA0B;IACjC,KAAK/B,GAAL,CAAS8B,SAAT,CAAmBC,MAAM,GAAGnC,WAAW,CAAC6B,SAAZ,CAAsBM,MAAtB,CAAH,GAAmC,IAA5D;EACD;;EAEDC,YAAY,CAACC,GAAD,EAAiB;IAC3B,KAAKjC,GAAL,CAASgC,YAAT,CAAsBzC,OAAO,CAAC,KAAKQ,SAAL,CAAemC,SAAhB,EAA2BD,GAA3B,CAA7B;EACD;;EAEDE,aAAa,CAACC,IAAD,EAAmB;IAC9B,KAAKpC,GAAL,CAASmC,aAAT,CAAuB5C,OAAO,CAAC,KAAKQ,SAAL,CAAesC,UAAhB,EAA4BD,IAA5B,CAA9B;EACD;;EAEDE,cAAc,CAACC,KAAD,EAAgB;IAC5B,KAAKvC,GAAL,CAASsC,cAAT,CAAwBC,KAAxB;EACD;;EAEDC,cAAc,CAACC,KAAD,EAAgB;IAC5B,KAAKzC,GAAL,CAASwC,cAAT,CAAwBC,KAAxB;EACD;;EAEDC,QAAQ,CAACC,KAAD,EAAoB;IAC1B,KAAK3C,GAAL,CAAS0C,QAAT,CAAkB;MAAElC,KAAK,EAAEmC;IAAT,CAAlB;EACD;;AAnG2E"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
2
2
|
|
3
3
|
import { PathVerb } from "../types";
|
4
|
-
import {
|
4
|
+
import { getEnum, HostObject, optEnum } from "./Host";
|
5
5
|
import { JsiSkPoint } from "./JsiSkPoint";
|
6
6
|
import { JsiSkRect } from "./JsiSkRect";
|
7
7
|
import { JsiSkRRect } from "./JsiSkRRect";
|
@@ -103,7 +103,7 @@ export class JsiSkPath extends HostObject {
|
|
103
103
|
}
|
104
104
|
|
105
105
|
setFillType(fill) {
|
106
|
-
this.ref.setFillType(
|
106
|
+
this.ref.setFillType(getEnum(this.CanvasKit.FillType, fill));
|
107
107
|
return this;
|
108
108
|
}
|
109
109
|
|
@@ -118,8 +118,8 @@ export class JsiSkPath extends HostObject {
|
|
118
118
|
// eslint-disable-next-line camelcase
|
119
119
|
miter_limit: opts.width,
|
120
120
|
precision: opts.width,
|
121
|
-
join: optEnum(opts.join),
|
122
|
-
cap: optEnum(opts.cap)
|
121
|
+
join: optEnum(this.CanvasKit.StrokeJoin, opts.join),
|
122
|
+
cap: optEnum(this.CanvasKit.StrokeCap, opts.cap)
|
123
123
|
});
|
124
124
|
return result === null ? result : this;
|
125
125
|
}
|
@@ -229,7 +229,7 @@ export class JsiSkPath extends HostObject {
|
|
229
229
|
}
|
230
230
|
|
231
231
|
op(path, op) {
|
232
|
-
return this.ref.op(JsiSkPath.fromValue(path),
|
232
|
+
return this.ref.op(JsiSkPath.fromValue(path), getEnum(this.CanvasKit.PathOp, op));
|
233
233
|
}
|
234
234
|
|
235
235
|
simplify() {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["PathVerb","ckEnum","HostObject","optEnum","JsiSkPoint","JsiSkRect","JsiSkRRect","JsiSkMatrix","CommandCount","Move","Line","Quad","Conic","Cubic","Close","pinT","t","Math","min","max","JsiSkPath","constructor","CanvasKit","ref","delete","addPath","src","matrix","extend","args","fromValue","addArc","oval","startAngleInDegrees","sweepAngleInDegrees","addOval","isCCW","startIndex","countPoints","addPoly","points","close","map","p","Array","from","flat","moveTo","x","y","lineTo","makeAsWinding","result","offset","dx","dy","rArcTo","rx","ry","xAxisRotateInDegrees","useSmallArc","rConicTo","dx1","dy1","dx2","dy2","w","rCubicTo","cpx1","cpy1","cpx2","cpy2","rMoveTo","rLineTo","rQuadTo","x1","y1","x2","y2","setFillType","fill","setIsVolatile","volatile","stroke","opts","undefined","width","miter_limit","precision","join","cap","reset","rewind","computeTightBounds","arcToOval","forceMoveTo","arcToRotated","arcToTangent","radius","conicTo","contains","copy","cubicTo","dash","on","off","phase","equals","other","getBounds","getFillType","value","quadTo","addRect","rect","addRRect","rrect","getPoint","index","isEmpty","isVolatile","addCircle","r","getLastPt","op","path","simplify","toSVGString","trim","start","stop","isComplement","startT","stopT","transform","m3","isArray","interpolate","end","output","Path","MakeFromPathInterpolation","isInterpolatable","path2","CanInterpolate","toCmds","cmds","reduce","acc","cmd","i","push","current","length"],"sources":["JsiSkPath.ts"],"sourcesContent":["import type { CanvasKit, Path } from \"canvaskit-wasm\";\n\nimport { PathVerb } from \"../types\";\nimport type {\n FillType,\n PathCommand,\n PathOp,\n SkMatrix,\n SkPath,\n SkPoint,\n SkRect,\n SkRRect,\n StrokeOpts,\n} from \"../types\";\n\nimport { ckEnum, HostObject, optEnum } from \"./Host\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { JsiSkRRect } from \"./JsiSkRRect\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\n\nconst CommandCount = {\n [PathVerb.Move]: 3,\n [PathVerb.Line]: 3,\n [PathVerb.Quad]: 5,\n [PathVerb.Conic]: 6,\n [PathVerb.Cubic]: 7,\n [PathVerb.Close]: 1,\n};\n\nconst pinT = (t: number) => Math.min(Math.max(t, 0), 1);\n\nexport class JsiSkPath extends HostObject<Path, \"Path\"> implements SkPath {\n constructor(CanvasKit: CanvasKit, ref: Path) {\n super(CanvasKit, ref, \"Path\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n addPath(src: SkPath, matrix?: SkMatrix, extend = false) {\n const args = [\n JsiSkPath.fromValue(src),\n ...(matrix ? JsiSkMatrix.fromValue<Float32Array>(matrix) : []),\n extend,\n ];\n this.ref.addPath(...args);\n return this;\n }\n\n addArc(\n oval: SkRect,\n startAngleInDegrees: number,\n sweepAngleInDegrees: number\n ) {\n this.ref.addArc(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n startAngleInDegrees,\n sweepAngleInDegrees\n );\n return this;\n }\n\n addOval(oval: SkRect, isCCW?: boolean, startIndex?: number) {\n this.ref.addOval(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n isCCW,\n startIndex\n );\n return this;\n }\n\n countPoints() {\n return this.ref.countPoints();\n }\n\n addPoly(points: SkPoint[], close: boolean) {\n this.ref.addPoly(\n points.map((p) => Array.from(JsiSkPoint.fromValue(p))).flat(),\n close\n );\n return this;\n }\n\n moveTo(x: number, y: number) {\n this.ref.moveTo(x, y);\n return this;\n }\n\n lineTo(x: number, y: number) {\n this.ref.lineTo(x, y);\n return this;\n }\n\n makeAsWinding() {\n const result = this.ref.makeAsWinding();\n return result === null ? result : this;\n }\n\n offset(dx: number, dy: number) {\n this.ref.offset(dx, dy);\n return this;\n }\n\n rArcTo(\n rx: number,\n ry: number,\n xAxisRotateInDegrees: number,\n useSmallArc: boolean,\n isCCW: boolean,\n dx: number,\n dy: number\n ) {\n this.ref.rArcTo(rx, ry, xAxisRotateInDegrees, useSmallArc, isCCW, dx, dy);\n return this;\n }\n\n rConicTo(dx1: number, dy1: number, dx2: number, dy2: number, w: number) {\n this.ref.rConicTo(dx1, dy1, dx2, dy2, w);\n return this;\n }\n\n rCubicTo(\n cpx1: number,\n cpy1: number,\n cpx2: number,\n cpy2: number,\n x: number,\n y: number\n ) {\n this.ref.rCubicTo(cpx1, cpy1, cpx2, cpy2, x, y);\n return this;\n }\n\n rMoveTo(x: number, y: number) {\n this.ref.rMoveTo(x, y);\n return this;\n }\n\n rLineTo(x: number, y: number) {\n this.ref.rLineTo(x, y);\n return this;\n }\n\n rQuadTo(x1: number, y1: number, x2: number, y2: number) {\n this.ref.rQuadTo(x1, y1, x2, y2);\n return this;\n }\n\n setFillType(fill: FillType) {\n this.ref.setFillType(ckEnum(fill));\n return this;\n }\n\n setIsVolatile(volatile: boolean) {\n this.ref.setIsVolatile(volatile);\n return this;\n }\n\n stroke(opts?: StrokeOpts) {\n const result = this.ref.stroke(\n opts === undefined\n ? undefined\n : {\n width: opts.width,\n // eslint-disable-next-line camelcase\n miter_limit: opts.width,\n precision: opts.width,\n join: optEnum(opts.join),\n cap: optEnum(opts.cap),\n }\n );\n return result === null ? result : this;\n }\n\n close() {\n this.ref.close();\n return this;\n }\n\n reset() {\n this.ref.reset();\n return this;\n }\n\n rewind() {\n this.ref.rewind();\n return this;\n }\n\n computeTightBounds(): SkRect {\n return new JsiSkRect(this.CanvasKit, this.ref.computeTightBounds());\n }\n\n arcToOval(\n oval: SkRect,\n startAngleInDegrees: number,\n sweepAngleInDegrees: number,\n forceMoveTo: boolean\n ) {\n this.ref.arcToOval(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n startAngleInDegrees,\n sweepAngleInDegrees,\n forceMoveTo\n );\n return this;\n }\n\n arcToRotated(\n rx: number,\n ry: number,\n xAxisRotateInDegrees: number,\n useSmallArc: boolean,\n isCCW: boolean,\n x: number,\n y: number\n ) {\n this.ref.arcToRotated(\n rx,\n ry,\n xAxisRotateInDegrees,\n useSmallArc,\n isCCW,\n x,\n y\n );\n return this;\n }\n\n arcToTangent(x1: number, y1: number, x2: number, y2: number, radius: number) {\n this.ref.arcToTangent(x1, y1, x2, y2, radius);\n return this;\n }\n\n conicTo(x1: number, y1: number, x2: number, y2: number, w: number) {\n this.ref.conicTo(x1, y1, x2, y2, w);\n return this;\n }\n\n contains(x: number, y: number) {\n return this.ref.contains(x, y);\n }\n\n copy() {\n return new JsiSkPath(this.CanvasKit, this.ref.copy());\n }\n\n cubicTo(\n cpx1: number,\n cpy1: number,\n cpx2: number,\n cpy2: number,\n x: number,\n y: number\n ) {\n this.ref.cubicTo(cpx1, cpy1, cpx2, cpy2, x, y);\n return this;\n }\n\n dash(on: number, off: number, phase: number) {\n return this.ref.dash(on, off, phase);\n }\n\n equals(other: SkPath) {\n return this.ref.equals(JsiSkPath.fromValue(other));\n }\n\n getBounds() {\n return new JsiSkRect(this.CanvasKit, this.ref.getBounds());\n }\n\n getFillType() {\n return this.ref.getFillType().value;\n }\n\n quadTo(x1: number, y1: number, x2: number, y2: number) {\n this.ref.quadTo(x1, y1, x2, y2);\n return this;\n }\n\n addRect(rect: SkRect, isCCW?: boolean) {\n this.ref.addRect(JsiSkRect.fromValue(this.CanvasKit, rect), isCCW);\n return this;\n }\n\n addRRect(rrect: SkRRect, isCCW?: boolean) {\n this.ref.addRRect(JsiSkRRect.fromValue(this.CanvasKit, rrect), isCCW);\n return this;\n }\n\n getPoint(index: number) {\n return new JsiSkPoint(this.CanvasKit, this.ref.getPoint(index));\n }\n\n isEmpty() {\n return this.ref.isEmpty();\n }\n\n isVolatile() {\n return this.ref.isVolatile();\n }\n\n addCircle(x: number, y: number, r: number) {\n this.ref.addCircle(x, y, r);\n return this;\n }\n\n getLastPt() {\n return new JsiSkPoint(\n this.CanvasKit,\n this.ref.getPoint(this.ref.countPoints() - 1)\n );\n }\n\n op(path: SkPath, op: PathOp) {\n return this.ref.op(JsiSkPath.fromValue(path), ckEnum(op));\n }\n\n simplify() {\n return this.ref.simplify();\n }\n\n toSVGString() {\n return this.ref.toSVGString();\n }\n\n trim(start: number, stop: number, isComplement: boolean) {\n const startT = pinT(start);\n const stopT = pinT(stop);\n if (startT === 0 && stopT === 1) {\n return this;\n }\n const result = this.ref.trim(startT, stopT, isComplement);\n return result === null ? result : this;\n }\n\n transform(m3: SkMatrix) {\n this.ref.transform(Array.isArray(m3) ? m3 : JsiSkMatrix.fromValue(m3));\n return this;\n }\n\n interpolate(end: SkPath, t: number, output?: SkPath) {\n const path = this.CanvasKit.Path.MakeFromPathInterpolation(\n this.ref,\n JsiSkPath.fromValue(end),\n t\n );\n if (path === null) {\n return null;\n }\n if (output) {\n (output as JsiSkPath).ref = path;\n return output;\n } else {\n return new JsiSkPath(this.CanvasKit, path);\n }\n }\n\n isInterpolatable(path2: SkPath): boolean {\n return this.CanvasKit.Path.CanInterpolate(\n this.ref,\n JsiSkPath.fromValue(path2)\n );\n }\n\n toCmds() {\n const cmds = this.ref.toCmds();\n const result = cmds.reduce<PathCommand[]>((acc, cmd, i) => {\n if (i === 0) {\n acc.push([]);\n }\n const current = acc[acc.length - 1];\n if (current.length === 0) {\n current.push(cmd);\n const length = CommandCount[current[0] as PathVerb];\n if (current.length === length && i !== cmds.length - 1) {\n acc.push([]);\n }\n } else {\n const length = CommandCount[current[0] as PathVerb];\n if (current.length < length) {\n current.push(cmd);\n }\n if (current.length === length && i !== cmds.length - 1) {\n acc.push([]);\n }\n }\n return acc;\n }, []);\n return result;\n }\n}\n"],"mappings":";;AAEA,SAASA,QAAT,QAAyB,UAAzB;AAaA,SAASC,MAAT,EAAiBC,UAAjB,EAA6BC,OAA7B,QAA4C,QAA5C;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,WAAT,QAA4B,eAA5B;AAEA,MAAMC,YAAY,GAAG;EACnB,CAACR,QAAQ,CAACS,IAAV,GAAiB,CADE;EAEnB,CAACT,QAAQ,CAACU,IAAV,GAAiB,CAFE;EAGnB,CAACV,QAAQ,CAACW,IAAV,GAAiB,CAHE;EAInB,CAACX,QAAQ,CAACY,KAAV,GAAkB,CAJC;EAKnB,CAACZ,QAAQ,CAACa,KAAV,GAAkB,CALC;EAMnB,CAACb,QAAQ,CAACc,KAAV,GAAkB;AANC,CAArB;;AASA,MAAMC,IAAI,GAAIC,CAAD,IAAeC,IAAI,CAACC,GAAL,CAASD,IAAI,CAACE,GAAL,CAASH,CAAT,EAAY,CAAZ,CAAT,EAAyB,CAAzB,CAA5B;;AAEA,OAAO,MAAMI,SAAN,SAAwBlB,UAAxB,CAAmE;EACxEmB,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAkC;IAC3C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,MAAtB;;IAD2C,iCAInC,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","JsiSkRect","JsiSkRRect","JsiSkMatrix","CommandCount","Move","Line","Quad","Conic","Cubic","Close","pinT","t","Math","min","max","JsiSkPath","constructor","CanvasKit","ref","delete","addPath","src","matrix","extend","args","fromValue","addArc","oval","startAngleInDegrees","sweepAngleInDegrees","addOval","isCCW","startIndex","countPoints","addPoly","points","close","map","p","Array","from","flat","moveTo","x","y","lineTo","makeAsWinding","result","offset","dx","dy","rArcTo","rx","ry","xAxisRotateInDegrees","useSmallArc","rConicTo","dx1","dy1","dx2","dy2","w","rCubicTo","cpx1","cpy1","cpx2","cpy2","rMoveTo","rLineTo","rQuadTo","x1","y1","x2","y2","setFillType","fill","FillType","setIsVolatile","volatile","stroke","opts","undefined","width","miter_limit","precision","join","StrokeJoin","cap","StrokeCap","reset","rewind","computeTightBounds","arcToOval","forceMoveTo","arcToRotated","arcToTangent","radius","conicTo","contains","copy","cubicTo","dash","on","off","phase","equals","other","getBounds","getFillType","value","quadTo","addRect","rect","addRRect","rrect","getPoint","index","isEmpty","isVolatile","addCircle","r","getLastPt","op","path","PathOp","simplify","toSVGString","trim","start","stop","isComplement","startT","stopT","transform","m3","isArray","interpolate","end","output","Path","MakeFromPathInterpolation","isInterpolatable","path2","CanInterpolate","toCmds","cmds","reduce","acc","cmd","i","push","current","length"],"sources":["JsiSkPath.ts"],"sourcesContent":["import type { CanvasKit, Path } from \"canvaskit-wasm\";\n\nimport { PathVerb } from \"../types\";\nimport type {\n FillType,\n PathCommand,\n PathOp,\n SkMatrix,\n SkPath,\n SkPoint,\n SkRect,\n SkRRect,\n StrokeOpts,\n} from \"../types\";\n\nimport { getEnum, HostObject, optEnum } from \"./Host\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { JsiSkRRect } from \"./JsiSkRRect\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\n\nconst CommandCount = {\n [PathVerb.Move]: 3,\n [PathVerb.Line]: 3,\n [PathVerb.Quad]: 5,\n [PathVerb.Conic]: 6,\n [PathVerb.Cubic]: 7,\n [PathVerb.Close]: 1,\n};\n\nconst pinT = (t: number) => Math.min(Math.max(t, 0), 1);\n\nexport class JsiSkPath extends HostObject<Path, \"Path\"> implements SkPath {\n constructor(CanvasKit: CanvasKit, ref: Path) {\n super(CanvasKit, ref, \"Path\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n addPath(src: SkPath, matrix?: SkMatrix, extend = false) {\n const args = [\n JsiSkPath.fromValue(src),\n ...(matrix ? JsiSkMatrix.fromValue<Float32Array>(matrix) : []),\n extend,\n ];\n this.ref.addPath(...args);\n return this;\n }\n\n addArc(\n oval: SkRect,\n startAngleInDegrees: number,\n sweepAngleInDegrees: number\n ) {\n this.ref.addArc(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n startAngleInDegrees,\n sweepAngleInDegrees\n );\n return this;\n }\n\n addOval(oval: SkRect, isCCW?: boolean, startIndex?: number) {\n this.ref.addOval(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n isCCW,\n startIndex\n );\n return this;\n }\n\n countPoints() {\n return this.ref.countPoints();\n }\n\n addPoly(points: SkPoint[], close: boolean) {\n this.ref.addPoly(\n points.map((p) => Array.from(JsiSkPoint.fromValue(p))).flat(),\n close\n );\n return this;\n }\n\n moveTo(x: number, y: number) {\n this.ref.moveTo(x, y);\n return this;\n }\n\n lineTo(x: number, y: number) {\n this.ref.lineTo(x, y);\n return this;\n }\n\n makeAsWinding() {\n const result = this.ref.makeAsWinding();\n return result === null ? result : this;\n }\n\n offset(dx: number, dy: number) {\n this.ref.offset(dx, dy);\n return this;\n }\n\n rArcTo(\n rx: number,\n ry: number,\n xAxisRotateInDegrees: number,\n useSmallArc: boolean,\n isCCW: boolean,\n dx: number,\n dy: number\n ) {\n this.ref.rArcTo(rx, ry, xAxisRotateInDegrees, useSmallArc, isCCW, dx, dy);\n return this;\n }\n\n rConicTo(dx1: number, dy1: number, dx2: number, dy2: number, w: number) {\n this.ref.rConicTo(dx1, dy1, dx2, dy2, w);\n return this;\n }\n\n rCubicTo(\n cpx1: number,\n cpy1: number,\n cpx2: number,\n cpy2: number,\n x: number,\n y: number\n ) {\n this.ref.rCubicTo(cpx1, cpy1, cpx2, cpy2, x, y);\n return this;\n }\n\n rMoveTo(x: number, y: number) {\n this.ref.rMoveTo(x, y);\n return this;\n }\n\n rLineTo(x: number, y: number) {\n this.ref.rLineTo(x, y);\n return this;\n }\n\n rQuadTo(x1: number, y1: number, x2: number, y2: number) {\n this.ref.rQuadTo(x1, y1, x2, y2);\n return this;\n }\n\n setFillType(fill: FillType) {\n this.ref.setFillType(getEnum(this.CanvasKit.FillType, fill));\n return this;\n }\n\n setIsVolatile(volatile: boolean) {\n this.ref.setIsVolatile(volatile);\n return this;\n }\n\n stroke(opts?: StrokeOpts) {\n const result = this.ref.stroke(\n opts === undefined\n ? undefined\n : {\n width: opts.width,\n // eslint-disable-next-line camelcase\n miter_limit: opts.width,\n precision: opts.width,\n join: optEnum(this.CanvasKit.StrokeJoin, opts.join),\n cap: optEnum(this.CanvasKit.StrokeCap, opts.cap),\n }\n );\n return result === null ? result : this;\n }\n\n close() {\n this.ref.close();\n return this;\n }\n\n reset() {\n this.ref.reset();\n return this;\n }\n\n rewind() {\n this.ref.rewind();\n return this;\n }\n\n computeTightBounds(): SkRect {\n return new JsiSkRect(this.CanvasKit, this.ref.computeTightBounds());\n }\n\n arcToOval(\n oval: SkRect,\n startAngleInDegrees: number,\n sweepAngleInDegrees: number,\n forceMoveTo: boolean\n ) {\n this.ref.arcToOval(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n startAngleInDegrees,\n sweepAngleInDegrees,\n forceMoveTo\n );\n return this;\n }\n\n arcToRotated(\n rx: number,\n ry: number,\n xAxisRotateInDegrees: number,\n useSmallArc: boolean,\n isCCW: boolean,\n x: number,\n y: number\n ) {\n this.ref.arcToRotated(\n rx,\n ry,\n xAxisRotateInDegrees,\n useSmallArc,\n isCCW,\n x,\n y\n );\n return this;\n }\n\n arcToTangent(x1: number, y1: number, x2: number, y2: number, radius: number) {\n this.ref.arcToTangent(x1, y1, x2, y2, radius);\n return this;\n }\n\n conicTo(x1: number, y1: number, x2: number, y2: number, w: number) {\n this.ref.conicTo(x1, y1, x2, y2, w);\n return this;\n }\n\n contains(x: number, y: number) {\n return this.ref.contains(x, y);\n }\n\n copy() {\n return new JsiSkPath(this.CanvasKit, this.ref.copy());\n }\n\n cubicTo(\n cpx1: number,\n cpy1: number,\n cpx2: number,\n cpy2: number,\n x: number,\n y: number\n ) {\n this.ref.cubicTo(cpx1, cpy1, cpx2, cpy2, x, y);\n return this;\n }\n\n dash(on: number, off: number, phase: number) {\n return this.ref.dash(on, off, phase);\n }\n\n equals(other: SkPath) {\n return this.ref.equals(JsiSkPath.fromValue(other));\n }\n\n getBounds() {\n return new JsiSkRect(this.CanvasKit, this.ref.getBounds());\n }\n\n getFillType() {\n return this.ref.getFillType().value;\n }\n\n quadTo(x1: number, y1: number, x2: number, y2: number) {\n this.ref.quadTo(x1, y1, x2, y2);\n return this;\n }\n\n addRect(rect: SkRect, isCCW?: boolean) {\n this.ref.addRect(JsiSkRect.fromValue(this.CanvasKit, rect), isCCW);\n return this;\n }\n\n addRRect(rrect: SkRRect, isCCW?: boolean) {\n this.ref.addRRect(JsiSkRRect.fromValue(this.CanvasKit, rrect), isCCW);\n return this;\n }\n\n getPoint(index: number) {\n return new JsiSkPoint(this.CanvasKit, this.ref.getPoint(index));\n }\n\n isEmpty() {\n return this.ref.isEmpty();\n }\n\n isVolatile() {\n return this.ref.isVolatile();\n }\n\n addCircle(x: number, y: number, r: number) {\n this.ref.addCircle(x, y, r);\n return this;\n }\n\n getLastPt() {\n return new JsiSkPoint(\n this.CanvasKit,\n this.ref.getPoint(this.ref.countPoints() - 1)\n );\n }\n\n op(path: SkPath, op: PathOp) {\n return this.ref.op(\n JsiSkPath.fromValue(path),\n getEnum(this.CanvasKit.PathOp, op)\n );\n }\n\n simplify() {\n return this.ref.simplify();\n }\n\n toSVGString() {\n return this.ref.toSVGString();\n }\n\n trim(start: number, stop: number, isComplement: boolean) {\n const startT = pinT(start);\n const stopT = pinT(stop);\n if (startT === 0 && stopT === 1) {\n return this;\n }\n const result = this.ref.trim(startT, stopT, isComplement);\n return result === null ? result : this;\n }\n\n transform(m3: SkMatrix) {\n this.ref.transform(Array.isArray(m3) ? m3 : JsiSkMatrix.fromValue(m3));\n return this;\n }\n\n interpolate(end: SkPath, t: number, output?: SkPath) {\n const path = this.CanvasKit.Path.MakeFromPathInterpolation(\n this.ref,\n JsiSkPath.fromValue(end),\n t\n );\n if (path === null) {\n return null;\n }\n if (output) {\n (output as JsiSkPath).ref = path;\n return output;\n } else {\n return new JsiSkPath(this.CanvasKit, path);\n }\n }\n\n isInterpolatable(path2: SkPath): boolean {\n return this.CanvasKit.Path.CanInterpolate(\n this.ref,\n JsiSkPath.fromValue(path2)\n );\n }\n\n toCmds() {\n const cmds = this.ref.toCmds();\n const result = cmds.reduce<PathCommand[]>((acc, cmd, i) => {\n if (i === 0) {\n acc.push([]);\n }\n const current = acc[acc.length - 1];\n if (current.length === 0) {\n current.push(cmd);\n const length = CommandCount[current[0] as PathVerb];\n if (current.length === length && i !== cmds.length - 1) {\n acc.push([]);\n }\n } else {\n const length = CommandCount[current[0] as PathVerb];\n if (current.length < length) {\n current.push(cmd);\n }\n if (current.length === length && i !== cmds.length - 1) {\n acc.push([]);\n }\n }\n return acc;\n }, []);\n return result;\n }\n}\n"],"mappings":";;AAEA,SAASA,QAAT,QAAyB,UAAzB;AAaA,SAASC,OAAT,EAAkBC,UAAlB,EAA8BC,OAA9B,QAA6C,QAA7C;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,WAAT,QAA4B,eAA5B;AAEA,MAAMC,YAAY,GAAG;EACnB,CAACR,QAAQ,CAACS,IAAV,GAAiB,CADE;EAEnB,CAACT,QA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J,OAAO,CAAC,CAAD,CAAR,CAA3B;;QACA,IAAIA,OAAO,CAACC,MAAR,KAAmBA,MAAnB,IAA6BH,CAAC,KAAKJ,IAAI,CAACO,MAAL,GAAc,CAArD,EAAwD;UACtDL,GAAG,CAACG,IAAJ,CAAS,EAAT;QACD;MACF,CAND,MAMO;QACL,MAAME,MAAM,GAAGrJ,YAAY,CAACoJ,OAAO,CAAC,CAAD,CAAR,CAA3B;;QACA,IAAIA,OAAO,CAACC,MAAR,GAAiBA,MAArB,EAA6B;UAC3BD,OAAO,CAACD,IAAR,CAAaF,GAAb;QACD;;QACD,IAAIG,OAAO,CAACC,MAAR,KAAmBA,MAAnB,IAA6BH,CAAC,KAAKJ,IAAI,CAACO,MAAL,GAAc,CAArD,EAAwD;UACtDL,GAAG,CAACG,IAAJ,CAAS,EAAT;QACD;MACF;;MACD,OAAOH,GAAP;IACD,CArBc,EAqBZ,EArBY,CAAf;IAsBA,OAAOpG,MAAP;EACD;;AA3WuE"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { getEnum, Host, NotImplementedOnRNWeb } from "./Host";
|
2
2
|
import { JsiSkMatrix } from "./JsiSkMatrix";
|
3
3
|
import { JsiSkPath } from "./JsiSkPath";
|
4
4
|
import { JsiSkPathEffect } from "./JsiSkPathEffect";
|
@@ -46,7 +46,7 @@ export class JsiSkPathEffectFactory extends Host {
|
|
46
46
|
}
|
47
47
|
|
48
48
|
MakePath1D(path, advance, phase, style) {
|
49
|
-
const pe = this.CanvasKit.PathEffect.MakePath1D(JsiSkPath.fromValue(path), advance, phase,
|
49
|
+
const pe = this.CanvasKit.PathEffect.MakePath1D(JsiSkPath.fromValue(path), advance, phase, getEnum(this.CanvasKit.Path1DEffect, style));
|
50
50
|
|
51
51
|
if (pe === null) {
|
52
52
|
return null;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
1
|
+
{"version":3,"names":["getEnum","Host","NotImplementedOnRNWeb","JsiSkMatrix","JsiSkPath","JsiSkPathEffect","JsiSkPathEffectFactory","constructor","CanvasKit","MakeCorner","radius","pe","PathEffect","MakeDash","intervals","phase","MakeDiscrete","segLength","dev","seedAssist","MakeCompose","_outer","_inner","MakeSum","MakeLine2D","width","matrix","fromValue","MakePath1D","path","advance","style","Path1DEffect","MakePath2D"],"sources":["JsiSkPathEffectFactory.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n Path1DEffectStyle,\n PathEffectFactory,\n SkMatrix,\n SkPath,\n SkPathEffect,\n} from \"../types\";\n\nimport { getEnum, Host, NotImplementedOnRNWeb } from \"./Host\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkPath } from \"./JsiSkPath\";\nimport { JsiSkPathEffect } from \"./JsiSkPathEffect\";\n\nexport class JsiSkPathEffectFactory extends Host implements PathEffectFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeCorner(radius: number) {\n const pe = this.CanvasKit.PathEffect.MakeCorner(radius);\n if (pe === null) {\n return null;\n }\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n\n MakeDash(intervals: number[], phase?: number) {\n const pe = this.CanvasKit.PathEffect.MakeDash(intervals, phase);\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n\n MakeDiscrete(segLength: number, dev: number, seedAssist: number) {\n const pe = this.CanvasKit.PathEffect.MakeDiscrete(\n segLength,\n dev,\n seedAssist\n );\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n\n MakeCompose(_outer: SkPathEffect, _inner: SkPathEffect): SkPathEffect {\n throw new NotImplementedOnRNWeb();\n }\n\n MakeSum(_outer: SkPathEffect, _inner: SkPathEffect): SkPathEffect {\n throw new NotImplementedOnRNWeb();\n }\n\n MakeLine2D(width: number, matrix: SkMatrix) {\n const pe = this.CanvasKit.PathEffect.MakeLine2D(\n width,\n JsiSkMatrix.fromValue(matrix)\n );\n if (pe === null) {\n return null;\n }\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n\n MakePath1D(\n path: SkPath,\n advance: number,\n phase: number,\n style: Path1DEffectStyle\n ) {\n const pe = this.CanvasKit.PathEffect.MakePath1D(\n JsiSkPath.fromValue(path),\n advance,\n phase,\n getEnum(this.CanvasKit.Path1DEffect, style)\n );\n if (pe === null) {\n return null;\n }\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n\n MakePath2D(matrix: SkMatrix, path: SkPath) {\n const pe = this.CanvasKit.PathEffect.MakePath2D(\n JsiSkMatrix.fromValue(matrix),\n JsiSkPath.fromValue(path)\n );\n if (pe === null) {\n return null;\n }\n return new JsiSkPathEffect(this.CanvasKit, pe);\n }\n}\n"],"mappings":"AAUA,SAASA,OAAT,EAAkBC,IAAlB,EAAwBC,qBAAxB,QAAqD,QAArD;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,eAAT,QAAgC,mBAAhC;AAEA,OAAO,MAAMC,sBAAN,SAAqCL,IAArC,CAAuE;EAC5EM,WAAW,CAACC,SAAD,EAAuB;IAChC,MAAMA,SAAN;EACD;;EAEDC,UAAU,CAACC,MAAD,EAAiB;IACzB,MAAMC,EAAE,GAAG,KAAKH,SAAL,CAAeI,UAAf,CAA0BH,UAA1B,CAAqCC,MAArC,CAAX;;IACA,IAAIC,EAAE,KAAK,IAAX,EAAiB;MACf,OAAO,IAAP;IACD;;IACD,OAAO,IAAIN,eAAJ,CAAoB,KAAKG,SAAzB,EAAoCG,EAApC,CAAP;EACD;;EAEDE,QAAQ,CAACC,SAAD,EAAsBC,KAAtB,EAAsC;IAC5C,MAAMJ,EAAE,GAAG,KAAKH,SAAL,CAAeI,UAAf,CAA0BC,QAA1B,CAAmCC,SAAnC,EAA8CC,KAA9C,CAAX;IACA,OAAO,IAAIV,eAAJ,CAAoB,KAAKG,SAAzB,EAAoCG,EAApC,CAAP;EACD;;EAEDK,YAAY,CAACC,SAAD,EAAoBC,GAAp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UAAf,CAA0BqB,UAA1B,CACT9B,WAAW,CAACwB,SAAZ,CAAsBD,MAAtB,CADS,EAETtB,SAAS,CAACuB,SAAV,CAAoBE,IAApB,CAFS,CAAX;;IAIA,IAAIlB,EAAE,KAAK,IAAX,EAAiB;MACf,OAAO,IAAP;IACD;;IACD,OAAO,IAAIN,eAAJ,CAAoB,KAAKG,SAAzB,EAAoCG,EAApC,CAAP;EACD;;AAzE2E"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Host,
|
1
|
+
import { Host, getEnum, NotImplementedOnRNWeb } from "./Host";
|
2
2
|
import { JsiSkPath } from "./JsiSkPath";
|
3
3
|
export class JsiSkPathFactory extends Host {
|
4
4
|
constructor(CanvasKit) {
|
@@ -20,7 +20,7 @@ export class JsiSkPathFactory extends Host {
|
|
20
20
|
}
|
21
21
|
|
22
22
|
MakeFromOp(one, two, op) {
|
23
|
-
const path = this.CanvasKit.Path.MakeFromOp(JsiSkPath.fromValue(one), JsiSkPath.fromValue(two),
|
23
|
+
const path = this.CanvasKit.Path.MakeFromOp(JsiSkPath.fromValue(one), JsiSkPath.fromValue(two), getEnum(this.CanvasKit.PathOp, op));
|
24
24
|
|
25
25
|
if (path === null) {
|
26
26
|
return null;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["Host","
|
1
|
+
{"version":3,"names":["Host","getEnum","NotImplementedOnRNWeb","JsiSkPath","JsiSkPathFactory","constructor","CanvasKit","Make","Path","MakeFromSVGString","str","path","MakeFromOp","one","two","op","fromValue","PathOp","MakeFromCmds","cmds","flat","MakeFromText","_text","_x","_y","_font"],"sources":["JsiSkPathFactory.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { PathCommand, PathOp, SkFont, SkPath } from \"../types\";\nimport type { PathFactory } from \"../types/Path/PathFactory\";\n\nimport { Host, getEnum, NotImplementedOnRNWeb } from \"./Host\";\nimport { JsiSkPath } from \"./JsiSkPath\";\n\nexport class JsiSkPathFactory extends Host implements PathFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n Make() {\n return new JsiSkPath(this.CanvasKit, new this.CanvasKit.Path());\n }\n\n MakeFromSVGString(str: string) {\n const path = this.CanvasKit.Path.MakeFromSVGString(str);\n if (path === null) {\n return null;\n }\n return new JsiSkPath(this.CanvasKit, path);\n }\n\n MakeFromOp(one: SkPath, two: SkPath, op: PathOp) {\n const path = this.CanvasKit.Path.MakeFromOp(\n JsiSkPath.fromValue(one),\n JsiSkPath.fromValue(two),\n getEnum(this.CanvasKit.PathOp, op)\n );\n if (path === null) {\n return null;\n }\n return new JsiSkPath(this.CanvasKit, path);\n }\n\n MakeFromCmds(cmds: PathCommand[]) {\n const path = this.CanvasKit.Path.MakeFromCmds(cmds.flat());\n if (path === null) {\n return null;\n }\n return new JsiSkPath(this.CanvasKit, path);\n }\n\n MakeFromText(\n _text: string,\n _x: number,\n _y: number,\n _font: SkFont\n ): SkPath | null {\n throw new NotImplementedOnRNWeb();\n }\n}\n"],"mappings":"AAKA,SAASA,IAAT,EAAeC,OAAf,EAAwBC,qBAAxB,QAAqD,QAArD;AACA,SAASC,SAAT,QAA0B,aAA1B;AAEA,OAAO,MAAMC,gBAAN,SAA+BJ,IAA/B,CAA2D;EAChEK,WAAW,CAACC,SAAD,EAAuB;IAChC,MAAMA,SAAN;EACD;;EAEDC,IAAI,GAAG;IACL,OAAO,IAAIJ,SAAJ,CAAc,KAAKG,SAAnB,EAA8B,IAAI,KAAKA,SAAL,CAAeE,IAAnB,EAA9B,CAAP;EACD;;EAEDC,iBAAiB,CAACC,GAAD,EAAc;IAC7B,MAAMC,IAAI,GAAG,KAAKL,SAAL,CAAeE,IAAf,CAAoBC,iBAApB,CAAsCC,GAAtC,CAAb;;IACA,IAAIC,IAAI,KAAK,IAAb,EAAmB;MACjB,OAAO,IAAP;IACD;;IACD,OAAO,IAAIR,SAAJ,CAAc,KAAKG,SAAnB,EAA8BK,IAA9B,CAAP;EACD;;EAEDC,UAAU,CAACC,GAAD,EAAcC,GAAd,EAA2BC,EAA3B,EAAuC;IAC/C,MAAMJ,IAAI,GAAG,KAAKL,SAAL,CAAeE,IAAf,CAAoBI,UAApB,CACXT,SAAS,CAACa,SAAV,CAAoBH,GAApB,CADW,EAEXV,SAAS,CAACa,SAAV,CAAoBF,GAApB,CAFW,EAGXb,OAAO,CAAC,KAAKK,SAAL,CAAeW,MAAhB,EAAwBF,EAAxB,CAHI,CAAb;;IAKA,IAAIJ,IAAI,KAAK,IAAb,EAAmB;MACjB,OAAO,IAAP;IACD;;IACD,OAAO,IAAIR,SAAJ,CAAc,KAAKG,SAAnB,EAA8BK,IAA9B,CAAP;EACD;;EAEDO,YAAY,CAACC,IAAD,EAAsB;IAChC,MAAMR,IAAI,GAAG,KAAKL,SAAL,CAAeE,IAAf,CAAoBU,YAApB,CAAiCC,IAAI,CAACC,IAAL,EAAjC,CAAb;;IACA,IAAIT,IAAI,KAAK,IAAb,EAAmB;MACjB,OAAO,IAAP;IACD;;IACD,OAAO,IAAIR,SAAJ,CAAc,KAAKG,SAAnB,EAA8BK,IAA9B,CAAP;EACD;;EAEDU,YAAY,CACVC,KADU,EAEVC,EAFU,EAGVC,EAHU,EAIVC,KAJU,EAKK;IACf,MAAM,IAAIvB,qBAAJ,EAAN;EACD;;AA5C+D"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
2
2
|
|
3
3
|
// TODO: suggest to rename SkPicture to Picture for consistency
|
4
|
-
import { HostObject,
|
4
|
+
import { HostObject, getEnum } from "./Host";
|
5
5
|
import { JsiSkShader } from "./JsiSkShader";
|
6
6
|
import { JsiSkMatrix } from "./JsiSkMatrix";
|
7
7
|
import { JsiSkRect } from "./JsiSkRect";
|
@@ -15,7 +15,7 @@ export class JsiSkPicture extends HostObject {
|
|
15
15
|
}
|
16
16
|
|
17
17
|
makeShader(tmx, tmy, mode, localMatrix, tileRect) {
|
18
|
-
return new JsiSkShader(this.CanvasKit, this.ref.makeShader(
|
18
|
+
return new JsiSkShader(this.CanvasKit, this.ref.makeShader(getEnum(this.CanvasKit.TileMode, tmx), getEnum(this.CanvasKit.TileMode, tmy), getEnum(this.CanvasKit.FilterMode, mode), localMatrix ? JsiSkMatrix.fromValue(localMatrix) : undefined, tileRect ? JsiSkRect.fromValue(this.CanvasKit, tileRect) : undefined));
|
19
19
|
}
|
20
20
|
|
21
21
|
serialize() {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["HostObject","
|
1
|
+
{"version":3,"names":["HostObject","getEnum","JsiSkShader","JsiSkMatrix","JsiSkRect","JsiSkPicture","constructor","CanvasKit","ref","delete","makeShader","tmx","tmy","mode","localMatrix","tileRect","TileMode","FilterMode","fromValue","undefined","serialize"],"sources":["JsiSkPicture.ts"],"sourcesContent":["// TODO: suggest to rename SkPicture to Picture for consistency\nimport type { CanvasKit, SkPicture as Picture } from \"canvaskit-wasm\";\n\nimport type {\n FilterMode,\n SkRect,\n TileMode,\n SkPicture,\n SkMatrix,\n} from \"../types\";\n\nimport { HostObject, getEnum } from \"./Host\";\nimport { JsiSkShader } from \"./JsiSkShader\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkRect } from \"./JsiSkRect\";\n\nexport class JsiSkPicture\n extends HostObject<Picture, \"Picture\">\n implements SkPicture\n{\n constructor(CanvasKit: CanvasKit, ref: Picture) {\n super(CanvasKit, ref, \"Picture\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n makeShader(\n tmx: TileMode,\n tmy: TileMode,\n mode: FilterMode,\n localMatrix?: SkMatrix,\n tileRect?: SkRect\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.ref.makeShader(\n getEnum(this.CanvasKit.TileMode, tmx),\n getEnum(this.CanvasKit.TileMode, tmy),\n getEnum(this.CanvasKit.FilterMode, mode),\n localMatrix ? JsiSkMatrix.fromValue(localMatrix) : undefined,\n tileRect ? JsiSkRect.fromValue(this.CanvasKit, tileRect) : undefined\n )\n );\n }\n\n serialize() {\n return this.ref.serialize();\n }\n}\n"],"mappings":";;AAAA;AAWA,SAASA,UAAT,EAAqBC,OAArB,QAAoC,QAApC;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC,SAAT,QAA0B,aAA1B;AAEA,OAAO,MAAMC,YAAN,SACGL,UADH,CAGP;EACEM,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAqC;IAC9C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,SAAtB;;IAD8C,iCAItC,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CAN+C;EAE/C;;EAMDC,UAAU,CACRC,GADQ,EAERC,GAFQ,EAGRC,IAHQ,EAIRC,WAJQ,EAKRC,QALQ,EAMR;IACA,OAAO,IAAIb,WAAJ,CACL,KAAKK,SADA,EAEL,KAAKC,GAAL,CAASE,UAAT,CACET,OAAO,CAAC,KAAKM,SAAL,CAAeS,QAAhB,EAA0BL,GAA1B,CADT,EAEEV,OAAO,CAAC,KAAKM,SAAL,CAAeS,QAAhB,EAA0BJ,GAA1B,CAFT,EAGEX,OAAO,CAAC,KAAKM,SAAL,CAAeU,UAAhB,EAA4BJ,IAA5B,CAHT,EAIEC,WAAW,GAAGX,WAAW,CAACe,SAAZ,CAAsBJ,WAAtB,CAAH,GAAwCK,SAJrD,EAKEJ,QAAQ,GAAGX,SAAS,CAACc,SAAV,CAAoB,KAAKX,SAAzB,EAAoCQ,QAApC,CAAH,GAAmDI,SAL7D,CAFK,CAAP;EAUD;;EAEDC,SAAS,GAAG;IACV,OAAO,KAAKZ,GAAL,CAASY,SAAT,EAAP;EACD;;AA9BH"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Host,
|
1
|
+
import { Host, getEnum } from "./Host";
|
2
2
|
import { JsiSkMatrix } from "./JsiSkMatrix";
|
3
3
|
import { JsiSkPoint } from "./JsiSkPoint";
|
4
4
|
import { JsiSkShader } from "./JsiSkShader";
|
@@ -8,19 +8,19 @@ export class JsiSkShaderFactory extends Host {
|
|
8
8
|
}
|
9
9
|
|
10
10
|
MakeLinearGradient(start, end, colors, pos, mode, localMatrix, flags) {
|
11
|
-
return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeLinearGradient(JsiSkPoint.fromValue(start), JsiSkPoint.fromValue(end), colors, pos,
|
11
|
+
return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeLinearGradient(JsiSkPoint.fromValue(start), JsiSkPoint.fromValue(end), colors, pos, getEnum(this.CanvasKit.TileMode, mode), localMatrix === undefined ? undefined : JsiSkMatrix.fromValue(localMatrix), flags));
|
12
12
|
}
|
13
13
|
|
14
14
|
MakeRadialGradient(center, radius, colors, pos, mode, localMatrix, flags) {
|
15
|
-
return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeRadialGradient(JsiSkPoint.fromValue(center), radius, colors, pos,
|
15
|
+
return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeRadialGradient(JsiSkPoint.fromValue(center), radius, colors, pos, getEnum(this.CanvasKit.TileMode, mode), localMatrix === undefined ? undefined : JsiSkMatrix.fromValue(localMatrix), flags));
|
16
16
|
}
|
17
17
|
|
18
18
|
MakeTwoPointConicalGradient(start, startRadius, end, endRadius, colors, pos, mode, localMatrix, flags) {
|
19
|
-
return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeTwoPointConicalGradient(JsiSkPoint.fromValue(start), startRadius, JsiSkPoint.fromValue(end), endRadius, colors, pos,
|
19
|
+
return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeTwoPointConicalGradient(JsiSkPoint.fromValue(start), startRadius, JsiSkPoint.fromValue(end), endRadius, colors, pos, getEnum(this.CanvasKit.TileMode, mode), localMatrix === undefined ? undefined : JsiSkMatrix.fromValue(localMatrix), flags));
|
20
20
|
}
|
21
21
|
|
22
22
|
MakeSweepGradient(cx, cy, colors, pos, mode, localMatrix, flags, startAngleInDegrees, endAngleInDegrees) {
|
23
|
-
return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeSweepGradient(cx, cy, colors, pos,
|
23
|
+
return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeSweepGradient(cx, cy, colors, pos, getEnum(this.CanvasKit.TileMode, mode), localMatrix === undefined || localMatrix === null ? undefined : JsiSkMatrix.fromValue(localMatrix), flags, startAngleInDegrees, endAngleInDegrees));
|
24
24
|
}
|
25
25
|
|
26
26
|
MakeTurbulence(baseFreqX, baseFreqY, octaves, seed, tileW, tileH) {
|
@@ -32,7 +32,7 @@ export class JsiSkShaderFactory extends Host {
|
|
32
32
|
}
|
33
33
|
|
34
34
|
MakeBlend(mode, one, two) {
|
35
|
-
return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeBlend(
|
35
|
+
return new JsiSkShader(this.CanvasKit, this.CanvasKit.Shader.MakeBlend(getEnum(this.CanvasKit.BlendMode, mode), JsiSkShader.fromValue(one), JsiSkShader.fromValue(two)));
|
36
36
|
}
|
37
37
|
|
38
38
|
MakeColor(color) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["Host","
|
1
|
+
{"version":3,"names":["Host","getEnum","JsiSkMatrix","JsiSkPoint","JsiSkShader","JsiSkShaderFactory","constructor","CanvasKit","MakeLinearGradient","start","end","colors","pos","mode","localMatrix","flags","Shader","fromValue","TileMode","undefined","MakeRadialGradient","center","radius","MakeTwoPointConicalGradient","startRadius","endRadius","MakeSweepGradient","cx","cy","startAngleInDegrees","endAngleInDegrees","MakeTurbulence","baseFreqX","baseFreqY","octaves","seed","tileW","tileH","MakeFractalNoise","MakeBlend","one","two","BlendMode","MakeColor","color","ColorSpace","SRGB"],"sources":["JsiSkShaderFactory.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n BlendMode,\n SkColor,\n SkMatrix,\n SkPoint,\n SkShader,\n TileMode,\n} from \"../types\";\nimport type { ShaderFactory } from \"../types/Shader/ShaderFactory\";\n\nimport { Host, getEnum } from \"./Host\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkShader } from \"./JsiSkShader\";\n\nexport class JsiSkShaderFactory extends Host implements ShaderFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeLinearGradient(\n start: SkPoint,\n end: SkPoint,\n colors: SkColor[],\n pos: number[] | null,\n mode: TileMode,\n localMatrix?: SkMatrix,\n flags?: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeLinearGradient(\n JsiSkPoint.fromValue(start),\n JsiSkPoint.fromValue(end),\n colors,\n pos,\n getEnum(this.CanvasKit.TileMode, mode),\n localMatrix === undefined\n ? undefined\n : JsiSkMatrix.fromValue(localMatrix),\n flags\n )\n );\n }\n\n MakeRadialGradient(\n center: SkPoint,\n radius: number,\n colors: SkColor[],\n pos: number[] | null,\n mode: TileMode,\n localMatrix?: SkMatrix,\n flags?: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeRadialGradient(\n JsiSkPoint.fromValue(center),\n radius,\n colors,\n pos,\n getEnum(this.CanvasKit.TileMode, mode),\n localMatrix === undefined\n ? undefined\n : JsiSkMatrix.fromValue(localMatrix),\n flags\n )\n );\n }\n\n MakeTwoPointConicalGradient(\n start: SkPoint,\n startRadius: number,\n end: SkPoint,\n endRadius: number,\n colors: SkColor[],\n pos: number[] | null,\n mode: TileMode,\n localMatrix?: SkMatrix,\n flags?: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeTwoPointConicalGradient(\n JsiSkPoint.fromValue(start),\n startRadius,\n JsiSkPoint.fromValue(end),\n endRadius,\n colors,\n pos,\n getEnum(this.CanvasKit.TileMode, mode),\n localMatrix === undefined\n ? undefined\n : JsiSkMatrix.fromValue(localMatrix),\n flags\n )\n );\n }\n\n MakeSweepGradient(\n cx: number,\n cy: number,\n colors: SkColor[],\n pos: number[] | null,\n mode: TileMode,\n localMatrix?: SkMatrix | null,\n flags?: number,\n startAngleInDegrees?: number,\n endAngleInDegrees?: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeSweepGradient(\n cx,\n cy,\n colors,\n pos,\n getEnum(this.CanvasKit.TileMode, mode),\n localMatrix === undefined || localMatrix === null\n ? undefined\n : JsiSkMatrix.fromValue(localMatrix),\n flags,\n startAngleInDegrees,\n endAngleInDegrees\n )\n );\n }\n\n MakeTurbulence(\n baseFreqX: number,\n baseFreqY: number,\n octaves: number,\n seed: number,\n tileW: number,\n tileH: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeTurbulence(\n baseFreqX,\n baseFreqY,\n octaves,\n seed,\n tileW,\n tileH\n )\n );\n }\n\n MakeFractalNoise(\n baseFreqX: number,\n baseFreqY: number,\n octaves: number,\n seed: number,\n tileW: number,\n tileH: number\n ) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeFractalNoise(\n baseFreqX,\n baseFreqY,\n octaves,\n seed,\n tileW,\n tileH\n )\n );\n }\n\n MakeBlend(mode: BlendMode, one: SkShader, two: SkShader) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeBlend(\n getEnum(this.CanvasKit.BlendMode, mode),\n JsiSkShader.fromValue(one),\n JsiSkShader.fromValue(two)\n )\n );\n }\n\n MakeColor(color: SkColor) {\n return new JsiSkShader(\n this.CanvasKit,\n this.CanvasKit.Shader.MakeColor(color, this.CanvasKit.ColorSpace.SRGB)\n );\n }\n}\n"],"mappings":"AAYA,SAASA,IAAT,EAAeC,OAAf,QAA8B,QAA9B;AACA,SAASC,WAAT,QAA4B,eAA5B;AACA,SAASC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