Package icyllis.arc3d.core.shaders
Interface Shader
- All Superinterfaces:
RefCounted
- All Known Implementing Classes:
AngularGradient
,BilinearGradient
,BlendShader
,Color4fShader
,ColorShader
,EmptyShader
,Gradient1DShader
,Gradient2DShader
,GradientShader
,ImageShader
,LinearGradient
,LocalMatrixShader
,RadialGradient
public sealed interface Shader
extends RefCounted
permits EmptyShader, ColorShader, Color4fShader, BlendShader, GradientShader, ImageShader, LocalMatrixShader
Shaders specify the source color(s) for what is being drawn. If a paint
has no shader, then the paint's color is used. If the paint has a
shader, then the shader's color(s) are use instead, but they are
modulated by the paint's alpha. This makes it easy to create a shader
once (e.g. bitmap tiling or gradient) and then change its transparency
w/o having to modify the original shader... only the paint's alpha needs
to be modified.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Replicate the edge color if the shader draws outside of its original bounds.static final int
Only draw within the original domain, return transparent-black everywhere else.static final int
Repeat the shader's image horizontally and vertically, alternating mirror images so that adjacent images always seam.static final int
Repeat the shader's image horizontally and vertically. -
Method Summary
Modifier and TypeMethodDescriptiondefault 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.default @SharedPtr Shader
makeWithLocalMatrix
(Matrixc localMatrix) Return a shader that will apply the specified localMatrix to this shader.Methods inherited from interface icyllis.arc3d.core.RefCounted
ref, unref
-
Field Details
-
TILE_MODE_REPEAT
static final int TILE_MODE_REPEATRepeat the shader's image horizontally and vertically.- See Also:
-
TILE_MODE_MIRROR
static final int TILE_MODE_MIRRORRepeat the shader's image horizontally and vertically, alternating mirror images so that adjacent images always seam.- See Also:
-
TILE_MODE_CLAMP
static final int TILE_MODE_CLAMPReplicate the edge color if the shader draws outside of its original bounds.- See Also:
-
TILE_MODE_DECAL
static final int TILE_MODE_DECALOnly draw within the original domain, return transparent-black everywhere else.- See Also:
-
-
Method Details
-
isOpaque
default 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. Subclasses should override this to allow some optimizations. -
makeWithLocalMatrix
Return a shader that will apply the specified localMatrix to this shader. The specified matrix will be applied AFTER any matrix associated with this shader.
-