| 5 | import org.jetbrains.skija.impl.*; |
| 6 | |
| 7 | public class MaskFilter extends RefCnt { |
| 8 | static { Library.staticLoad(); } |
| 9 | |
| 10 | public static MaskFilter makeBlur(FilterBlurMode mode, float sigma) { |
| 11 | return makeBlur(mode, sigma, true); |
| 12 | } |
| 13 | |
| 14 | public static MaskFilter makeBlur(FilterBlurMode mode, float sigma, boolean respectCTM) { |
| 15 | Stats.onNativeCall(); |
| 16 | return new MaskFilter(_nMakeBlur(mode.ordinal(), sigma, respectCTM)); |
| 17 | } |
| 18 | |
| 19 | public static MaskFilter makeShader(Shader s) { |
| 20 | try { |
| 21 | Stats.onNativeCall(); |
| 22 | return new MaskFilter(_nMakeShader(Native.getPtr(s))); |
| 23 | } finally { |
| 24 | Reference.reachabilityFence(s); |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | public static MaskFilter makeTable(byte[] table) { |
| 29 | Stats.onNativeCall(); |
| 30 | return new MaskFilter(_nMakeTable(table)); |
| 31 | } |
| 32 | |
| 33 | public static MaskFilter makeGamma(float gamma) { |
| 34 | Stats.onNativeCall(); |
| 35 | return new MaskFilter(_nMakeGamma(gamma)); |
| 36 | } |
| 37 | |
| 38 | public static MaskFilter makeClip(int min, int max) { |
| 39 | Stats.onNativeCall(); |
| 40 | return new MaskFilter(_nMakeClip((byte) min, (byte) max)); |
| 41 | } |
| 42 | |
| 43 | // public MaskFilter makeEmboss(float blurSigma, float lightDirectionX, float lightDirectionY, float lightDirectionZ, int lightPad, int lightAmbient, int lightSpecular) { |
| 44 | // Native.onNativeCall(); |
| 45 | // return new MaskFilter(_nMakeEmboss(blurSigma, lightDirectionX, lightDirectionY, lightDirectionZ, lightPad, lightAmbient, lightSpecular)); |
| 46 | // } |
| 47 | |
| 48 | @ApiStatus.Internal |
| 49 | public MaskFilter(long ptr) { |
| 50 | super(ptr); |
| 51 | } |
| 52 | |
| 53 | public static native long _nMakeBlur(int mode, float sigma, boolean respectCTM); |
| 54 | public static native long _nMakeShader(long shaderPtr); |
| 55 | // public static native long _nMakeEmboss(float sigma, float x, float y, float z, int pad, int ambient, int specular); |
| 56 | public static native long _nMakeTable(byte[] table); |
| 57 | public static native long _nMakeGamma(float gamma); |
| 58 | public static native long _nMakeClip(byte min, byte max); |
| 59 | } |
nothing calls this directly
no test coverage detected