Java BufferedImage Operation offset(final BufferedImage image, final float[] scales, final float[] offsets)

Here you can find the source of offset(final BufferedImage image, final float[] scales, final float[] offsets)

Description

Performs a rescale operation on the image's color components.

License

Open Source License

Parameter

Parameter Description
image The image to be adjusted.
scales An array of scale operations to be performed on the image's color components.
offsets An array of offset operations to be performed on the image's color components.

Return

The modified image after applying the given adjustments.

Declaration

private static BufferedImage offset(final BufferedImage image, final float[] scales, final float[] offsets) 

Method Source Code

//package com.java2s;

import java.awt.image.BufferedImage;

import java.awt.image.RescaleOp;

public class Main {
    /**/*from w w w  .  ja va  2 s  .c  o m*/
     * Performs a rescale operation on the image's color components.
     *
     * @param image   The image to be adjusted.
     * @param scales  An array of scale operations to be performed on the image's color components.
     * @param offsets An array of offset operations to be performed on the image's color components.
     * @return        The modified image after applying the given adjustments.
     */
    private static BufferedImage offset(final BufferedImage image, final float[] scales, final float[] offsets) {
        return new RescaleOp(scales, offsets, null).filter(image, null);
    }
}

Related

  1. newOptimizedImageLike(GraphicsConfiguration destination, BufferedImage img)
  2. newSubimage(BufferedImage src, int x, int y, int w, int h)
  3. nNeighbors(BufferedImage image, int i, int j)
  4. nrChannels(BufferedImage img)
  5. numPixelsDifferent(BufferedImage imgA, BufferedImage imgB)
  6. open(BufferedImage image)
  7. openAsBufferedImage(String path)
  8. operatedImage(BufferedImage source, BufferedImageOp op)
  9. optimizeForGraphicsHardware(BufferedImage image)