Package icyllis.arc3d.core.effects
Interface ColorFilter
- All Superinterfaces:
RefCounted
- All Known Implementing Classes:
BlendModeColorFilter,ColorMatrixColorFilter,ComposeColorFilter
public sealed interface ColorFilter
extends RefCounted
permits BlendModeColorFilter, ColorMatrixColorFilter, ComposeColorFilter
ColorFilters are optional objects in the drawing pipeline. When present in
a paint, they are called with the "src" colors, and return new colors, which
are then passed onto the next stage (either ImageFilter or Blender).
All subclasses are required to be reentrant-safe : it must be legal to share the same instance between several threads.
-
Method Summary
Modifier and TypeMethodDescriptiondefault @SharedPtr ColorFilterandThen(@SharedPtr ColorFilter after) Returns a composed color filter that first appliesthisfilter and then applies the after filter.default @SharedPtr ColorFiltercompose(@SharedPtr ColorFilter before) Returns a composed color filter that first applies the before filter and then appliesthisfilter.default intfilterColor(int col) Applies this color filter with ARGB color, un-premultiplied.voidfilterColor4f(float[] col, float[] out, ColorSpace dstCS) Applies this color filter with RGBA colors.default booleanReturns the flags for this filter.Methods inherited from interface icyllis.arc3d.core.RefCounted
ref, unref
-
Method Details
-
isAlphaUnchanged
default boolean isAlphaUnchanged()Returns the flags for this filter. Override in subclasses to return custom flags. -
filterColor
Applies this color filter with ARGB color, un-premultiplied.- Parameters:
col- base color- Returns:
- resulting color
-
filterColor4f
Applies this color filter with RGBA colors. col and out store premultiplied R,G,B,A components from index 0 to 3. col and out can be the same pointer. col is read-only, out may be written multiple times.- Parameters:
col- base colorout- resulting colordstCS- destination color space
-
compose
@Nonnull @SharedPtr default @SharedPtr ColorFilter compose(@Nullable @SharedPtr @SharedPtr ColorFilter before) Returns a composed color filter that first applies the before filter and then appliesthisfilter.- Parameters:
before- the filter to apply before this filter is applied, can be null- Returns:
- a composed color filter
-
andThen
@Nonnull @SharedPtr default @SharedPtr ColorFilter andThen(@Nullable @SharedPtr @SharedPtr ColorFilter after) Returns a composed color filter that first appliesthisfilter and then applies the after filter.- Parameters:
after- the filter to apply after this filter is applied, can be null- Returns:
- a composed color filter
-