adams.core
Class BufferedImageHelper

java.lang.Object
  extended by adams.core.BufferedImageHelper

public class BufferedImageHelper
extends Object

Helper class for BufferedImage objects.

Version:
$Revision: 4783 $
Author:
fracpete (fracpete at waikato dot ac dot nz)

Constructor Summary
BufferedImageHelper()
           
 
Method Summary
static BufferedImage deepCopy(BufferedImage img)
          Returns a copy of a BufferedImage object.
static int[][] getPixelRaster(BufferedImage img)
          Returns the pixels of the image as an 2-D int array (row-wise).
static int[] getPixels(BufferedImage img)
          Returns all the pixels of the image as an int array (row-wise).
static int[][] getRGBPixels(BufferedImage img)
          Returns all the pixels of the image as an int array (row-wise) with the RGB(A) components as second dimension.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BufferedImageHelper

public BufferedImageHelper()
Method Detail

deepCopy

public static BufferedImage deepCopy(BufferedImage img)
Returns a copy of a BufferedImage object.

Taken from here (CC BY-SA 3.0).

Parameters:
img - the image to copy

getPixels

public static int[] getPixels(BufferedImage img)
Returns all the pixels of the image as an int array (row-wise).

Parameters:
img - the image to get the pixels from
Returns:
the pixel array
See Also:
BufferedImage.getRGB(int, int)

getRGBPixels

public static int[][] getRGBPixels(BufferedImage img)
Returns all the pixels of the image as an int array (row-wise) with the RGB(A) components as second dimension.

Parameters:
img - the image to get the pixels from
Returns:
the pixel array
See Also:
BufferedImage.getRGB(int, int)

getPixelRaster

public static int[][] getPixelRaster(BufferedImage img)
Returns the pixels of the image as an 2-D int array (row-wise).

Parameters:
img - the image to get the pixels from
Returns:
the pixel array
See Also:
BufferedImage.getRGB(int, int)


Copyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.