Package gov.nih.mipav.model.algorithms
Interface ContourPlot.PixelManipulator<P extends ContourPlot.PixelBase,T>
-
- Type Parameters:
P
- the pixel type of the converter (PixelBase or an implementation of it)T
- the element type of the converter (the type a pixel is converted to before applying the action)
- Enclosing class:
- ContourPlot
public static interface ContourPlot.PixelManipulator<P extends ContourPlot.PixelBase,T>
The PixelManipulator interface defines an action to be performed on a pixel. The action however is performed on a different representation of the pixel which is given by the manipulators converter.This works the following way:
- convert pixel to element using the converter
- apply the action on the element
- convert the element back to pixel using the converter
This is used with an image's forEach method (see
ContourPlot.ImgBase.forEach(PixelManipulator)
)- Since:
- 2.0
- Author:
- hageldave
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static <P extends ContourPlot.PixelBase,T>
ContourPlot.PixelManipulator<P,T>fromConverterAndConsumer(ContourPlot.PixelConvertingSpliterator.PixelConverter<P,T> converter, java.util.function.Consumer<T> action)
Creates a PixelManipulator from aContourPlot.PixelConvertingSpliterator.PixelConverter
and correspondingConsumer
(action).java.util.function.Consumer<T>
getAction()
Returns the action performed by this manipulatorContourPlot.PixelConvertingSpliterator.PixelConverter<P,T>
getConverter()
Returns the converter that converts a pixel to the element accepted by this manipulators action (and the element back to the pixel).
-
-
-
Method Detail
-
getConverter
ContourPlot.PixelConvertingSpliterator.PixelConverter<P,T> getConverter()
Returns the converter that converts a pixel to the element accepted by this manipulators action (and the element back to the pixel).- Returns:
- this manipulator's converter
-
getAction
java.util.function.Consumer<T> getAction()
Returns the action performed by this manipulator- Returns:
- this manipulator's action
-
fromConverterAndConsumer
static <P extends ContourPlot.PixelBase,T> ContourPlot.PixelManipulator<P,T> fromConverterAndConsumer(ContourPlot.PixelConvertingSpliterator.PixelConverter<P,T> converter, java.util.function.Consumer<T> action)
Creates a PixelManipulator from aContourPlot.PixelConvertingSpliterator.PixelConverter
and correspondingConsumer
(action).- Parameters:
converter
- of the PixelManipulatoraction
- of the Manipulator- Returns:
- a PixelManipulator consisting of the specified converter and action.
-
-