8package org.skia.jetski;
10import java.lang.IllegalArgumentException;
14 long make(
float[]
colors,
float[]
pos,
int tileMode,
long nativeLocalMatrix);
19 super(makeGradient(
colors,
pos, tm, lm, gf));
24 super(makeGradient(
colors,
pos, tm, lm, gf));
30 throw new IllegalArgumentException(
"Expecting equal-length colors and positions.");
33 float[] fcolors =
new float[colors.length * 4];
36 fcolors[4*
i + 0] = ((
colors[
i] >> 16) & 0xff) / 255.0f;
37 fcolors[4*
i + 1] = ((
colors[
i] >> 8) & 0xff) / 255.0f;
38 fcolors[4*
i + 2] = ((
colors[
i] >> 0) & 0xff) / 255.0f;
39 fcolors[4*
i + 3] = ((
colors[
i] >> 24) & 0xff) / 255.0f;
42 return gf.make(fcolors,
pos, tm.ordinal(), lm !=
null ? lm.getNativeInstance() : 0);
47 if (
colors.length % 4 != 0) {
48 throw new IllegalArgumentException(
"Colors length must be a multiple of 4.");
52 throw new IllegalArgumentException(
"Colors must be 4x positions length.");
55 return gf.make(
colors,
pos, tm.ordinal(), lm !=
null ? lm.getNativeInstance() : 0);
Gradient(float[] colors, float[] pos, TileMode tm, Matrix lm, GradientFactory gf)
Gradient(int[] colors, float[] pos, TileMode tm, Matrix lm, GradientFactory gf)
sk_sp< SkShader >(* GradientFactory)(SkTileMode tm)
long make(float[] colors, float[] pos, int tileMode, long nativeLocalMatrix)
PODArray< SkColor > colors
SkTileMode TileMode(jint tm)
SK_API sk_sp< PrecompileColorFilter > Matrix()