Package icyllis.arc3d.sketch.shaders
Class ImageShader
java.lang.Object
icyllis.arc3d.core.RefCnt
icyllis.arc3d.sketch.shaders.ImageShader
- All Implemented Interfaces:
RefCounted
,Shader
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal @SharedPtr Image
final SamplingOptions
final Rect2f
final int
final int
Fields inherited from interface icyllis.arc3d.sketch.shaders.Shader
LOCAL_MATRIX_AFTER, LOCAL_MATRIX_BEFORE, LOCAL_MATRIX_REPLACE, TILE_MODE_CLAMP, TILE_MODE_DECAL, TILE_MODE_MIRROR, TILE_MODE_REPEAT
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Override this method to invoke de-allocation of the underlying resource.getImage()
int
int
boolean
isOpaque()
Returns true if the shader is guaranteed to produce only opaque colors, subject to the Paint using the shader to apply an opaque alpha value.boolean
A return value of true means that its ref/unref is unnecessary, for example, they are just no op.static @Nullable @SharedPtr Shader
make
(@SharedPtr Image image, int tileModeX, int tileModeY, SamplingOptions sampling, @Nullable Matrixc localMatrix) static float[]
makeCubicMatrix
(float B, float C) Create a 4x4 row major matrix for Mitchell–Netravali filters.static @Nullable @SharedPtr Shader
makeSubset
(@SharedPtr Image image, Rect2fc subset, int tileModeX, int tileModeY, SamplingOptions sampling, @Nullable Matrixc localMatrix) static @NonNull Rect2f
preparePaintForDrawImageRect
(@RawPtr Image image, SamplingOptions sampling, Rect2fc src, Rect2fc dst, boolean strictSubset, Paint paint) Methods inherited from class icyllis.arc3d.core.RefCnt
create, create, getRefCnt, getRefCntAcquire, getRefCntVolatile, move, move, ref, unique, unref
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface icyllis.arc3d.sketch.shaders.Shader
makeWithLocalMatrix, ref, unref
-
Field Details
-
mImage
-
mSampling
-
mTileModeX
public final int mTileModeX -
mTileModeY
public final int mTileModeY -
mSubset
-
-
Method Details
-
make
@SharedPtr public static @Nullable @SharedPtr Shader make(@SharedPtr @SharedPtr Image image, int tileModeX, int tileModeY, SamplingOptions sampling, @Nullable Matrixc localMatrix) -
makeSubset
@SharedPtr public static @Nullable @SharedPtr Shader makeSubset(@SharedPtr @SharedPtr Image image, Rect2fc subset, int tileModeX, int tileModeY, SamplingOptions sampling, @Nullable Matrixc localMatrix) -
deallocate
protected void deallocate()Description copied from class:RefCnt
Override this method to invoke de-allocation of the underlying resource.- Specified by:
deallocate
in classRefCnt
-
isOpaque
public boolean isOpaque()Description copied from interface:Shader
Returns true if the shader is guaranteed to produce only opaque colors, subject to the Paint using the shader to apply an opaque alpha value. Subclasses should override this to allow some optimizations. -
getImage
-
getSampling
-
getTileModeX
public int getTileModeX() -
getTileModeY
public int getTileModeY() -
getSubset
-
isTriviallyCounted
public boolean isTriviallyCounted()Description copied from interface:Shader
A return value of true means that its ref/unref is unnecessary, for example, they are just no op. So callers can perform some optimizations. Subclass can override this method to indicate that an instance is trivially counted. For the same instance, the return value of this method must remain unchanged.- Specified by:
isTriviallyCounted
in interfaceShader
-
makeCubicMatrix
public static float[] makeCubicMatrix(float B, float C) Create a 4x4 row major matrix for Mitchell–Netravali filters. -
preparePaintForDrawImageRect
-