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 Imagefinal SamplingOptionsfinal Rect2ffinal intfinal intFields 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 voidOverride this method to invoke de-allocation of the underlying resource.getImage()intintbooleanisOpaque()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.booleanA return value of true means that its ref/unref is unnecessary, for example, they are just no op.static @Nullable @SharedPtr Shadermake(@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 ShadermakeSubset(@SharedPtr Image image, Rect2fc subset, int tileModeX, int tileModeY, SamplingOptions sampling, @Nullable Matrixc localMatrix) static @NonNull Rect2fpreparePaintForDrawImageRect(@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, unrefMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:RefCntOverride this method to invoke de-allocation of the underlying resource.- Specified by:
deallocatein classRefCnt
-
isOpaque
public boolean isOpaque()Description copied from interface:ShaderReturns 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:ShaderA 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:
isTriviallyCountedin interfaceShader
-
makeCubicMatrix
public static float[] makeCubicMatrix(float B, float C) Create a 4x4 row major matrix for Mitchell–Netravali filters. -
preparePaintForDrawImageRect
-