Package com.day.image

Class MultitoneOp

    • Constructor Detail

      • MultitoneOp

        public MultitoneOp​(Color color,
                           RenderingHints hints)
        Creates a MultitoneOp containing a standard color curve with the single color. This creates a monotone result. This is a convenience constructor which is the same as calling MultitoneOp(Color[], RenderingHints) with an array containing the single color directly.
        Parameters:
        color - The color to use in the operation
        hints - the specified RenderingHints, or null
      • MultitoneOp

        public MultitoneOp​(Color[] colors,
                           RenderingHints hints)
        Creates a MultitoneOp 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 operation
        hints - the specified RenderingHints, or null
        Throws:
        NullPointerException - if the colors array is null or if any of the color values is null.
      • MultitoneOp

        public MultitoneOp​(ColorCurve[] colorCurves,
                           RenderingHints hints)
        Creates a MultitoneOp from the given ColorCurve objects.
        Parameters:
        colorCurves - The ColorCurve objects from which to create this MultitoneOp
        hints - the specified RenderingHints, or null
        Throws:
        NullPointerException - if the colorCurves parameter or any of the entries is null.
    • Method Detail

      • filter

        public BufferedImage filter​(BufferedImage src,
                                    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 interface BufferedImageOp
        Overrides:
        filter in class AbstractBufferedImageOp
        Parameters:
        src - The src image to be filtered.
        dst - The dest image into which to place the resized image. This may be null 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:
        NullPointerException - if the src image is null.