Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Package Functions | List of all members
org.skia.jetski.ImageFilter Class Reference

Public Member Functions

void release ()
 

Static Public Member Functions

static ImageFilter distantLitDiffuse (float x, float y, float z, Color c, float surfaceScale, float kd, @Nullable ImageFilter input)
 
static ImageFilter blur (float sigmaX, float sigmaY, TileMode tileMode, float left, float top, float right, float bottom, @Nullable ImageFilter input)
 
static ImageFilter dropShadow (float dx, float dy, float sigmaX, float sigmaY, Color c, @Nullable ImageFilter input)
 
static ImageFilter blend (BlendMode blendMode, @Nullable ImageFilter background, @Nullable ImageFilter foreground)
 
static ImageFilter image (@NonNull Image image)
 

Protected Member Functions

void finalize () throws Throwable
 

Package Functions

long getNativeInstance ()
 

Detailed Description

Definition at line 13 of file ImageFilter.java.

Member Function Documentation

◆ blend()

static ImageFilter org.skia.jetski.ImageFilter.blend ( BlendMode  blendMode,
@Nullable ImageFilter  background,
@Nullable ImageFilter  foreground 
)
inlinestatic

Definition at line 82 of file ImageFilter.java.

83 {
84 long nativeBackground = 0;
85 long nativeForeground = 0;
86 if (background != null) {
87 nativeBackground = background.getNativeInstance();
88 }
89 if (foreground != null) {
90 nativeForeground = foreground.getNativeInstance();
91 }
92 return new ImageFilter(nBlend(blendMode.nativeInt, nativeBackground, nativeForeground));
93 }

◆ blur()

static ImageFilter org.skia.jetski.ImageFilter.blur ( float  sigmaX,
float  sigmaY,
TileMode  tileMode,
float  left,
float  top,
float  right,
float  bottom,
@Nullable ImageFilter  input 
)
inlinestatic

Create a filter that calculates the diffuse illumination from a distant light source, interpreting the alpha channel of the input as the height profile of the surface (to approximate normal vectors).

Parameters
sigmaXThe Gaussian sigma value for blurring along the X axis.
sigmaYThe Gaussian sigma value for blurring along the Y axis.
tileModeThe tile mode applied at edges
leftLeft, top, right, bottom are used to make the crop rect
inputThe input filter that is blurred, uses source bitmap if this is null.

Definition at line 51 of file ImageFilter.java.

53 {
54 long nativeInput = 0;
55 if (input != null) {
56 nativeInput = input.getNativeInstance();
57 }
58 return new ImageFilter(nBlur(sigmaX, sigmaY, tileMode.nativeInt,
59 left, top, right, bottom, nativeInput));
60 }
static bool left(const SkPoint &p0, const SkPoint &p1)
static bool right(const SkPoint &p0, const SkPoint &p1)

◆ distantLitDiffuse()

static ImageFilter org.skia.jetski.ImageFilter.distantLitDiffuse ( float  x,
float  y,
float  z,
Color  c,
float  surfaceScale,
float  kd,
@Nullable ImageFilter  input 
)
inlinestatic

Create a filter that calculates the diffuse illumination from a distant light source, interpreting the alpha channel of the input as the height profile of the surface (to approximate normal vectors).

Parameters
x,y,zThe direction to the distance light.
cThe color of the diffuse light source.
surfaceScaleScale factor to transform from alpha values to physical height.
kdDiffuse reflectance coefficient.
inputThe input filter that defines surface normals (as alpha), or uses the source bitmap when null.

Definition at line 31 of file ImageFilter.java.

32 {
33 long nativeInput = 0;
34 if (input != null) {
35 nativeInput = input.getNativeInstance();
36 }
37 return new ImageFilter(nDistantLitDiffuse(x, y, z, c.r(), c.g(), c.b(),
38 surfaceScale, kd, nativeInput));
39 }
double y
double x

◆ dropShadow()

static ImageFilter org.skia.jetski.ImageFilter.dropShadow ( float  dx,
float  dy,
float  sigmaX,
float  sigmaY,
Color  c,
@Nullable ImageFilter  input 
)
inlinestatic

Create a filter that draws a drop shadow under the input content. This filter produces an image that includes the inputs' content.

Parameters
dxThe X offset of the shadow.
dyThe Y offset of the shadow.
sigmaXThe blur radius for the shadow, along the X axis.
sigmaYThe blur radius for the shadow, along the Y axis.
cThe color of the drop shadow.
inputThe input filter, or will use the source bitmap if this is null.

Definition at line 72 of file ImageFilter.java.

74 {
75 long nativeInput = 0;
76 if (input != null) {
77 nativeInput = input.getNativeInstance();
78 }
79 return new ImageFilter(nDropShadow(dx, dy, sigmaX, sigmaY, c.r(), c.g(), c.b(), nativeInput));
80 }

◆ finalize()

void org.skia.jetski.ImageFilter.finalize ( ) throws Throwable
inlineprotected

Definition at line 108 of file ImageFilter.java.

108 {
109 release();
110 }

◆ getNativeInstance()

long org.skia.jetski.ImageFilter.getNativeInstance ( )
inlinepackage

Definition at line 113 of file ImageFilter.java.

113{ return mNativeInstance; }

◆ image()

static ImageFilter org.skia.jetski.ImageFilter.image ( @NonNull Image  image)
inlinestatic

Definition at line 95 of file ImageFilter.java.

95 {
96 return new ImageFilter(nImage(image.getNativeInstance()));
97 }
sk_sp< SkImage > image
Definition examples.cpp:29

◆ release()

void org.skia.jetski.ImageFilter.release ( )
inline

Releases any resources associated with this Shader.

Definition at line 102 of file ImageFilter.java.

102 {
103 nRelease(mNativeInstance);
104 mNativeInstance = 0;
105 }

The documentation for this class was generated from the following file: