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
Modifier and TypeMethodDescriptionstatic <P extends ContourPlot.PixelBase,T>
ContourPlot.PixelManipulator<P, T> fromConverterAndConsumer(ContourPlot.PixelConvertingSpliterator.PixelConverter<P, T> converter, Consumer<T> action) Creates a PixelManipulator from aContourPlot.PixelConvertingSpliterator.PixelConverterand correspondingConsumer(action).Returns the action performed by this manipulatorReturns the converter that converts a pixel to the element accepted by this manipulators action (and the element back to the pixel).
-
Method Details
-
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
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, Consumer<T> action) Creates a PixelManipulator from aContourPlot.PixelConvertingSpliterator.PixelConverterand correspondingConsumer(action).- Parameters:
converter- of the PixelManipulatoraction- of the Manipulator- Returns:
- a PixelManipulator consisting of the specified converter and action.
-