edu.illinois.ncsa.versus.adapter.impl
Class BufferedImageAdapter

java.lang.Object
  extended by edu.illinois.ncsa.versus.adapter.impl.BufferedImageAdapter
All Implemented Interfaces:
Adapter, FileLoader, HasHSVPixels, HasPixels, HasRGBPixels

public class BufferedImageAdapter
extends java.lang.Object
implements HasPixels, FileLoader

Adapter for java buffered images.

Author:
Luigi Marini

Field Summary
private  java.awt.image.BufferedImage image
          Buffered image
private static org.apache.commons.logging.Log log
          Commons logging
 
Constructor Summary
BufferedImageAdapter()
          Empty adapter.
BufferedImageAdapter(java.awt.image.BufferedImage image)
          Adapter for java buffered images.
 
Method Summary
 double getHSVPixel(int row, int column, int band)
          Get one pixel at a time.
 double[][][] getHSVPixels()
          Get all pixels in document.
 java.awt.image.BufferedImage getImage()
          Get buffered image.
 java.lang.String getName()
          Pretty name of adapter.
 double getRGBPixel(int row, int column, int band)
          Get one pixel at a time.
 double[][][] getRGBPixels()
          Get all pixels in document.
 void load(java.io.File file)
          Load a file from disk in the data structure specific to the adapter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

image

private java.awt.image.BufferedImage image
Buffered image


log

private static org.apache.commons.logging.Log log
Commons logging

Constructor Detail

BufferedImageAdapter

public BufferedImageAdapter()
Empty adapter.


BufferedImageAdapter

public BufferedImageAdapter(java.awt.image.BufferedImage image)
Adapter for java buffered images.

Parameters:
image -
Method Detail

getImage

public java.awt.image.BufferedImage getImage()
Get buffered image.

Returns:
buffered image

getRGBPixels

public double[][][] getRGBPixels()
Description copied from interface: HasRGBPixels
Get all pixels in document.

Specified by:
getRGBPixels in interface HasRGBPixels
Returns:
First dimension is rows, second is columns, third is bands

load

public void load(java.io.File file)
          throws java.io.IOException
Description copied from interface: FileLoader
Load a file from disk in the data structure specific to the adapter.

Specified by:
load in interface FileLoader
Parameters:
file - file to load
Throws:
java.io.IOException

getRGBPixel

public double getRGBPixel(int row,
                          int column,
                          int band)
Description copied from interface: HasRGBPixels
Get one pixel at a time.

Specified by:
getRGBPixel in interface HasRGBPixels
Parameters:
row - the row in the image - top to bottom
column - column in the image - left to right
band - pixel's band
Returns:
value of the band for the pixel

getName

public java.lang.String getName()
Description copied from interface: Adapter
Pretty name of adapter.

Specified by:
getName in interface Adapter
Returns:
pretty name

getHSVPixel

public double getHSVPixel(int row,
                          int column,
                          int band)
Description copied from interface: HasHSVPixels
Get one pixel at a time.

Specified by:
getHSVPixel in interface HasHSVPixels
Parameters:
row - the row in the image - top to bottom
column - column in the image - left to right
band - pixel's band
Returns:
value of the band for the pixel

getHSVPixels

public double[][][] getHSVPixels()
Description copied from interface: HasHSVPixels
Get all pixels in document.

Specified by:
getHSVPixels in interface HasHSVPixels
Returns:
First dimension is rows, second is columns, third is bands