JIGL
v1.6

jigl.image
Class MIPMap

java.lang.Object
  |
  +--jigl.image.MIPMap

public class MIPMap
extends Object

Allows for quick access to an image at an arbitrary reduction. Stores sub-images of the original image, reduced by 1/2 each time. Reduction is done by averaging each group of 4 pixel values.

Combining with jigl.image.utils.ImageConverter, you can make an arbitrary reduction of other types of imgaes.


Field Summary
private  InterpolatedRealColorImage[] m_imageArray
          Stroes sub-images of the original image which is reduced by 1/2 each time.
private  int m_imageSizeX
          Width of the image.
private  int m_imageSizeY
          Height of the image.
private  int m_min
          The minumum image size that can be handled.
 
Constructor Summary
MIPMap(RealColorImage image)
           
 
Method Summary
 float[] get(float x, float y, float reduction)
          Return the RGB value at (x,y) of the reduced image by reduction
 RealColorImage getImage(float reduction)
          Returns an image at reduction.
 RealColorImage getImage(float reduction, ROI roi)
          Returns an image at reduction.
 int X()
          Returns the width of the original image.
 int Y()
          Returns the height of the original image.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_imageArray

private InterpolatedRealColorImage[] m_imageArray
Stroes sub-images of the original image which is reduced by 1/2 each time.


m_imageSizeX

private int m_imageSizeX
Width of the image.


m_imageSizeY

private int m_imageSizeY
Height of the image.


m_min

private int m_min
The minumum image size that can be handled.

Constructor Detail

MIPMap

public MIPMap(RealColorImage image)
Method Detail

X

public int X()
Returns the width of the original image.


Y

public int Y()
Returns the height of the original image.


get

public float[] get(float x,
                   float y,
                   float reduction)
Return the RGB value at (x,y) of the reduced image by reduction

Parameters:
x - x value.
y - y value.
reduction - Reduction amount of image (2.0 would return the point at the image reduced by 1/2). must be >= 1.

getImage

public RealColorImage getImage(float reduction,
                               ROI roi)
Returns an image at reduction. Faster than calling get for each pixel.

Parameters:
reduction - Desired reduction amount of image.
roi - Region of Interest of original image.

getImage

public RealColorImage getImage(float reduction)
Returns an image at reduction. Faster than calling get for each pixel.

Parameters:
reduction - Desired reduction amount of image (2.0 would return the image reduced by 1/2). must be >= 1.

JIGL
v1.6

Submit a bug or feature
Revised in May 2002 by Weiming Liu