Interface PointwiseOperation.Unary<T>
- All Superinterfaces:
PointwiseOperation<T>
- All Known Implementing Classes:
CachedConversionOperation,ChannelOperation,ColorToPaletteOperation,PaletteToColorOperation
- Enclosing interface:
PointwiseOperation<T>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public static interface PointwiseOperation.Unary<T>
extends PointwiseOperation<T>
A pointwise operation that can be applied to a single image.
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.lukebemish.dynamicassetgenerator.api.colors.operations.PointwiseOperation
PointwiseOperation.Any<T>, PointwiseOperation.Binary<T>, PointwiseOperation.Ternary<T>, PointwiseOperation.Tertiary<T>, PointwiseOperation.Unary<T> -
Method Summary
Modifier and TypeMethodDescriptiondefault Tapply(int[] colors, boolean[] inBounds) Applies this operation to the given colors and in-bounds flags.apply(int color, boolean isInBounds) static <T> PointwiseOperation.Unary<T> chain(PointwiseOperation.Unary<Integer> first, PointwiseOperation.Unary<T> then) default intstatic PointwiseOperation.Unary<Integer> identity()
-
Method Details
-
apply
-
expectedImages
default int expectedImages()- Specified by:
expectedImagesin interfacePointwiseOperation<T>- Returns:
- how many images this operation expects to be applied to. Should return -1 if the operation can be applied to any number of images
-
apply
Description copied from interface:PointwiseOperationApplies this operation to the given colors and in-bounds flags.- Specified by:
applyin interfacePointwiseOperation<T>- Parameters:
colors- the colors of the images to apply this operation to at the given pointinBounds- whether each image is in-bounds at the given point. At least one image will always be in-bounds- Returns:
- the data generated at this point
-
identity
- Returns:
- a new unary operation that always returns the value it is provided
-
chain
static <T> PointwiseOperation.Unary<T> chain(PointwiseOperation.Unary<Integer> first, PointwiseOperation.Unary<T> then) - Returns:
- a new unary operation that applies first one operation, then another
-