Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | Protected Member Functions | Package Functions | List of all members
org.skia.jetski.Image Class Reference

Public Member Functions

int getWidth ()
 
int getHeight ()
 
Shader makeShader (TileMode tmx, TileMode tmy, SamplingOptions sampling)
 
Shader makeShader (TileMode tmx, TileMode tmy, SamplingOptions sampling, @Nullable Matrix localMatrix)
 
void release ()
 

Static Public Member Functions

static Image fromEncoded (byte[] encodedData)
 
static Image fromStream (InputStream encodedStream) throws java.io.IOException
 

Protected Member Functions

void finalize () throws Throwable
 

Package Functions

 Image (long nativeInstance)
 
long getNativeInstance ()
 

Detailed Description

Definition at line 13 of file Image.java.

Constructor & Destructor Documentation

◆ Image()

org.skia.jetski.Image.Image ( long  nativeInstance)
inlinepackage

Definition at line 75 of file Image.java.

75 {
76 mNativeInstance = nativeInstance;
77 }

Member Function Documentation

◆ finalize()

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

Definition at line 70 of file Image.java.

70 {
71 release();
72 }

◆ fromEncoded()

static Image org.skia.jetski.Image.fromEncoded ( byte[]  encodedData)
inlinestatic

Construct an Image from encoded (PNG, GIF, etc) data.

Returns null for unsupported formats or invalid data.

Definition at line 21 of file Image.java.

21 {
22 long nativeImage = nCreate(encodedData);
23 return nativeImage != 0
24 ? new Image(nativeImage)
25 : null;
26 }
Image(long nativeInstance)
Definition: Image.java:75

◆ fromStream()

static Image org.skia.jetski.Image.fromStream ( InputStream  encodedStream) throws java.io.IOException
inlinestatic

Construct an Image from an encoded data stream.

Returns null for unsupported formats or invalid stream.

Definition at line 33 of file Image.java.

33 {
34 byte[] encodedData = new byte[encodedStream.available()];
35 encodedStream.read(encodedData);
36
37 return fromEncoded(encodedData);
38 }
static Image fromEncoded(byte[] encodedData)
Definition: Image.java:21

◆ getHeight()

int org.skia.jetski.Image.getHeight ( )
inline

Definition at line 44 of file Image.java.

44 {
45 return nGetHeight(mNativeInstance);
46 }

◆ getNativeInstance()

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

Definition at line 80 of file Image.java.

80{ return mNativeInstance; }

◆ getWidth()

int org.skia.jetski.Image.getWidth ( )
inline

Definition at line 40 of file Image.java.

40 {
41 return nGetWidth(mNativeInstance);
42 }

◆ makeShader() [1/2]

Shader org.skia.jetski.Image.makeShader ( TileMode  tmx,
TileMode  tmy,
SamplingOptions  sampling 
)
inline

Definition at line 48 of file Image.java.

48 {
49 return makeShader(tmx, tmy, sampling, null);
50 }
Shader makeShader(TileMode tmx, TileMode tmy, SamplingOptions sampling)
Definition: Image.java:48
SkSamplingOptions sampling
Definition: SkRecords.h:337
SkTileMode tmy
SkTileMode tmx

◆ makeShader() [2/2]

Shader org.skia.jetski.Image.makeShader ( TileMode  tmx,
TileMode  tmy,
SamplingOptions  sampling,
@Nullable Matrix  localMatrix 
)
inline

Definition at line 52 of file Image.java.

53 {
54 long nativeMatrix = localMatrix != null ? localMatrix.getNativeInstance() : 0;
55 return new Shader(nMakeShader(mNativeInstance, tmx.nativeInt, tmy.nativeInt,
56 sampling.getNativeDesc(),
57 sampling.getCubicCoeffB(), sampling.getCubicCoeffC(),
58 nativeMatrix));
59 }

◆ release()

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

Releases any resources associated with this Paint.

Definition at line 64 of file Image.java.

64 {
65 nRelease(mNativeInstance);
66 mNativeInstance = 0;
67 }

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