Java BufferedImage Operation updateImageSpecifications( BufferedImage bufferedImage)

Here you can find the source of updateImageSpecifications( BufferedImage bufferedImage)

Description

Updated the local (static) variables holding the image, the color-model of the image, the raster of the image, and the height and width of the image-raster.

License

Open Source License

Parameter

Parameter Description
bufferedImage The image for which to perform a read-, write- or erase-operation.

Exception

Parameter Description
ExceptionUnspecified Exception in case something goes wrong.

Declaration

private static void updateImageSpecifications(
        BufferedImage bufferedImage) throws Exception 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.awt.image.BufferedImage;
import java.awt.image.ColorModel;
import java.awt.image.WritableRaster;

public class Main {
    private static BufferedImage image;
    private static ColorModel imageColorModel;
    private static WritableRaster imageRaster;
    private static int imageHeight;
    private static int imageWidth;

    /**//from   w w w.j a  v  a 2  s .c  o  m
     * Updated the local (static) variables holding the image, the color-model of the image, the raster of the
     * image, and the height and width of the image-raster.
     * 
     * @param bufferedImage      The image for which to perform a read-, write- or erase-operation.
     * 
     * @throws Exception      Unspecified Exception in case something goes wrong.
     */
    private static void updateImageSpecifications(
            BufferedImage bufferedImage) throws Exception {
        image = bufferedImage;
        imageColorModel = image.getColorModel();
        imageRaster = image.getRaster();
        imageHeight = imageRaster.getHeight();
        imageWidth = imageRaster.getWidth();
    }
}

Related

  1. tile(BufferedImage source, Rectangle r, GraphicsConfiguration conf)
  2. tileStretchPaint(Graphics g, Component component, BufferedImage image, Insets insets)
  3. tilt(BufferedImage image, double angle)
  4. tintImage(BufferedImage src, Color color, float tintOpacity)
  5. unweaveFrom(BufferedImage bufferedImage)
  6. validateSelectionRectangle(BufferedImage image, Rectangle selection)
  7. verticalGradient(BufferedImage image, Graphics2D g2d, Color... colors)
  8. waterMarkImage(final BufferedImage image, final String text)
  9. weaveInto(BufferedImage bufferedImage, String message)