Package com.day.image
Class MultitoneOp
- java.lang.Object
-
- com.day.image.AbstractBufferedImageOp
-
- com.day.image.MultitoneOp
-
- All Implemented Interfaces:
java.awt.image.BufferedImageOp
public class MultitoneOp extends AbstractBufferedImageOp
TheMultitoneOp
class implements similar functionality as the Photoshop Duplex function. It allows to specify one or more colors and tonality curves for each color.The
filter(java.awt.image.BufferedImage, java.awt.image.BufferedImage)
method expects to get a grayscale image to which the colorization operation is applied.- Since:
- echidna
-
-
Constructor Summary
Constructors Constructor Description MultitoneOp(ColorCurve[] colorCurves, java.awt.RenderingHints hints)
Creates aMultitoneOp
from the givenColorCurve
objects.MultitoneOp(java.awt.Color[] colors, java.awt.RenderingHints hints)
Creates aMultitoneOp
containing a standard color curve with more than one color.MultitoneOp(java.awt.Color color, java.awt.RenderingHints hints)
Creates aMultitoneOp
containing a standard color curve with the single color.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.image.BufferedImage
filter(java.awt.image.BufferedImage src, java.awt.image.BufferedImage dst)
Performs the multi tone operation.-
Methods inherited from class com.day.image.AbstractBufferedImageOp
createCompatibleDestImage, getBounds2D, getPoint2D, getRenderingHints
-
-
-
-
Constructor Detail
-
MultitoneOp
public MultitoneOp(java.awt.Color color, java.awt.RenderingHints hints)
Creates aMultitoneOp
containing a standard color curve with the single color. This creates a monotone result. This is a convenience constructor which is the same as callingMultitoneOp(Color[], RenderingHints)
with an array containing the single color directly.- Parameters:
color
- The color to use in the operationhints
- the specifiedRenderingHints
, ornull
-
MultitoneOp
public MultitoneOp(java.awt.Color[] colors, java.awt.RenderingHints hints)
Creates aMultitoneOp
containing a standard color curve with more than one color. This creates a monotone result, where the color is a mixture of the input colors.- Parameters:
colors
- The colors to use in the operationhints
- the specifiedRenderingHints
, ornull
- Throws:
java.lang.NullPointerException
- if the colors array isnull
or if any of the color values isnull
.
-
MultitoneOp
public MultitoneOp(ColorCurve[] colorCurves, java.awt.RenderingHints hints)
Creates aMultitoneOp
from the givenColorCurve
objects.- Parameters:
colorCurves
- TheColorCurve
objects from which to create thisMultitoneOp
hints
- the specifiedRenderingHints
, ornull
- Throws:
java.lang.NullPointerException
- if the colorCurves parameter or any of the entries isnull
.
-
-
Method Detail
-
filter
public java.awt.image.BufferedImage filter(java.awt.image.BufferedImage src, java.awt.image.BufferedImage dst)
Performs the multi tone operation. Note that the source image is expected to be a gray scale image and the destination image must support color images.Note: This class supports filtering within an image, that is, calling this method with
src == dst
is legal.- Specified by:
filter
in interfacejava.awt.image.BufferedImageOp
- Overrides:
filter
in classAbstractBufferedImageOp
- Parameters:
src
- The src image to be filtered.dst
- The dest image into which to place the resized image. This may benull
in which case a new image with the correct size will be created.- Returns:
- The newly created image (if dest was
null
) or dest into which the resized src image has been drawn. - Throws:
java.lang.NullPointerException
- if the src image isnull
.
-
-