JIGL
v1.6

jigl.image.warp
Class Mapper

java.lang.Object
  |
  +--jigl.image.SimpleOperator
        |
        +--jigl.image.warp.Mapper
All Implemented Interfaces:
Operator

public class Mapper
extends SimpleOperator

Mapper applies a transformation (PointMapper) to an entire image.


Field Summary
static int CUBIC
          Interpolation method types 3
static int LINEAR
          Interpolation method types 2
protected  float[] m_defColor
          Backgroung color
private  int m_interpMethod
          Interpolation methods: neighbor, linear or cubic
private  PointMapper m_mapper
          Pointmapper object for transformation
static int NEIGHBOR
          Interpolation method types 1
 
Constructor Summary
Mapper(PointMapper mapper, int interpolationMethod)
          Constructs a Mapper object from a PointMapper object and an interpolation method.
 
Method Summary
protected  Image apply(ColorImage image)
          Applies the transformation to image through the PointMapper.
protected  Image apply(GrayImage image)
          Applies the transformation to image through the PointMapper.
protected  Image apply(RealColorImage image)
          Applies the transformation to image through the PointMapper.
protected  Image apply(RealGrayImage image)
          Applies the transformation to image through the PointMapper.
 void setDefaultColor(float[] color)
          set the color that will be use in apply() when out of bounds of the interpolated image.
 
Methods inherited from class jigl.image.SimpleOperator
apply, apply, apply, apply, apply, apply, apply, apply, apply, apply
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_interpMethod

private int m_interpMethod
Interpolation methods: neighbor, linear or cubic


m_mapper

private PointMapper m_mapper
Pointmapper object for transformation


NEIGHBOR

public static final int NEIGHBOR
Interpolation method types 1

See Also:
Constant Field Values

LINEAR

public static final int LINEAR
Interpolation method types 2

See Also:
Constant Field Values

CUBIC

public static final int CUBIC
Interpolation method types 3

See Also:
Constant Field Values

m_defColor

protected float[] m_defColor
Backgroung color

Constructor Detail

Mapper

public Mapper(PointMapper mapper,
              int interpolationMethod)
       throws ImageNotSupportedException
Constructs a Mapper object from a PointMapper object and an interpolation method.

Parameters:
interpolationMethod - the way to interpolate (0=NEIGHBOR 1=LINEAR 2=CUBIC)
Method Detail

setDefaultColor

public void setDefaultColor(float[] color)
set the color that will be use in apply() when out of bounds of the interpolated image.

Parameters:
color - color to be used as default color. color will be used to the extent needed by the image type. For example, a GrayImage will return (int)color[0] for the default color, and RealColorImage will use the first three elements of color. If not enough elements are in the array, the last color will be repeated as needed.

apply

protected Image apply(GrayImage image)
Applies the transformation to image through the PointMapper. image is not modified.

Overrides:
apply in class SimpleOperator
Parameters:
image - GrayImage to map.
Returns:
a GrayImage object.

apply

protected Image apply(RealGrayImage image)
Applies the transformation to image through the PointMapper. image is not modified.

Overrides:
apply in class SimpleOperator
Parameters:
image - RealGrayImage to map.
Returns:
RealGrayImage.

apply

protected Image apply(ColorImage image)
Applies the transformation to image through the PointMapper. image is not modified.

Overrides:
apply in class SimpleOperator
Parameters:
image - ColorImage to map.
Returns:
ColorImage.

apply

protected Image apply(RealColorImage image)
Applies the transformation to image through the PointMapper. image is not modified.

Overrides:
apply in class SimpleOperator
Parameters:
image - RealColorImage to map.
Returns:
RealColorImage.

JIGL
v1.6

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