@shopify/react-native-skia 0.1.225 → 0.1.228
Sign up to get free protection for your applications and to get access to all the features.
- package/android/cpp/rnskia-android/SkiaOpenGLSurfaceFactory.h +3 -3
- package/cpp/api/JsiSkCanvas.h +2 -1
- package/cpp/api/JsiSkMatrix.h +35 -13
- package/cpp/api/JsiSkPictureRecorder.h +10 -3
- package/cpp/api/JsiSkTypeface.h +1 -0
- package/cpp/rnskia/dom/props/MatrixProp.h +19 -0
- package/cpp/rnskia/dom/props/TransformProp.h +76 -9
- package/lib/commonjs/animation/spring/runSpring.d.ts +3 -0
- package/lib/commonjs/animation/spring/runSpring.js +3 -0
- package/lib/commonjs/animation/spring/runSpring.js.map +1 -1
- package/lib/commonjs/animation/spring/useSpring.d.ts +3 -0
- package/lib/commonjs/animation/spring/useSpring.js +3 -0
- package/lib/commonjs/animation/spring/useSpring.js.map +1 -1
- package/lib/commonjs/animation/timing/runTiming.d.ts +3 -0
- package/lib/commonjs/animation/timing/runTiming.js +3 -0
- package/lib/commonjs/animation/timing/runTiming.js.map +1 -1
- package/lib/commonjs/animation/timing/useLoop.d.ts +3 -0
- package/lib/commonjs/animation/timing/useLoop.js +3 -0
- package/lib/commonjs/animation/timing/useLoop.js.map +1 -1
- package/lib/commonjs/animation/timing/useTiming.d.ts +3 -0
- package/lib/commonjs/animation/timing/useTiming.js +3 -0
- package/lib/commonjs/animation/timing/useTiming.js.map +1 -1
- package/lib/commonjs/dom/nodes/JsiSkDOM.js +2 -0
- package/lib/commonjs/dom/nodes/JsiSkDOM.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Fitting.d.ts +5 -5
- package/lib/commonjs/dom/nodes/datatypes/Fitting.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Gradient.d.ts +235 -75
- package/lib/commonjs/dom/nodes/datatypes/Gradient.js.map +1 -1
- package/lib/commonjs/dom/types/Common.d.ts +3 -3
- 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 +24 -5
- 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 +34 -28
- package/lib/commonjs/renderer/Canvas.js.map +1 -1
- package/lib/commonjs/renderer/components/Drawing.d.ts +5 -0
- package/lib/commonjs/renderer/components/Drawing.js +5 -0
- package/lib/commonjs/renderer/components/Drawing.js.map +1 -1
- package/lib/commonjs/renderer/components/shapes/FitBox.d.ts +5 -5
- package/lib/commonjs/skia/core/Matrix.d.ts +2 -2
- package/lib/commonjs/skia/core/Matrix.js.map +1 -1
- package/lib/commonjs/skia/core/Picture.d.ts +2 -2
- package/lib/commonjs/skia/core/Picture.js +12 -2
- package/lib/commonjs/skia/core/Picture.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 +1 -1
- package/lib/commonjs/skia/types/Canvas.js.map +1 -1
- package/lib/commonjs/skia/types/Matrix.d.ts +4 -20
- package/lib/commonjs/skia/types/Matrix.js +4 -70
- package/lib/commonjs/skia/types/Matrix.js.map +1 -1
- package/lib/commonjs/skia/types/Matrix4.d.ts +90 -0
- package/lib/commonjs/skia/types/Matrix4.js +312 -0
- package/lib/commonjs/skia/types/Matrix4.js.map +1 -0
- package/lib/commonjs/skia/types/Path/Path.d.ts +1 -1
- package/lib/commonjs/skia/types/Path/Path.js.map +1 -1
- package/lib/commonjs/skia/types/Picture/PictureRecorder.d.ts +1 -1
- package/lib/commonjs/skia/types/Picture/PictureRecorder.js.map +1 -1
- package/lib/commonjs/skia/types/Rect.d.ts +1 -0
- package/lib/commonjs/skia/types/Rect.js +18 -0
- package/lib/commonjs/skia/types/Rect.js.map +1 -1
- package/lib/commonjs/skia/types/index.d.ts +1 -0
- package/lib/commonjs/skia/types/index.js +13 -0
- package/lib/commonjs/skia/types/index.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.d.ts +1 -1
- package/lib/commonjs/skia/web/JsiSkCanvas.js +13 -13
- 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 +5 -5
- 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/JsiSkPictureRecorder.d.ts +1 -1
- package/lib/commonjs/skia/web/JsiSkPictureRecorder.js +1 -1
- package/lib/commonjs/skia/web/JsiSkPictureRecorder.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/commonjs/values/api.d.ts +23 -2
- package/lib/commonjs/values/api.js +44 -1
- package/lib/commonjs/values/api.js.map +1 -1
- package/lib/commonjs/values/hooks/useClockValue.d.ts +3 -0
- package/lib/commonjs/values/hooks/useClockValue.js +3 -0
- package/lib/commonjs/values/hooks/useClockValue.js.map +1 -1
- package/lib/commonjs/values/hooks/useComputedValue.d.ts +3 -0
- package/lib/commonjs/values/hooks/useComputedValue.js +3 -0
- package/lib/commonjs/values/hooks/useComputedValue.js.map +1 -1
- package/lib/commonjs/values/hooks/useValue.d.ts +3 -0
- package/lib/commonjs/values/hooks/useValue.js +3 -0
- package/lib/commonjs/values/hooks/useValue.js.map +1 -1
- package/lib/commonjs/values/hooks/useValueEffect.d.ts +3 -0
- package/lib/commonjs/values/hooks/useValueEffect.js +3 -0
- package/lib/commonjs/values/hooks/useValueEffect.js.map +1 -1
- package/lib/commonjs/values/types.d.ts +4 -4
- package/lib/commonjs/values/types.js.map +1 -1
- package/lib/commonjs/views/SkiaView.d.ts +5 -0
- package/lib/commonjs/views/SkiaView.js +9 -0
- package/lib/commonjs/views/SkiaView.js.map +1 -1
- package/lib/module/animation/spring/runSpring.d.ts +3 -0
- package/lib/module/animation/spring/runSpring.js +3 -0
- package/lib/module/animation/spring/runSpring.js.map +1 -1
- package/lib/module/animation/spring/useSpring.d.ts +3 -0
- package/lib/module/animation/spring/useSpring.js +3 -0
- package/lib/module/animation/spring/useSpring.js.map +1 -1
- package/lib/module/animation/timing/runTiming.d.ts +3 -0
- package/lib/module/animation/timing/runTiming.js +3 -0
- package/lib/module/animation/timing/runTiming.js.map +1 -1
- package/lib/module/animation/timing/useLoop.d.ts +3 -0
- package/lib/module/animation/timing/useLoop.js +3 -0
- package/lib/module/animation/timing/useLoop.js.map +1 -1
- package/lib/module/animation/timing/useTiming.d.ts +3 -0
- package/lib/module/animation/timing/useTiming.js +3 -0
- package/lib/module/animation/timing/useTiming.js.map +1 -1
- package/lib/module/dom/nodes/JsiSkDOM.js +2 -0
- package/lib/module/dom/nodes/JsiSkDOM.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Fitting.d.ts +5 -5
- package/lib/module/dom/nodes/datatypes/Fitting.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Gradient.d.ts +235 -75
- package/lib/module/dom/nodes/datatypes/Gradient.js.map +1 -1
- package/lib/module/dom/types/Common.d.ts +3 -3
- 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 +22 -6
- 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 +35 -29
- package/lib/module/renderer/Canvas.js.map +1 -1
- package/lib/module/renderer/components/Drawing.d.ts +5 -0
- package/lib/module/renderer/components/Drawing.js +6 -0
- package/lib/module/renderer/components/Drawing.js.map +1 -1
- package/lib/module/renderer/components/shapes/FitBox.d.ts +5 -5
- package/lib/module/skia/core/Matrix.d.ts +2 -2
- package/lib/module/skia/core/Matrix.js.map +1 -1
- package/lib/module/skia/core/Picture.d.ts +2 -2
- package/lib/module/skia/core/Picture.js +12 -3
- package/lib/module/skia/core/Picture.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 +1 -1
- package/lib/module/skia/types/Canvas.js.map +1 -1
- package/lib/module/skia/types/Matrix.d.ts +4 -20
- package/lib/module/skia/types/Matrix.js +3 -71
- package/lib/module/skia/types/Matrix.js.map +1 -1
- package/lib/module/skia/types/Matrix4.d.ts +90 -0
- package/lib/module/skia/types/Matrix4.js +274 -0
- package/lib/module/skia/types/Matrix4.js.map +1 -0
- package/lib/module/skia/types/Path/Path.d.ts +1 -1
- package/lib/module/skia/types/Path/Path.js.map +1 -1
- package/lib/module/skia/types/Picture/PictureRecorder.d.ts +1 -1
- package/lib/module/skia/types/Picture/PictureRecorder.js.map +1 -1
- package/lib/module/skia/types/Rect.d.ts +1 -0
- package/lib/module/skia/types/Rect.js +9 -0
- package/lib/module/skia/types/Rect.js.map +1 -1
- package/lib/module/skia/types/index.d.ts +1 -0
- package/lib/module/skia/types/index.js +1 -0
- package/lib/module/skia/types/index.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.d.ts +1 -1
- package/lib/module/skia/web/JsiSkCanvas.js +14 -14
- 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 +6 -6
- 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/JsiSkPictureRecorder.d.ts +1 -1
- package/lib/module/skia/web/JsiSkPictureRecorder.js +1 -1
- package/lib/module/skia/web/JsiSkPictureRecorder.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/module/values/api.d.ts +23 -2
- package/lib/module/values/api.js +44 -1
- package/lib/module/values/api.js.map +1 -1
- package/lib/module/values/hooks/useClockValue.d.ts +3 -0
- package/lib/module/values/hooks/useClockValue.js +3 -0
- package/lib/module/values/hooks/useClockValue.js.map +1 -1
- package/lib/module/values/hooks/useComputedValue.d.ts +3 -0
- package/lib/module/values/hooks/useComputedValue.js +3 -0
- package/lib/module/values/hooks/useComputedValue.js.map +1 -1
- package/lib/module/values/hooks/useValue.d.ts +3 -0
- package/lib/module/values/hooks/useValue.js +3 -0
- package/lib/module/values/hooks/useValue.js.map +1 -1
- package/lib/module/values/hooks/useValueEffect.d.ts +3 -0
- package/lib/module/values/hooks/useValueEffect.js +3 -0
- package/lib/module/values/hooks/useValueEffect.js.map +1 -1
- package/lib/module/values/types.d.ts +4 -4
- package/lib/module/values/types.js.map +1 -1
- package/lib/module/views/SkiaView.d.ts +5 -0
- package/lib/module/views/SkiaView.js +10 -0
- package/lib/module/views/SkiaView.js.map +1 -1
- package/lib/typescript/src/animation/spring/runSpring.d.ts +3 -0
- package/lib/typescript/src/animation/spring/useSpring.d.ts +3 -0
- package/lib/typescript/src/animation/timing/runTiming.d.ts +3 -0
- package/lib/typescript/src/animation/timing/useLoop.d.ts +3 -0
- package/lib/typescript/src/animation/timing/useTiming.d.ts +3 -0
- package/lib/typescript/src/dom/nodes/datatypes/Fitting.d.ts +5 -5
- package/lib/typescript/src/dom/nodes/datatypes/Gradient.d.ts +235 -75
- package/lib/typescript/src/dom/types/Common.d.ts +3 -3
- 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/renderer/components/Drawing.d.ts +5 -0
- package/lib/typescript/src/renderer/components/shapes/FitBox.d.ts +5 -5
- package/lib/typescript/src/skia/core/Matrix.d.ts +2 -2
- package/lib/typescript/src/skia/core/Picture.d.ts +2 -2
- package/lib/typescript/src/skia/core/Vector.d.ts +0 -5
- package/lib/typescript/src/skia/types/Canvas.d.ts +1 -1
- package/lib/typescript/src/skia/types/Matrix.d.ts +4 -20
- package/lib/typescript/src/skia/types/Matrix4.d.ts +90 -0
- package/lib/typescript/src/skia/types/Path/Path.d.ts +1 -1
- package/lib/typescript/src/skia/types/Picture/PictureRecorder.d.ts +1 -1
- package/lib/typescript/src/skia/types/Rect.d.ts +1 -0
- package/lib/typescript/src/skia/types/index.d.ts +1 -0
- package/lib/typescript/src/skia/web/Host.d.ts +2 -3
- package/lib/typescript/src/skia/web/JsiSkCanvas.d.ts +1 -1
- package/lib/typescript/src/skia/web/JsiSkMatrix.d.ts +2 -2
- package/lib/typescript/src/skia/web/JsiSkPictureRecorder.d.ts +1 -1
- package/lib/typescript/src/values/api.d.ts +23 -2
- package/lib/typescript/src/values/hooks/useClockValue.d.ts +3 -0
- package/lib/typescript/src/values/hooks/useComputedValue.d.ts +3 -0
- package/lib/typescript/src/values/hooks/useValue.d.ts +3 -0
- package/lib/typescript/src/values/hooks/useValueEffect.d.ts +3 -0
- package/lib/typescript/src/values/types.d.ts +4 -4
- package/lib/typescript/src/views/SkiaView.d.ts +5 -0
- package/package.json +2 -1
- package/src/animation/spring/runSpring.ts +3 -0
- package/src/animation/spring/useSpring.ts +3 -0
- package/src/animation/timing/runTiming.ts +3 -0
- package/src/animation/timing/useLoop.ts +3 -0
- package/src/animation/timing/useTiming.ts +3 -0
- package/src/dom/nodes/JsiSkDOM.ts +4 -0
- package/src/dom/nodes/datatypes/Fitting.ts +10 -2
- package/src/dom/nodes/datatypes/Gradient.ts +2 -2
- package/src/dom/types/Common.ts +5 -3
- package/src/external/reanimated/interpolators.ts +30 -7
- package/src/external/reanimated/moduleWrapper.ts +6 -0
- package/src/renderer/Canvas.tsx +41 -30
- package/src/renderer/components/Drawing.tsx +5 -0
- package/src/skia/core/Matrix.ts +2 -2
- package/src/skia/core/Picture.ts +11 -3
- package/src/skia/core/Vector.ts +0 -4
- package/src/skia/types/Canvas.ts +1 -1
- package/src/skia/types/Matrix.ts +7 -85
- package/src/skia/types/Matrix4.ts +344 -0
- package/src/skia/types/Path/Path.ts +1 -1
- package/src/skia/types/Picture/PictureRecorder.ts +1 -1
- package/src/skia/types/Rect.ts +14 -0
- package/src/skia/types/index.ts +1 -0
- package/src/skia/web/Host.ts +4 -3
- package/src/skia/web/JsiSkCanvas.ts +24 -17
- 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 +14 -3
- package/src/skia/web/JsiSkPaint.ts +4 -4
- package/src/skia/web/JsiSkPath.ts +9 -6
- 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/JsiSkPictureRecorder.ts +6 -2
- package/src/skia/web/JsiSkShaderFactory.ts +6 -6
- package/src/skia/web/JsiSkVerticesFactory.ts +2 -2
- package/src/values/api.ts +55 -2
- package/src/values/hooks/useClockValue.ts +3 -0
- package/src/values/hooks/useComputedValue.ts +3 -0
- package/src/values/hooks/useValue.ts +3 -0
- package/src/values/hooks/useValueEffect.ts +3 -0
- package/src/values/types.ts +6 -6
- package/src/views/SkiaView.tsx +11 -0
@@ -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 {
|
3
|
+
import { getEnum, HostObject } from "./Host";
|
4
4
|
import { JsiSkPaint } from "./JsiSkPaint";
|
5
5
|
import { JsiSkRect } from "./JsiSkRect";
|
6
6
|
import { JsiSkRRect } from "./JsiSkRRect";
|
@@ -39,11 +39,11 @@ export class JsiSkCanvas extends HostObject {
|
|
39
39
|
}
|
40
40
|
|
41
41
|
drawImageOptions(img, left, top, fm, mm, paint) {
|
42
|
-
this.ref.drawImageOptions(JsiSkImage.fromValue(img), left, top,
|
42
|
+
this.ref.drawImageOptions(JsiSkImage.fromValue(img), left, top, getEnum(this.CanvasKit.FilterMode, fm), getEnum(this.CanvasKit.MipmapMode, mm), paint ? JsiSkPaint.fromValue(paint) : paint);
|
43
43
|
}
|
44
44
|
|
45
45
|
drawImageNine(img, center, dest, filter, paint) {
|
46
|
-
this.ref.drawImageNine(JsiSkImage.fromValue(img), Array.from(JsiSkRect.fromValue(this.CanvasKit, center)), JsiSkRect.fromValue(this.CanvasKit, dest),
|
46
|
+
this.ref.drawImageNine(JsiSkImage.fromValue(img), Array.from(JsiSkRect.fromValue(this.CanvasKit, center)), JsiSkRect.fromValue(this.CanvasKit, dest), getEnum(this.CanvasKit.FilterMode, filter), paint ? JsiSkPaint.fromValue(paint) : paint);
|
47
47
|
}
|
48
48
|
|
49
49
|
drawImageRectCubic(img, src, dest, B, C, paint) {
|
@@ -51,7 +51,7 @@ export class JsiSkCanvas extends HostObject {
|
|
51
51
|
}
|
52
52
|
|
53
53
|
drawImageRectOptions(img, src, dest, fm, mm, paint) {
|
54
|
-
this.ref.drawImageRectOptions(JsiSkImage.fromValue(img), JsiSkRect.fromValue(this.CanvasKit, src), JsiSkRect.fromValue(this.CanvasKit, dest),
|
54
|
+
this.ref.drawImageRectOptions(JsiSkImage.fromValue(img), JsiSkRect.fromValue(this.CanvasKit, src), JsiSkRect.fromValue(this.CanvasKit, dest), getEnum(this.CanvasKit.FilterMode, fm), getEnum(this.CanvasKit.MipmapMode, mm), paint ? JsiSkPaint.fromValue(paint) : paint);
|
55
55
|
}
|
56
56
|
|
57
57
|
drawPaint(paint) {
|
@@ -67,7 +67,7 @@ export class JsiSkCanvas extends HostObject {
|
|
67
67
|
}
|
68
68
|
|
69
69
|
drawVertices(verts, mode, paint) {
|
70
|
-
this.ref.drawVertices(JsiSkVertices.fromValue(verts),
|
70
|
+
this.ref.drawVertices(JsiSkVertices.fromValue(verts), getEnum(this.CanvasKit.BlendMode, mode), JsiSkPaint.fromValue(paint));
|
71
71
|
}
|
72
72
|
|
73
73
|
drawPatch(cubics, colors, texs, mode, paint) {
|
@@ -77,7 +77,7 @@ export class JsiSkCanvas extends HostObject {
|
|
77
77
|
y
|
78
78
|
} = _ref;
|
79
79
|
return [x, y];
|
80
|
-
}).flat(), colors, texs ? texs.flatMap(p => Array.from(JsiSkPoint.fromValue(p))) : texs, mode ?
|
80
|
+
}).flat(), colors, texs ? texs.flatMap(p => Array.from(JsiSkPoint.fromValue(p))) : texs, mode ? getEnum(this.CanvasKit.BlendMode, mode) : null, paint ? JsiSkPaint.fromValue(paint) : undefined);
|
81
81
|
}
|
82
82
|
|
83
83
|
restoreToCount(saveCount) {
|
@@ -85,7 +85,7 @@ export class JsiSkCanvas extends HostObject {
|
|
85
85
|
}
|
86
86
|
|
87
87
|
drawPoints(mode, points, paint) {
|
88
|
-
this.ref.drawPoints(
|
88
|
+
this.ref.drawPoints(getEnum(this.CanvasKit.PointMode, mode), points.map(_ref2 => {
|
89
89
|
let {
|
90
90
|
x,
|
91
91
|
y
|
@@ -159,7 +159,7 @@ export class JsiSkCanvas extends HostObject {
|
|
159
159
|
}
|
160
160
|
|
161
161
|
drawColor(color, blendMode) {
|
162
|
-
this.ref.drawColor(color, blendMode ?
|
162
|
+
this.ref.drawColor(color, blendMode ? getEnum(this.CanvasKit.BlendMode, blendMode) : undefined);
|
163
163
|
}
|
164
164
|
|
165
165
|
clear(color) {
|
@@ -167,19 +167,19 @@ export class JsiSkCanvas extends HostObject {
|
|
167
167
|
}
|
168
168
|
|
169
169
|
clipPath(path, op, doAntiAlias) {
|
170
|
-
this.ref.clipPath(JsiSkPath.fromValue(path),
|
170
|
+
this.ref.clipPath(JsiSkPath.fromValue(path), getEnum(this.CanvasKit.PathOp, op), doAntiAlias);
|
171
171
|
}
|
172
172
|
|
173
173
|
clipRect(rect, op, doAntiAlias) {
|
174
|
-
this.ref.clipRect(JsiSkRect.fromValue(this.CanvasKit, rect),
|
174
|
+
this.ref.clipRect(JsiSkRect.fromValue(this.CanvasKit, rect), getEnum(this.CanvasKit.PathOp, op), doAntiAlias);
|
175
175
|
}
|
176
176
|
|
177
177
|
clipRRect(rrect, op, doAntiAlias) {
|
178
|
-
this.ref.clipRRect(JsiSkRRect.fromValue(this.CanvasKit, rrect),
|
178
|
+
this.ref.clipRRect(JsiSkRRect.fromValue(this.CanvasKit, rrect), getEnum(this.CanvasKit.PathOp, op), doAntiAlias);
|
179
179
|
}
|
180
180
|
|
181
181
|
concat(m) {
|
182
|
-
this.ref.concat(JsiSkMatrix.fromValue(m));
|
182
|
+
this.ref.concat(Array.isArray(m) ? m : JsiSkMatrix.fromValue(m));
|
183
183
|
}
|
184
184
|
|
185
185
|
drawPicture(skp) {
|
@@ -191,8 +191,8 @@ export class JsiSkCanvas extends HostObject {
|
|
191
191
|
width: imageInfo.width,
|
192
192
|
height: imageInfo.height,
|
193
193
|
colorSpace: this.CanvasKit.ColorSpace.SRGB,
|
194
|
-
alphaType:
|
195
|
-
colorType:
|
194
|
+
alphaType: getEnum(this.CanvasKit.AlphaType, imageInfo.alphaType),
|
195
|
+
colorType: getEnum(this.CanvasKit.ColorType, imageInfo.colorType)
|
196
196
|
};
|
197
197
|
return this.ref.readPixels(srcX, srcY, pxInfo);
|
198
198
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["ckEnum","getCkEnum","HostObject","JsiSkPaint","JsiSkRect","JsiSkRRect","JsiSkImage","JsiSkVertices","JsiSkPath","JsiSkFont","JsiSkTextBlob","JsiSkPicture","JsiSkMatrix","JsiSkImageFilter","JsiSkPoint","JsiSkCanvas","constructor","CanvasKit","ref","delete","drawRect","rect","paint","fromValue","drawImage","image","x","y","drawImageRect","img","src","dest","fastSample","drawImageCubic","left","top","B","C","drawImageOptions","fm","mm","drawImageNine","center","filter","Array","from","drawImageRectCubic","drawImageRectOptions","drawPaint","drawLine","x0","y0","x1","y1","drawCircle","cx","cy","radius","drawVertices","verts","mode","drawPatch","cubics","colors","texs","map","flat","flatMap","p","undefined","restoreToCount","saveCount","drawPoints","points","drawArc","oval","startAngle","sweepAngle","useCenter","drawRRect","rrect","drawDRRect","outer","inner","drawOval","drawPath","path","drawText","str","font","drawTextBlob","blob","drawGlyphs","glyphs","positions","drawSvg","_svgDom","_width","_height","Error","save","saveLayer","bounds","backdrop","flags","restore","rotate","rotationInDegrees","rx","ry","scale","sx","sy","skew","translate","dx","dy","drawColor","color","blendMode","clear","clipPath","op","doAntiAlias","clipRect","clipRRect","concat","m","drawPicture","skp","readPixels","srcX","srcY","imageInfo","pxInfo","width","height","colorSpace","ColorSpace","SRGB","alphaType","AlphaType","colorType","ColorType"],"sources":["JsiSkCanvas.ts"],"sourcesContent":["import type { Canvas, CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n BlendMode,\n ClipOp,\n FilterMode,\n MipmapMode,\n PointMode,\n SaveLayerFlag,\n ImageInfo,\n SkCanvas,\n SkColor,\n SkFont,\n SkImage,\n SkImageFilter,\n SkMatrix,\n SkPaint,\n SkPath,\n SkPicture,\n SkPoint,\n SkRect,\n SkRRect,\n SkSVG,\n SkTextBlob,\n SkVertices,\n} from \"../types\";\n\nimport { ckEnum, getCkEnum, HostObject } from \"./Host\";\nimport { JsiSkPaint } from \"./JsiSkPaint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { JsiSkRRect } from \"./JsiSkRRect\";\nimport { JsiSkImage } from \"./JsiSkImage\";\nimport { JsiSkVertices } from \"./JsiSkVertices\";\nimport { JsiSkPath } from \"./JsiSkPath\";\nimport { JsiSkFont } from \"./JsiSkFont\";\nimport { JsiSkTextBlob } from \"./JsiSkTextBlob\";\nimport { JsiSkPicture } from \"./JsiSkPicture\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkImageFilter } from \"./JsiSkImageFilter\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\n\nexport class JsiSkCanvas\n extends HostObject<Canvas, \"Canvas\">\n implements SkCanvas\n{\n constructor(CanvasKit: CanvasKit, ref: Canvas) {\n super(CanvasKit, ref, \"Canvas\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n drawRect(rect: SkRect, paint: SkPaint) {\n this.ref.drawRect(\n JsiSkRect.fromValue(this.CanvasKit, rect),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawImage(image: SkImage, x: number, y: number, paint?: SkPaint) {\n this.ref.drawImage(\n JsiSkImage.fromValue(image),\n x,\n y,\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageRect(\n img: SkImage,\n src: SkRect,\n dest: SkRect,\n paint: SkPaint,\n fastSample?: boolean\n ) {\n this.ref.drawImageRect(\n JsiSkImage.fromValue(img),\n JsiSkRect.fromValue(this.CanvasKit, src),\n JsiSkRect.fromValue(this.CanvasKit, dest),\n JsiSkPaint.fromValue(paint),\n fastSample\n );\n }\n\n drawImageCubic(\n img: SkImage,\n left: number,\n top: number,\n B: number,\n C: number,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageCubic(\n JsiSkImage.fromValue(img),\n left,\n top,\n B,\n C,\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageOptions(\n img: SkImage,\n left: number,\n top: number,\n fm: FilterMode,\n mm: MipmapMode,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageOptions(\n JsiSkImage.fromValue(img),\n left,\n top,\n ckEnum(fm),\n ckEnum(mm),\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageNine(\n img: SkImage,\n center: SkRect,\n dest: SkRect,\n filter: FilterMode,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageNine(\n JsiSkImage.fromValue(img),\n Array.from(JsiSkRect.fromValue(this.CanvasKit, center)),\n JsiSkRect.fromValue(this.CanvasKit, dest),\n ckEnum(filter),\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageRectCubic(\n img: SkImage,\n src: SkRect,\n dest: SkRect,\n B: number,\n C: number,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageRectCubic(\n JsiSkImage.fromValue(img),\n JsiSkRect.fromValue(this.CanvasKit, src),\n JsiSkRect.fromValue(this.CanvasKit, dest),\n B,\n C,\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageRectOptions(\n img: SkImage,\n src: SkRect,\n dest: SkRect,\n fm: FilterMode,\n mm: MipmapMode,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageRectOptions(\n JsiSkImage.fromValue(img),\n JsiSkRect.fromValue(this.CanvasKit, src),\n JsiSkRect.fromValue(this.CanvasKit, dest),\n ckEnum(fm),\n ckEnum(mm),\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawPaint(paint: SkPaint) {\n this.ref.drawPaint(JsiSkPaint.fromValue(paint));\n }\n\n drawLine(x0: number, y0: number, x1: number, y1: number, paint: SkPaint) {\n this.ref.drawLine(x0, y0, x1, y1, JsiSkPaint.fromValue(paint));\n }\n\n drawCircle(cx: number, cy: number, radius: number, paint: SkPaint) {\n this.ref.drawCircle(cx, cy, radius, JsiSkPaint.fromValue(paint));\n }\n\n drawVertices(verts: SkVertices, mode: BlendMode, paint: SkPaint) {\n this.ref.drawVertices(\n JsiSkVertices.fromValue(verts),\n ckEnum(mode),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawPatch(\n cubics: SkPoint[],\n colors?: SkColor[] | null,\n texs?: SkPoint[] | null,\n mode?: BlendMode | null,\n paint?: SkPaint\n ) {\n this.ref.drawPatch(\n cubics.map(({ x, y }) => [x, y]).flat(),\n colors,\n texs ? texs.flatMap((p) => Array.from(JsiSkPoint.fromValue(p))) : texs,\n mode ? ckEnum(mode) : null,\n paint ? JsiSkPaint.fromValue(paint) : undefined\n );\n }\n\n restoreToCount(saveCount: number) {\n this.ref.restoreToCount(saveCount);\n }\n\n drawPoints(mode: PointMode, points: SkPoint[], paint: SkPaint) {\n this.ref.drawPoints(\n ckEnum(mode),\n points.map(({ x, y }) => [x, y]).flat(),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawArc(\n oval: SkRect,\n startAngle: number,\n sweepAngle: number,\n useCenter: boolean,\n paint: SkPaint\n ) {\n this.ref.drawArc(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n startAngle,\n sweepAngle,\n useCenter,\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawRRect(rrect: SkRRect, paint: SkPaint) {\n this.ref.drawRRect(\n JsiSkRRect.fromValue(this.CanvasKit, rrect),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawDRRect(outer: SkRRect, inner: SkRRect, paint: SkPaint) {\n this.ref.drawDRRect(\n JsiSkRRect.fromValue(this.CanvasKit, outer),\n JsiSkRRect.fromValue(this.CanvasKit, inner),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawOval(oval: SkRect, paint: SkPaint) {\n this.ref.drawOval(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawPath(path: SkPath, paint: SkPaint) {\n this.ref.drawPath(JsiSkPath.fromValue(path), JsiSkPaint.fromValue(paint));\n }\n\n drawText(str: string, x: number, y: number, paint: SkPaint, font: SkFont) {\n this.ref.drawText(\n str,\n x,\n y,\n JsiSkPaint.fromValue(paint),\n JsiSkFont.fromValue(font)\n );\n }\n\n drawTextBlob(blob: SkTextBlob, x: number, y: number, paint: SkPaint) {\n this.ref.drawTextBlob(\n JsiSkTextBlob.fromValue(blob),\n x,\n y,\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawGlyphs(\n glyphs: number[],\n positions: SkPoint[],\n x: number,\n y: number,\n font: SkFont,\n paint: SkPaint\n ) {\n this.ref.drawGlyphs(\n glyphs,\n positions.map((p) => [p.x, p.y]).flat(),\n x,\n y,\n JsiSkFont.fromValue(font),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawSvg(_svgDom: SkSVG, _width?: number, _height?: number) {\n throw new Error(\"drawSvg is not implemented on React Native Web\");\n }\n\n save() {\n return this.ref.save();\n }\n\n saveLayer(\n paint?: SkPaint,\n bounds?: SkRect | null,\n backdrop?: SkImageFilter | null,\n flags?: SaveLayerFlag\n ) {\n return this.ref.saveLayer(\n paint ? JsiSkPaint.fromValue(paint) : undefined,\n bounds ? JsiSkRect.fromValue(this.CanvasKit, bounds) : bounds,\n backdrop ? JsiSkImageFilter.fromValue(backdrop) : backdrop,\n flags\n );\n }\n\n restore() {\n this.ref.restore();\n }\n\n rotate(rotationInDegrees: number, rx: number, ry: number) {\n this.ref.rotate(rotationInDegrees, rx, ry);\n }\n\n scale(sx: number, sy: number) {\n this.ref.scale(sx, sy);\n }\n\n skew(sx: number, sy: number) {\n this.ref.skew(sx, sy);\n }\n\n translate(dx: number, dy: number) {\n this.ref.translate(dx, dy);\n }\n\n drawColor(color: SkColor, blendMode?: BlendMode) {\n this.ref.drawColor(color, blendMode ? ckEnum(blendMode) : undefined);\n }\n\n clear(color: SkColor) {\n this.ref.clear(color);\n }\n\n clipPath(path: SkPath, op: ClipOp, doAntiAlias: boolean) {\n this.ref.clipPath(JsiSkPath.fromValue(path), ckEnum(op), doAntiAlias);\n }\n\n clipRect(rect: SkRect, op: ClipOp, doAntiAlias: boolean) {\n this.ref.clipRect(\n JsiSkRect.fromValue(this.CanvasKit, rect),\n ckEnum(op),\n doAntiAlias\n );\n }\n\n clipRRect(rrect: SkRRect, op: ClipOp, doAntiAlias: boolean) {\n this.ref.clipRRect(\n JsiSkRRect.fromValue(this.CanvasKit, rrect),\n ckEnum(op),\n doAntiAlias\n );\n }\n\n concat(m: SkMatrix) {\n this.ref.concat(JsiSkMatrix.fromValue(m));\n }\n\n drawPicture(skp: SkPicture) {\n this.ref.drawPicture(JsiSkPicture.fromValue(skp));\n }\n\n readPixels(srcX: number, srcY: number, imageInfo: ImageInfo) {\n const pxInfo = {\n width: imageInfo.width,\n height: imageInfo.height,\n colorSpace: this.CanvasKit.ColorSpace.SRGB,\n alphaType: getCkEnum(this.CanvasKit.AlphaType, imageInfo.alphaType),\n colorType: getCkEnum(this.CanvasKit.ColorType, imageInfo.colorType),\n };\n return this.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6BC,SAA7B,EAAmD;IAC3D,MAAMC,MAAM,GAAG;MACbC,KAAK,EAAEF,SAAS,CAACE,KADJ;MAEbC,MAAM,EAAEH,SAAS,CAACG,MAFL;MAGbC,UAAU,EAAE,KAAKxH,SAAL,CAAeyH,UAAf,CAA0BC,IAHzB;MAIbC,SAAS,EAAE3I,SAAS,CAAC,KAAKgB,SAAL,CAAe4H,SAAhB,EAA2BR,SAAS,CAACO,SAArC,CAJP;MAKbE,SAAS,EAAE7I,SAAS,CAAC,KAAKgB,SAAL,CAAe8H,SAAhB,EAA2BV,SAAS,CAACS,SAArC;IALP,CAAf;IAOA,OAAO,KAAK5H,GAAL,CAASgH,UAAT,CAAoBC,IAApB,EAA0BC,IAA1B,EAAgCE,MAAhC,CAAP;EACD;;AAvVH"}
|
1
|
+
{"version":3,"names":["getEnum","HostObject","JsiSkPaint","JsiSkRect","JsiSkRRect","JsiSkImage","JsiSkVertices","JsiSkPath","JsiSkFont","JsiSkTextBlob","JsiSkPicture","JsiSkMatrix","JsiSkImageFilter","JsiSkPoint","JsiSkCanvas","constructor","CanvasKit","ref","delete","drawRect","rect","paint","fromValue","drawImage","image","x","y","drawImageRect","img","src","dest","fastSample","drawImageCubic","left","top","B","C","drawImageOptions","fm","mm","FilterMode","MipmapMode","drawImageNine","center","filter","Array","from","drawImageRectCubic","drawImageRectOptions","drawPaint","drawLine","x0","y0","x1","y1","drawCircle","cx","cy","radius","drawVertices","verts","mode","BlendMode","drawPatch","cubics","colors","texs","map","flat","flatMap","p","undefined","restoreToCount","saveCount","drawPoints","points","PointMode","drawArc","oval","startAngle","sweepAngle","useCenter","drawRRect","rrect","drawDRRect","outer","inner","drawOval","drawPath","path","drawText","str","font","drawTextBlob","blob","drawGlyphs","glyphs","positions","drawSvg","_svgDom","_width","_height","Error","save","saveLayer","bounds","backdrop","flags","restore","rotate","rotationInDegrees","rx","ry","scale","sx","sy","skew","translate","dx","dy","drawColor","color","blendMode","clear","clipPath","op","doAntiAlias","PathOp","clipRect","clipRRect","concat","m","isArray","drawPicture","skp","readPixels","srcX","srcY","imageInfo","pxInfo","width","height","colorSpace","ColorSpace","SRGB","alphaType","AlphaType","colorType","ColorType"],"sources":["JsiSkCanvas.ts"],"sourcesContent":["import type { Canvas, CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n BlendMode,\n ClipOp,\n FilterMode,\n MipmapMode,\n PointMode,\n SaveLayerFlag,\n ImageInfo,\n SkCanvas,\n SkColor,\n SkFont,\n SkImage,\n SkImageFilter,\n SkMatrix,\n SkPaint,\n SkPath,\n SkPicture,\n SkPoint,\n SkRect,\n SkRRect,\n SkSVG,\n SkTextBlob,\n SkVertices,\n} from \"../types\";\n\nimport { getEnum, HostObject } from \"./Host\";\nimport { JsiSkPaint } from \"./JsiSkPaint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { JsiSkRRect } from \"./JsiSkRRect\";\nimport { JsiSkImage } from \"./JsiSkImage\";\nimport { JsiSkVertices } from \"./JsiSkVertices\";\nimport { JsiSkPath } from \"./JsiSkPath\";\nimport { JsiSkFont } from \"./JsiSkFont\";\nimport { JsiSkTextBlob } from \"./JsiSkTextBlob\";\nimport { JsiSkPicture } from \"./JsiSkPicture\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkImageFilter } from \"./JsiSkImageFilter\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\n\nexport class JsiSkCanvas\n extends HostObject<Canvas, \"Canvas\">\n implements SkCanvas\n{\n constructor(CanvasKit: CanvasKit, ref: Canvas) {\n super(CanvasKit, ref, \"Canvas\");\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n drawRect(rect: SkRect, paint: SkPaint) {\n this.ref.drawRect(\n JsiSkRect.fromValue(this.CanvasKit, rect),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawImage(image: SkImage, x: number, y: number, paint?: SkPaint) {\n this.ref.drawImage(\n JsiSkImage.fromValue(image),\n x,\n y,\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageRect(\n img: SkImage,\n src: SkRect,\n dest: SkRect,\n paint: SkPaint,\n fastSample?: boolean\n ) {\n this.ref.drawImageRect(\n JsiSkImage.fromValue(img),\n JsiSkRect.fromValue(this.CanvasKit, src),\n JsiSkRect.fromValue(this.CanvasKit, dest),\n JsiSkPaint.fromValue(paint),\n fastSample\n );\n }\n\n drawImageCubic(\n img: SkImage,\n left: number,\n top: number,\n B: number,\n C: number,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageCubic(\n JsiSkImage.fromValue(img),\n left,\n top,\n B,\n C,\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageOptions(\n img: SkImage,\n left: number,\n top: number,\n fm: FilterMode,\n mm: MipmapMode,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageOptions(\n JsiSkImage.fromValue(img),\n left,\n top,\n getEnum(this.CanvasKit.FilterMode, fm),\n getEnum(this.CanvasKit.MipmapMode, mm),\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageNine(\n img: SkImage,\n center: SkRect,\n dest: SkRect,\n filter: FilterMode,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageNine(\n JsiSkImage.fromValue(img),\n Array.from(JsiSkRect.fromValue(this.CanvasKit, center)),\n JsiSkRect.fromValue(this.CanvasKit, dest),\n getEnum(this.CanvasKit.FilterMode, filter),\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageRectCubic(\n img: SkImage,\n src: SkRect,\n dest: SkRect,\n B: number,\n C: number,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageRectCubic(\n JsiSkImage.fromValue(img),\n JsiSkRect.fromValue(this.CanvasKit, src),\n JsiSkRect.fromValue(this.CanvasKit, dest),\n B,\n C,\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawImageRectOptions(\n img: SkImage,\n src: SkRect,\n dest: SkRect,\n fm: FilterMode,\n mm: MipmapMode,\n paint?: SkPaint | null\n ) {\n this.ref.drawImageRectOptions(\n JsiSkImage.fromValue(img),\n JsiSkRect.fromValue(this.CanvasKit, src),\n JsiSkRect.fromValue(this.CanvasKit, dest),\n getEnum(this.CanvasKit.FilterMode, fm),\n getEnum(this.CanvasKit.MipmapMode, mm),\n paint ? JsiSkPaint.fromValue(paint) : paint\n );\n }\n\n drawPaint(paint: SkPaint) {\n this.ref.drawPaint(JsiSkPaint.fromValue(paint));\n }\n\n drawLine(x0: number, y0: number, x1: number, y1: number, paint: SkPaint) {\n this.ref.drawLine(x0, y0, x1, y1, JsiSkPaint.fromValue(paint));\n }\n\n drawCircle(cx: number, cy: number, radius: number, paint: SkPaint) {\n this.ref.drawCircle(cx, cy, radius, JsiSkPaint.fromValue(paint));\n }\n\n drawVertices(verts: SkVertices, mode: BlendMode, paint: SkPaint) {\n this.ref.drawVertices(\n JsiSkVertices.fromValue(verts),\n getEnum(this.CanvasKit.BlendMode, mode),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawPatch(\n cubics: SkPoint[],\n colors?: SkColor[] | null,\n texs?: SkPoint[] | null,\n mode?: BlendMode | null,\n paint?: SkPaint\n ) {\n this.ref.drawPatch(\n cubics.map(({ x, y }) => [x, y]).flat(),\n colors,\n texs ? texs.flatMap((p) => Array.from(JsiSkPoint.fromValue(p))) : texs,\n mode ? getEnum(this.CanvasKit.BlendMode, mode) : null,\n paint ? JsiSkPaint.fromValue(paint) : undefined\n );\n }\n\n restoreToCount(saveCount: number) {\n this.ref.restoreToCount(saveCount);\n }\n\n drawPoints(mode: PointMode, points: SkPoint[], paint: SkPaint) {\n this.ref.drawPoints(\n getEnum(this.CanvasKit.PointMode, mode),\n points.map(({ x, y }) => [x, y]).flat(),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawArc(\n oval: SkRect,\n startAngle: number,\n sweepAngle: number,\n useCenter: boolean,\n paint: SkPaint\n ) {\n this.ref.drawArc(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n startAngle,\n sweepAngle,\n useCenter,\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawRRect(rrect: SkRRect, paint: SkPaint) {\n this.ref.drawRRect(\n JsiSkRRect.fromValue(this.CanvasKit, rrect),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawDRRect(outer: SkRRect, inner: SkRRect, paint: SkPaint) {\n this.ref.drawDRRect(\n JsiSkRRect.fromValue(this.CanvasKit, outer),\n JsiSkRRect.fromValue(this.CanvasKit, inner),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawOval(oval: SkRect, paint: SkPaint) {\n this.ref.drawOval(\n JsiSkRect.fromValue(this.CanvasKit, oval),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawPath(path: SkPath, paint: SkPaint) {\n this.ref.drawPath(JsiSkPath.fromValue(path), JsiSkPaint.fromValue(paint));\n }\n\n drawText(str: string, x: number, y: number, paint: SkPaint, font: SkFont) {\n this.ref.drawText(\n str,\n x,\n y,\n JsiSkPaint.fromValue(paint),\n JsiSkFont.fromValue(font)\n );\n }\n\n drawTextBlob(blob: SkTextBlob, x: number, y: number, paint: SkPaint) {\n this.ref.drawTextBlob(\n JsiSkTextBlob.fromValue(blob),\n x,\n y,\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawGlyphs(\n glyphs: number[],\n positions: SkPoint[],\n x: number,\n y: number,\n font: SkFont,\n paint: SkPaint\n ) {\n this.ref.drawGlyphs(\n glyphs,\n positions.map((p) => [p.x, p.y]).flat(),\n x,\n y,\n JsiSkFont.fromValue(font),\n JsiSkPaint.fromValue(paint)\n );\n }\n\n drawSvg(_svgDom: SkSVG, _width?: number, _height?: number) {\n throw new Error(\"drawSvg is not implemented on React Native Web\");\n }\n\n save() {\n return this.ref.save();\n }\n\n saveLayer(\n paint?: SkPaint,\n bounds?: SkRect | null,\n backdrop?: SkImageFilter | null,\n flags?: SaveLayerFlag\n ) {\n return this.ref.saveLayer(\n paint ? JsiSkPaint.fromValue(paint) : undefined,\n bounds ? JsiSkRect.fromValue(this.CanvasKit, bounds) : bounds,\n backdrop ? JsiSkImageFilter.fromValue(backdrop) : backdrop,\n flags\n );\n }\n\n restore() {\n this.ref.restore();\n }\n\n rotate(rotationInDegrees: number, rx: number, ry: number) {\n this.ref.rotate(rotationInDegrees, rx, ry);\n }\n\n scale(sx: number, sy: number) {\n this.ref.scale(sx, sy);\n }\n\n skew(sx: number, sy: number) {\n this.ref.skew(sx, sy);\n }\n\n translate(dx: number, dy: number) {\n this.ref.translate(dx, dy);\n }\n\n drawColor(color: SkColor, blendMode?: BlendMode) {\n this.ref.drawColor(\n color,\n blendMode ? getEnum(this.CanvasKit.BlendMode, blendMode) : undefined\n );\n }\n\n clear(color: SkColor) {\n this.ref.clear(color);\n }\n\n clipPath(path: SkPath, op: ClipOp, doAntiAlias: boolean) {\n this.ref.clipPath(\n JsiSkPath.fromValue(path),\n getEnum(this.CanvasKit.PathOp, op),\n doAntiAlias\n );\n }\n\n clipRect(rect: SkRect, op: ClipOp, doAntiAlias: boolean) {\n this.ref.clipRect(\n JsiSkRect.fromValue(this.CanvasKit, rect),\n getEnum(this.CanvasKit.PathOp, op),\n doAntiAlias\n );\n }\n\n clipRRect(rrect: SkRRect, op: ClipOp, doAntiAlias: boolean) {\n this.ref.clipRRect(\n JsiSkRRect.fromValue(this.CanvasKit, rrect),\n getEnum(this.CanvasKit.PathOp, op),\n doAntiAlias\n );\n }\n\n concat(m: SkMatrix | number[]) {\n this.ref.concat(Array.isArray(m) ? m : JsiSkMatrix.fromValue(m));\n }\n\n drawPicture(skp: SkPicture) {\n this.ref.drawPicture(JsiSkPicture.fromValue(skp));\n }\n\n readPixels(srcX: number, srcY: number, imageInfo: ImageInfo) {\n const pxInfo = {\n width: imageInfo.width,\n height: imageInfo.height,\n colorSpace: this.CanvasKit.ColorSpace.SRGB,\n alphaType: getEnum(this.CanvasKit.AlphaType, imageInfo.alphaType),\n colorType: getEnum(this.CanvasKit.ColorType, imageInfo.colorType),\n };\n return this.ref.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1B,EAAqCmE,KAArC,CADF,EAEEnF,OAAO,CAAC,KAAKgB,SAAL,CAAe+G,MAAhB,EAAwBF,EAAxB,CAFT,EAGEC,WAHF;EAKD;;EAEDI,MAAM,CAACC,CAAD,EAAyB;IAC7B,KAAKlH,GAAL,CAASiH,MAAT,CAAgBrF,KAAK,CAACuF,OAAN,CAAcD,CAAd,IAAmBA,CAAnB,GAAuBxH,WAAW,CAACW,SAAZ,CAAsB6G,CAAtB,CAAvC;EACD;;EAEDE,WAAW,CAACC,GAAD,EAAiB;IAC1B,KAAKrH,GAAL,CAASoH,WAAT,CAAqB3H,YAAY,CAACY,SAAb,CAAuBgH,GAAvB,CAArB;EACD;;EAEDC,UAAU,CAACC,IAAD,EAAeC,IAAf,EAA6BC,SAA7B,EAAmD;IAC3D,MAAMC,MAAM,GAAG;MACbC,KAAK,EAAEF,SAAS,CAACE,KADJ;MAEbC,MAAM,EAAEH,SAAS,CAACG,MAFL;MAGbC,UAAU,EAAE,KAAK9H,SAAL,CAAe+H,UAAf,CAA0BC,IAHzB;MAIbC,SAAS,EAAEjJ,OAAO,CAAC,KAAKgB,SAAL,CAAekI,SAAhB,EAA2BR,SAAS,CAACO,SAArC,CAJL;MAKbE,SAAS,EAAEnJ,OAAO,CAAC,KAAKgB,SAAL,CAAeoI,SAAhB,EAA2BV,SAAS,CAACS,SAArC;IALL,CAAf;IAOA,OAAO,KAAKlI,GAAL,CAASsH,UAAT,CAAoBC,IAApB,EAA0BC,IAA1B,EAAgCE,MAAhC,CAAP;EACD;;AA9VH"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { getEnum, Host } from "./Host";
|
2
2
|
import { JsiSkColorFilter } from "./JsiSkColorFilter";
|
3
3
|
export class JsiSkColorFilterFactory extends Host {
|
4
4
|
constructor(CanvasKit) {
|
@@ -10,7 +10,7 @@ export class JsiSkColorFilterFactory extends Host {
|
|
10
10
|
}
|
11
11
|
|
12
12
|
MakeBlend(color, mode) {
|
13
|
-
return new JsiSkColorFilter(this.CanvasKit, this.CanvasKit.ColorFilter.MakeBlend(color,
|
13
|
+
return new JsiSkColorFilter(this.CanvasKit, this.CanvasKit.ColorFilter.MakeBlend(color, getEnum(this.CanvasKit.BlendMode, mode)));
|
14
14
|
}
|
15
15
|
|
16
16
|
MakeCompose(outer, inner) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
1
|
+
{"version":3,"names":["getEnum","Host","JsiSkColorFilter","JsiSkColorFilterFactory","constructor","CanvasKit","MakeMatrix","cMatrix","ColorFilter","MakeBlend","color","mode","BlendMode","MakeCompose","outer","inner","fromValue","MakeLerp","t","dst","src","MakeLinearToSRGBGamma","MakeSRGBToLinearGamma","MakeLumaColorFilter","MakeLuma"],"sources":["JsiSkColorFilterFactory.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type {\n ColorFilterFactory,\n SkColorFilter,\n InputColorMatrix,\n SkColor,\n BlendMode,\n} from \"../types\";\n\nimport { getEnum, Host } from \"./Host\";\nimport { JsiSkColorFilter } from \"./JsiSkColorFilter\";\n\nexport class JsiSkColorFilterFactory\n extends Host\n implements ColorFilterFactory\n{\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeMatrix(cMatrix: InputColorMatrix) {\n return new JsiSkColorFilter(\n this.CanvasKit,\n this.CanvasKit.ColorFilter.MakeMatrix(cMatrix)\n );\n }\n\n MakeBlend(color: SkColor, mode: BlendMode) {\n return new JsiSkColorFilter(\n this.CanvasKit,\n this.CanvasKit.ColorFilter.MakeBlend(\n color,\n getEnum(this.CanvasKit.BlendMode, mode)\n )\n );\n }\n\n MakeCompose(outer: SkColorFilter, inner: SkColorFilter) {\n return new JsiSkColorFilter(\n this.CanvasKit,\n this.CanvasKit.ColorFilter.MakeCompose(\n JsiSkColorFilter.fromValue(outer),\n JsiSkColorFilter.fromValue(inner)\n )\n );\n }\n\n MakeLerp(t: number, dst: SkColorFilter, src: SkColorFilter) {\n return new JsiSkColorFilter(\n this.CanvasKit,\n this.CanvasKit.ColorFilter.MakeLerp(\n t,\n JsiSkColorFilter.fromValue(dst),\n JsiSkColorFilter.fromValue(src)\n )\n );\n }\n\n MakeLinearToSRGBGamma() {\n return new JsiSkColorFilter(\n this.CanvasKit,\n this.CanvasKit.ColorFilter.MakeLinearToSRGBGamma()\n );\n }\n\n MakeSRGBToLinearGamma() {\n return new JsiSkColorFilter(\n this.CanvasKit,\n this.CanvasKit.ColorFilter.MakeSRGBToLinearGamma()\n );\n }\n\n MakeLumaColorFilter(): SkColorFilter {\n return new JsiSkColorFilter(\n this.CanvasKit,\n this.CanvasKit.ColorFilter.MakeLuma()\n );\n }\n}\n"],"mappings":"AAUA,SAASA,OAAT,EAAkBC,IAAlB,QAA8B,QAA9B;AACA,SAASC,gBAAT,QAAiC,oBAAjC;AAEA,OAAO,MAAMC,uBAAN,SACGF,IADH,CAGP;EACEG,WAAW,CAACC,SAAD,EAAuB;IAChC,MAAMA,SAAN;EACD;;EAEDC,UAAU,CAACC,OAAD,EAA4B;IACpC,OAAO,IAAIL,gBAAJ,CACL,KAAKG,SADA,EAEL,KAAKA,SAAL,CAAeG,WAAf,CAA2BF,UAA3B,CAAsCC,OAAtC,CAFK,CAAP;EAID;;EAEDE,SAAS,CAACC,KAAD,EAAiBC,IAAjB,EAAkC;IACzC,OAAO,IAAIT,gBAAJ,CACL,KAAKG,SADA,EAEL,KAAKA,SAAL,CAAeG,WAAf,CAA2BC,SAA3B,CACEC,KADF,EAEEV,OAAO,CAAC,KAAKK,SAAL,CAAeO,SAAhB,EAA2BD,IAA3B,CAFT,CAFK,CAAP;EAOD;;EAEDE,WAAW,CAACC,KAAD,EAAuBC,KAAvB,EAA6C;IACtD,OAAO,IAAIb,gBAAJ,CACL,KAAKG,SADA,EAEL,KAAKA,SAAL,CAAeG,WAAf,CAA2BK,WAA3B,CACEX,gBAAgB,CAACc,SAAjB,CAA2BF,KAA3B,CADF,EAEEZ,gBAAgB,CAACc,SAAjB,CAA2BD,KAA3B,CAFF,CAFK,CAAP;EAOD;;EAEDE,QAAQ,CAACC,CAAD,EAAYC,GAAZ,EAAgCC,GAAhC,EAAoD;IAC1D,OAAO,IAAIlB,gBAAJ,CACL,KAAKG,SADA,EAEL,KAAKA,SAAL,CAAeG,WAAf,CAA2BS,QAA3B,CACEC,CADF,EAEEhB,gBAAgB,CAACc,SAAjB,CAA2BG,GAA3B,CAFF,EAGEjB,gBAAgB,CAACc,SAAjB,CAA2BI,GAA3B,CAHF,CAFK,CAAP;EAQD;;EAEDC,qBAAqB,GAAG;IACtB,OAAO,IAAInB,gBAAJ,CACL,KAAKG,SADA,EAEL,KAAKA,SAAL,CAAeG,WAAf,CAA2Ba,qBAA3B,EAFK,CAAP;EAID;;EAEDC,qBAAqB,GAAG;IACtB,OAAO,IAAIpB,gBAAJ,CACL,KAAKG,SADA,EAEL,KAAKA,SAAL,CAAeG,WAAf,CAA2Bc,qBAA3B,EAFK,CAAP;EAID;;EAEDC,mBAAmB,GAAkB;IACnC,OAAO,IAAIrB,gBAAJ,CACL,KAAKG,SADA,EAEL,KAAKA,SAAL,CAAeG,WAAf,CAA2BgB,QAA3B,EAFK,CAAP;EAID;;AA9DH"}
|
@@ -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, NotImplementedOnRNWeb,
|
3
|
+
import { HostObject, NotImplementedOnRNWeb, getEnum } from "./Host";
|
4
4
|
import { JsiSkPaint } from "./JsiSkPaint";
|
5
5
|
import { JsiSkPoint } from "./JsiSkPoint";
|
6
6
|
import { JsiSkRect } from "./JsiSkRect";
|
@@ -70,7 +70,7 @@ export class JsiSkFont extends HostObject {
|
|
70
70
|
}
|
71
71
|
|
72
72
|
setEdging(edging) {
|
73
|
-
this.ref.setEdging(
|
73
|
+
this.ref.setEdging(getEnum(this.CanvasKit.FontEdging, edging));
|
74
74
|
}
|
75
75
|
|
76
76
|
setEmbeddedBitmaps(embeddedBitmaps) {
|
@@ -78,7 +78,7 @@ export class JsiSkFont extends HostObject {
|
|
78
78
|
}
|
79
79
|
|
80
80
|
setHinting(hinting) {
|
81
|
-
this.ref.setHinting(
|
81
|
+
this.ref.setHinting(getEnum(this.CanvasKit.FontHinting, hinting));
|
82
82
|
}
|
83
83
|
|
84
84
|
setLinearMetrics(linearMetrics) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["HostObject","NotImplementedOnRNWeb","
|
1
|
+
{"version":3,"names":["HostObject","NotImplementedOnRNWeb","getEnum","JsiSkPaint","JsiSkPoint","JsiSkRect","JsiSkTypeface","JsiSkFont","constructor","CanvasKit","ref","delete","measureText","_text","_paint","getTextWidth","text","paint","ids","getGlyphIDs","widths","getGlyphWidths","reduce","a","b","getMetrics","result","ascent","descent","leading","bounds","undefined","str","numCodePoints","glyphs","fromValue","getGlyphIntercepts","positions","top","bottom","map","p","Array","from","flat","getScaleX","getSize","getSkewX","isEmbolden","getTypeface","tf","setEdging","edging","FontEdging","setEmbeddedBitmaps","embeddedBitmaps","setHinting","hinting","FontHinting","setLinearMetrics","linearMetrics","setScaleX","sx","setSize","points","setSkewX","setEmbolden","embolden","setSubpixel","subpixel","setTypeface","face"],"sources":["JsiSkFont.ts"],"sourcesContent":["import type { CanvasKit, Font } from \"canvaskit-wasm\";\n\nimport type {\n FontEdging,\n FontHinting,\n SkFont,\n SkPaint,\n SkPoint,\n SkRect,\n SkTypeface,\n} from \"../types\";\n\nimport { HostObject, NotImplementedOnRNWeb, getEnum } from \"./Host\";\nimport { JsiSkPaint } from \"./JsiSkPaint\";\nimport { JsiSkPoint } from \"./JsiSkPoint\";\nimport { JsiSkRect } from \"./JsiSkRect\";\nimport { JsiSkTypeface } from \"./JsiSkTypeface\";\n\nexport class JsiSkFont extends HostObject<Font, \"Font\"> implements SkFont {\n constructor(CanvasKit: CanvasKit, ref: Font) {\n super(CanvasKit, ref, \"Font\");\n }\n\n measureText(_text: string, _paint?: SkPaint | undefined): SkRect {\n throw new NotImplementedOnRNWeb();\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n getTextWidth(text: string, paint?: SkPaint | undefined) {\n const ids = this.getGlyphIDs(text);\n const widths = this.getGlyphWidths(ids, paint);\n return widths.reduce((a, b) => a + b, 0);\n }\n\n getMetrics() {\n const result = this.ref.getMetrics();\n return {\n ascent: result.ascent,\n descent: result.descent,\n leading: result.leading,\n bounds: result.bounds\n ? new JsiSkRect(this.CanvasKit, result.bounds)\n : undefined,\n };\n }\n\n getGlyphIDs(str: string, numCodePoints?: number) {\n // TODO: Fix return value in the C++ implementation\n return [...this.ref.getGlyphIDs(str, numCodePoints)];\n }\n\n // TODO: Fix return value in the C++ implementation, it return float32\n getGlyphWidths(glyphs: number[], paint?: SkPaint | null) {\n return [\n ...this.ref.getGlyphWidths(\n glyphs,\n paint ? JsiSkPaint.fromValue(paint) : null\n ),\n ];\n }\n\n getGlyphIntercepts(\n glyphs: number[],\n positions: SkPoint[],\n top: number,\n bottom: number\n ) {\n return [\n ...this.ref.getGlyphIntercepts(\n glyphs,\n positions.map((p) => Array.from(JsiSkPoint.fromValue(p))).flat(),\n top,\n bottom\n ),\n ];\n }\n\n getScaleX() {\n return this.ref.getScaleX();\n }\n\n getSize() {\n return this.ref.getSize();\n }\n\n getSkewX() {\n return this.ref.getSkewX();\n }\n\n isEmbolden() {\n return this.ref.isEmbolden();\n }\n\n getTypeface() {\n const tf = this.ref.getTypeface();\n return tf ? new JsiSkTypeface(this.CanvasKit, tf) : null;\n }\n\n setEdging(edging: FontEdging) {\n this.ref.setEdging(getEnum(this.CanvasKit.FontEdging, edging));\n }\n\n setEmbeddedBitmaps(embeddedBitmaps: boolean) {\n this.ref.setEmbeddedBitmaps(embeddedBitmaps);\n }\n\n setHinting(hinting: FontHinting) {\n this.ref.setHinting(getEnum(this.CanvasKit.FontHinting, hinting));\n }\n\n setLinearMetrics(linearMetrics: boolean) {\n this.ref.setLinearMetrics(linearMetrics);\n }\n\n setScaleX(sx: number) {\n this.ref.setScaleX(sx);\n }\n\n setSize(points: number) {\n this.ref.setSize(points);\n }\n\n setSkewX(sx: number) {\n this.ref.setSkewX(sx);\n }\n\n setEmbolden(embolden: boolean) {\n this.ref.setEmbolden(embolden);\n }\n\n setSubpixel(subpixel: boolean) {\n this.ref.setSubpixel(subpixel);\n }\n\n setTypeface(face: SkTypeface | null) {\n this.ref.setTypeface(face ? JsiSkTypeface.fromValue(face) : null);\n }\n}\n"],"mappings":";;AAYA,SAASA,UAAT,EAAqBC,qBAArB,EAA4CC,OAA5C,QAA2D,QAA3D;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,aAAT,QAA8B,iBAA9B;AAEA,OAAO,MAAMC,SAAN,SAAwBP,UAAxB,CAAmE;EACxEQ,WAAW,CAACC,SAAD,EAAuBC,GAAvB,EAAkC;IAC3C,MAAMD,SAAN,EAAiBC,GAAjB,EAAsB,MAAtB;;IAD2C,iCAQnC,MAAM;MACd,KAAKA,GAAL,CAASC,MAAT;IACD,CAV4C;EAE5C;;EAEDC,WAAW,CAACC,KAAD,EAAgBC,MAAhB,EAAsD;IAC/D,MAAM,IAAIb,qBAAJ,EAAN;EACD;;EAMDc,YAAY,CAACC,IAAD,EAAeC,KAAf,EAA4C;IACtD,MAAMC,GAAG,GAAG,KAAKC,WAAL,CAAiBH,IAAjB,CAAZ;IACA,MAAMI,MAAM,GAAG,KAAKC,cAAL,CAAoBH,GAApB,EAAyBD,KAAzB,CAAf;IACA,OAAOG,MAAM,CAACE,MAAP,CAAc,CAACC,CAAD,EAAIC,CAAJ,KAAUD,CAAC,GAAGC,CAA5B,EAA+B,CAA/B,CAAP;EACD;;EAEDC,UAAU,GAAG;IACX,MAAMC,MAAM,GAAG,KAAKhB,G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a,CAAC6B,SAAd,CAAwBoC,IAAxB,CAAH,GAAmC,IAA5D;EACD;;AAzHuE"}
|
@@ -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 {
|
3
|
+
import { getEnum, HostObject } from "./Host";
|
4
4
|
import { JsiSkMatrix } from "./JsiSkMatrix";
|
5
5
|
import { JsiSkShader } from "./JsiSkShader"; // https://github.com/google/skia/blob/1f193df9b393d50da39570dab77a0bb5d28ec8ef/modules/canvaskit/htmlcanvas/util.js
|
6
6
|
|
@@ -60,20 +60,20 @@ export class JsiSkImage extends HostObject {
|
|
60
60
|
}
|
61
61
|
|
62
62
|
makeShaderOptions(tx, ty, fm, mm, localMatrix) {
|
63
|
-
return new JsiSkShader(this.CanvasKit, this.ref.makeShaderOptions(
|
63
|
+
return new JsiSkShader(this.CanvasKit, this.ref.makeShaderOptions(getEnum(this.CanvasKit.TileMode, tx), getEnum(this.CanvasKit.TileMode, ty), getEnum(this.CanvasKit.FilterMode, fm), getEnum(this.CanvasKit.MipmapMode, mm), localMatrix ? JsiSkMatrix.fromValue(localMatrix) : undefined));
|
64
64
|
}
|
65
65
|
|
66
66
|
makeShaderCubic(tx, ty, B, C, localMatrix) {
|
67
|
-
return new JsiSkShader(this.CanvasKit, this.ref.makeShaderCubic(
|
67
|
+
return new JsiSkShader(this.CanvasKit, this.ref.makeShaderCubic(getEnum(this.CanvasKit.TileMode, tx), getEnum(this.CanvasKit.TileMode, ty), B, C, localMatrix ? JsiSkMatrix.fromValue(localMatrix) : undefined));
|
68
68
|
}
|
69
69
|
|
70
70
|
encodeToBytes(fmt, quality) {
|
71
71
|
let result;
|
72
72
|
|
73
73
|
if (fmt && quality) {
|
74
|
-
result = this.ref.encodeToBytes(
|
74
|
+
result = this.ref.encodeToBytes(getEnum(this.CanvasKit.ImageFormat, fmt), quality);
|
75
75
|
} else if (fmt) {
|
76
|
-
result = this.ref.encodeToBytes(
|
76
|
+
result = this.ref.encodeToBytes(getEnum(this.CanvasKit.ImageFormat, fmt));
|
77
77
|
} else {
|
78
78
|
result = this.ref.encodeToBytes();
|
79
79
|
}
|
@@ -98,8 +98,8 @@ export class JsiSkImage extends HostObject {
|
|
98
98
|
colorSpace: this.CanvasKit.ColorSpace.SRGB,
|
99
99
|
width: (_imageInfo$width = imageInfo === null || imageInfo === void 0 ? void 0 : imageInfo.width) !== null && _imageInfo$width !== void 0 ? _imageInfo$width : info.width,
|
100
100
|
height: (_imageInfo$height = imageInfo === null || imageInfo === void 0 ? void 0 : imageInfo.height) !== null && _imageInfo$height !== void 0 ? _imageInfo$height : info.height,
|
101
|
-
alphaType:
|
102
|
-
colorType:
|
101
|
+
alphaType: getEnum(this.CanvasKit.AlphaType, (imageInfo !== null && imageInfo !== void 0 ? imageInfo : info).alphaType),
|
102
|
+
colorType: getEnum(this.CanvasKit.ColorType, (imageInfo !== null && imageInfo !== void 0 ? imageInfo : info).colorType)
|
103
103
|
};
|
104
104
|
return this.ref.readPixels(srcX !== null && srcX !== void 0 ? srcX : 0, srcY !== null && srcY !== void 0 ? srcY : 0, pxInfo);
|
105
105
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
1
|
+
{"version":3,"names":["getEnum","HostObject","JsiSkMatrix","JsiSkShader","toBase64String","bytes","Buffer","from","toString","CHUNK_SIZE","index","length","result","slice","Math","min","String","fromCharCode","apply","btoa","JsiSkImage","constructor","CanvasKit","ref","delete","height","width","getImageInfo","info","colorType","value","alphaType","makeShaderOptions","tx","ty","fm","mm","localMatrix","TileMode","FilterMode","MipmapMode","fromValue","undefined","makeShaderCubic","B","C","encodeToBytes","fmt","quality","ImageFormat","Error","encodeToBase64","readPixels","srcX","srcY","imageInfo","pxInfo","colorSpace","ColorSpace","SRGB","AlphaType","ColorType","makeNonTextureImage","MakeImageFromEncoded"],"sources":["JsiSkImage.ts"],"sourcesContent":["import type {\n CanvasKit,\n ImageInfo as CKImageInfo,\n Image,\n} from \"canvaskit-wasm\";\n\nimport type {\n FilterMode,\n MipmapMode,\n SkImage,\n SkMatrix,\n SkShader,\n TileMode,\n ImageFormat,\n ImageInfo,\n} from \"../types\";\n\nimport { getEnum, HostObject } from \"./Host\";\nimport { JsiSkMatrix } from \"./JsiSkMatrix\";\nimport { JsiSkShader } from \"./JsiSkShader\";\n\n// https://github.com/google/skia/blob/1f193df9b393d50da39570dab77a0bb5d28ec8ef/modules/canvaskit/htmlcanvas/util.js\nexport const toBase64String = (bytes: Uint8Array) => {\n if (typeof Buffer !== \"undefined\") {\n // Are we on node?\n return Buffer.from(bytes).toString(\"base64\");\n } else {\n // From https://stackoverflow.com/a/25644409\n // because the naive solution of\n // btoa(String.fromCharCode.apply(null, bytes));\n // would occasionally throw \"Maximum call stack size exceeded\"\n var CHUNK_SIZE = 0x8000; //arbitrary number\n var index = 0;\n var { length } = bytes;\n var result = \"\";\n var slice;\n while (index < length) {\n slice = bytes.slice(index, Math.min(index + CHUNK_SIZE, length));\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n result += String.fromCharCode.apply(null, slice as any);\n index += CHUNK_SIZE;\n }\n return btoa(result);\n }\n};\n\nexport class JsiSkImage extends HostObject<Image, \"Image\"> implements SkImage {\n constructor(CanvasKit: CanvasKit, ref: Image) {\n super(CanvasKit, ref, \"Image\");\n }\n\n height() {\n return this.ref.height();\n }\n\n width() {\n return this.ref.width();\n }\n\n getImageInfo(): ImageInfo {\n const info = this.ref.getImageInfo();\n return {\n width: info.width,\n height: info.height,\n colorType: info.colorType.value,\n alphaType: info.alphaType.value,\n };\n }\n\n makeShaderOptions(\n tx: TileMode,\n ty: TileMode,\n fm: FilterMode,\n mm: MipmapMode,\n localMatrix?: SkMatrix\n ): SkShader {\n return new JsiSkShader(\n this.CanvasKit,\n this.ref.makeShaderOptions(\n getEnum(this.CanvasKit.TileMode, tx),\n getEnum(this.CanvasKit.TileMode, ty),\n getEnum(this.CanvasKit.FilterMode, fm),\n getEnum(this.CanvasKit.MipmapMode, mm),\n localMatrix ? JsiSkMatrix.fromValue(localMatrix) : undefined\n )\n );\n }\n\n makeShaderCubic(\n tx: TileMode,\n ty: TileMode,\n B: number,\n C: number,\n localMatrix?: SkMatrix\n ): SkShader {\n return new JsiSkShader(\n this.CanvasKit,\n this.ref.makeShaderCubic(\n getEnum(this.CanvasKit.TileMode, tx),\n getEnum(this.CanvasKit.TileMode, ty),\n B,\n C,\n localMatrix ? JsiSkMatrix.fromValue(localMatrix) : undefined\n )\n );\n }\n\n encodeToBytes(fmt?: ImageFormat, quality?: number) {\n let result: Uint8Array | null;\n if (fmt && quality) {\n result = this.ref.encodeToBytes(\n getEnum(this.CanvasKit.ImageFormat, fmt),\n quality\n );\n } else if (fmt) {\n result = this.ref.encodeToBytes(getEnum(this.CanvasKit.ImageFormat, fmt));\n } else {\n result = this.ref.encodeToBytes();\n }\n if (!result) {\n throw new Error(\"encodeToBytes failed\");\n }\n return result;\n }\n\n encodeToBase64(fmt?: ImageFormat, quality?: number) {\n const bytes = this.encodeToBytes(fmt, quality);\n return toBase64String(bytes);\n }\n\n readPixels(srcX?: number, srcY?: number, imageInfo?: ImageInfo) {\n const info = this.getImageInfo();\n const pxInfo: CKImageInfo = {\n colorSpace: this.CanvasKit.ColorSpace.SRGB,\n width: imageInfo?.width ?? info.width,\n height: imageInfo?.height ?? info.height,\n alphaType: getEnum(\n this.CanvasKit.AlphaType,\n (imageInfo ?? info).alphaType\n ),\n colorType: getEnum(\n this.CanvasKit.ColorType,\n (imageInfo ?? info).colorType\n ),\n };\n return this.ref.readPixels(srcX ?? 0, srcY ?? 0, pxInfo);\n }\n\n dispose = () => {\n this.ref.delete();\n };\n\n makeNonTextureImage(): SkImage {\n return new JsiSkImage(\n this.CanvasKit,\n this.CanvasKit.MakeImageFromEncoded(this.encodeToBytes())!\n );\n }\n}\n"],"mappings":";;AAiBA,SAASA,OAAT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AACA,SAAD,cAACA,SAAD,GAAc3B,IAAd,EAAoBG,SAFJ,CAJQ;MAQ1BF,SAAS,EAAE7B,OAAO,CAChB,KAAKsB,SAAL,CAAeuC,SADC,EAEhB,CAACN,SAAD,aAACA,SAAD,cAACA,SAAD,GAAc3B,IAAd,EAAoBC,SAFJ;IARQ,CAA5B;IAaA,OAAO,KAAKN,GAAL,CAAS6B,UAAT,CAAoBC,IAApB,aAAoBA,IAApB,cAAoBA,IAApB,GAA4B,CAA5B,EAA+BC,IAA/B,aAA+BA,IAA/B,cAA+BA,IAA/B,GAAuC,CAAvC,EAA0CE,MAA1C,CAAP;EACD;;EAMDM,mBAAmB,GAAY;IAC7B,OAAO,IAAI1C,UAAJ,CACL,KAAKE,SADA,EAEL,KAAKA,SAAL,CAAeyC,oBAAf,CAAoC,KAAKjB,aAAL,EAApC,CAFK,CAAP;EAID;;AA/G2E"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Host,
|
1
|
+
import { Host, getEnum } from "./Host";
|
2
2
|
import { JsiSkImage } from "./JsiSkImage";
|
3
3
|
import { JsiSkData } from "./JsiSkData";
|
4
4
|
export class JsiSkImageFactory extends Host {
|
@@ -26,9 +26,9 @@ export class JsiSkImageFactory extends Host {
|
|
26
26
|
MakeImage(info, data, bytesPerRow) {
|
27
27
|
// see toSkImageInfo() from canvaskit
|
28
28
|
const image = this.CanvasKit.MakeImage({
|
29
|
-
alphaType:
|
29
|
+
alphaType: getEnum(this.CanvasKit.AlphaType, info.alphaType),
|
30
30
|
colorSpace: this.CanvasKit.ColorSpace.SRGB,
|
31
|
-
colorType:
|
31
|
+
colorType: getEnum(this.CanvasKit.ColorType, info.colorType),
|
32
32
|
height: info.height,
|
33
33
|
width: info.width
|
34
34
|
}, JsiSkData.fromValue(data), bytesPerRow);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["Host","
|
1
|
+
{"version":3,"names":["Host","getEnum","JsiSkImage","JsiSkData","JsiSkImageFactory","constructor","CanvasKit","MakeImageFromViewTag","viewTag","view","console","log","Promise","resolve","MakeImageFromEncoded","encoded","image","fromValue","MakeImage","info","data","bytesPerRow","alphaType","AlphaType","colorSpace","ColorSpace","SRGB","colorType","ColorType","height","width"],"sources":["JsiSkImageFactory.ts"],"sourcesContent":["import type { CanvasKit } from \"canvaskit-wasm\";\n\nimport type { SkData, ImageInfo, SkImage } from \"../types\";\nimport type { ImageFactory } from \"../types/Image/ImageFactory\";\n\nimport { Host, getEnum } from \"./Host\";\nimport { JsiSkImage } from \"./JsiSkImage\";\nimport { JsiSkData } from \"./JsiSkData\";\n\nexport class JsiSkImageFactory extends Host implements ImageFactory {\n constructor(CanvasKit: CanvasKit) {\n super(CanvasKit);\n }\n\n MakeImageFromViewTag(viewTag: number): Promise<SkImage | null> {\n const view = viewTag as unknown as HTMLElement;\n // TODO: Implement screenshot from view in React JS\n console.log(view);\n return Promise.resolve(null);\n }\n\n MakeImageFromEncoded(encoded: SkData) {\n const image = this.CanvasKit.MakeImageFromEncoded(\n JsiSkData.fromValue(encoded)\n );\n if (image === null) {\n return null;\n }\n return new JsiSkImage(this.CanvasKit, image);\n }\n\n MakeImage(info: ImageInfo, data: SkData, bytesPerRow: number) {\n // see toSkImageInfo() from canvaskit\n const image = this.CanvasKit.MakeImage(\n {\n alphaType: getEnum(this.CanvasKit.AlphaType, info.alphaType),\n colorSpace: this.CanvasKit.ColorSpace.SRGB,\n colorType: getEnum(this.CanvasKit.ColorType, info.colorType),\n height: info.height,\n width: info.width,\n },\n JsiSkData.fromValue(data),\n bytesPerRow\n );\n if (image === null) {\n return null;\n }\n return new JsiSkImage(this.CanvasKit, image);\n }\n}\n"],"mappings":"AAKA,SAASA,IAAT,EAAeC,OAAf,QAA8B,QAA9B;AACA,SAASC,UAAT,QAA2B,cAA3B;AACA,SAASC,SAAT,QAA0B,aAA1B;AAEA,OAAO,MAAMC,iBAAN,SAAgCJ,IAAhC,CAA6D;EAClEK,WAAW,CAACC,SAAD,EAAuB;IACh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eb, 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,EAAb,EAAyBC,KAAzB,EAAsD;IAC9D,MAAMC,WAAW,GACfD,KAAK,KAAK,IAAV,GAAiB,IAAjB,GAAwBR,gBAAgB,CAACU,SAAjB,CAAwCF,KAAxC,CAD1B;IAEA,MAAMG,MAAM,GAAG,KAAKP,SAAL,CAAeQ,WAAf,CAA2BP,UAA3B,CAAsCC,EAAtC,EAA0CC,EAA1C,EAA8CE,WAA9C,CAAf;IACA,OAAO,IAAIT,gBAAJ,CAAqB,KAAKI,SAA1B,EAAqCO,MAArC,CAAP;EACD;;EAEDE,mBAAmB,CACjBC,QADiB,EAEjBC,QAFiB,EAGjBC,KAHiB,EAIjBC,GAJiB,EAKjBT,KALiB,EAMF;IACf,MAAMC,WAAW,GACfD,KAAK,KAAK,IAAV,GAAiB,IAAjB,GAAwBR,gBAAgB,CAACU,SAAjB,CAAwCF,KAAxC,CAD1B;IAEA,MAAMG,MAAM,GAAG,KAAKP,SAAL,CAAeQ,WAAf,CAA2BC,mBAA3B,CACbd,MAAM,CAACe,QAAD,CADO,EAEbf,MAAM,CAACgB,QAAD,CAFO,EAGbC,KAHa,EAIbhB,gBAAgB,CAACU,SAAjB,CAA2BO,GAA3B,CAJa,EAKbR,WALa,CAAf;IAOA,OAAO,IAAIT,gBAAJ,CAAqB,KAAKI,SAA1B,EAAqCO,MAArC,CAAP;EACD;;EAEDO,UAAU,CAACC,MAAD,EAAmBC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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,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,EAAb,EAAyBC,KAAzB,EAAsD;IAC9D,MAAMC,WAAW,GACfD,KAAK,KAAK,IAAV,GAAiB,IAAjB,GAAwBR,gBAAgB,CAACU,SAAjB,CAAwCF,KAAxC,CAD1B;IAEA,MAAMG,MAAM,GAAG,KAAKP,SAAL,CAAeQ,WAAf,CAA2BP,UAA3B,CAAsCC,EAAtC,EAA0CC,EAA1C,EAA8CE,WAA9C,CAAf;IACA,OAAO,IAAIT,gBAAJ,CAAqB,KAAKI,SAA1B,EAAqCO,MAArC,CAAP;EACD;;EAEDE,mBAAmB,CACjBC,QADiB,EAEjBC,QAFiB,EAGjBC,KAHiB,EAIjBC,GAJiB,EAKjBT,KALiB,EAMF;IACf,MAAMC,WAAW,GACfD,KAAK,KAAK,IAAV,GAAiB,IAAjB,GAAwBR,gBAAgB,CAACU,SAAjB,CAAwCF,KAAxC,CAD1B;IAEA,MAAMG,MAAM,GAAG,KAAKP,SAAL,CAAeQ,WAAf,CAA2BC,mBAA3B,CACbd,OAAO,CAAC,KAAKK,SAAL,CAAec,YAAhB,EAA8BJ,QAA9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CAAwCgC,UAAxC,CAHN;;IAIA,IAAIR,QAAJ,EAAc;MACZ,MAAM,IAAIpC,qBAAJ,CACJ,iEADI,CAAN;IAGD;;IACD,MAAMa,MAAM,GAAG,KAAKP,SAAL,CAAeQ,WAAf,CAA2B4B,SAA3B,CACbzC,OAAO,CAAC,KAAKK,SAAL,CAAeuC,SAAhB,EAA2BlB,IAA3B,CADM,EAEbzB,gBAAgB,CAACU,SAAjB,CAA2B+B,UAA3B,CAFa,EAGbhC,WAHa,CAAf;IAKA,OAAO,IAAIT,gBAAJ,CAAqB,KAAKI,SAA1B,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
|
2
|
+
import { type Matrix3, type Matrix4, type SkMatrix } 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: SkMatrix): this;
|
9
|
+
concat(matrix: SkMatrix | number[] | Matrix4 | Matrix3): 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
|
|