railo.runtime.img.filter
Class TransformFilter

java.lang.Object
  extended by railo.runtime.img.filter.AbstractBufferedImageOp
      extended by railo.runtime.img.filter.TransformFilter
All Implemented Interfaces:
BufferedImageOp, Cloneable, DynFiltering
Direct Known Subclasses:
BlockFilter, CircleFilter, CurlFilter, DiffuseFilter, DisplaceFilter, FieldWarpFilter, KaleidoscopeFilter, MapFilter, MarbleFilter, OffsetFilter, PerspectiveFilter, PinchFilter, PolarFilter, RippleFilter, RotateFilter, ShearFilter, SphereFilter, SwimFilter, TwirlFilter, WaterFilter

public abstract class TransformFilter
extends AbstractBufferedImageOp
implements DynFiltering

An abstract superclass for filters which distort images in some way. The subclass only needs to override two methods to provide the mapping between source and destination pixels.


Field Summary
static int BILINEAR
          Use bilinear interpolation.
static int NEAREST_NEIGHBOUR
          Use nearest-neighbour interpolation.
 
Constructor Summary
TransformFilter()
           
TransformFilter(int edgeAction)
           
 
Method Summary
 BufferedImage filter(BufferedImage src, BufferedImage dst)
           
 BufferedImage filter(BufferedImage src, Struct parameters)
           
 int getEdgeAction()
          Get the action to perform for pixels off the edge of the image.
 int getInterpolation()
          Get the type of interpolation to perform.
 void setEdgeAction(String edgeAction)
          Set the action to perfomr for pixels off the image edges.
 void setInterpolation(String interpolation)
          Set the type of interpolation to perform.
 
Methods inherited from class railo.runtime.img.filter.AbstractBufferedImageOp
clone, createCompatibleDestImage, getBounds2D, getPoint2D, getRenderingHints, getRGB, setRGB
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NEAREST_NEIGHBOUR

public static final int NEAREST_NEIGHBOUR
Use nearest-neighbour interpolation.

See Also:
Constant Field Values

BILINEAR

public static final int BILINEAR
Use bilinear interpolation.

See Also:
Constant Field Values
Constructor Detail

TransformFilter

public TransformFilter()

TransformFilter

public TransformFilter(int edgeAction)
Method Detail

setEdgeAction

public void setEdgeAction(String edgeAction)
                   throws ExpressionException
Set the action to perfomr for pixels off the image edges. valid values are: - clamp (default): Clamp pixels off the edge to the nearest edge. - wrap: Wrap pixels off the edge to the opposite edge. - zero: Treat pixels off the edge as zero

Parameters:
edgeAction - the action
Throws:
ExpressionException

getEdgeAction

public int getEdgeAction()
Get the action to perform for pixels off the edge of the image.

Returns:
one of ZERO, CLAMP or WRAP
See Also:
setEdgeAction(java.lang.String)

setInterpolation

public void setInterpolation(String interpolation)
                      throws ExpressionException
Set the type of interpolation to perform. valid values are: - bilinear (default): Use bilinear interpolation. - nearest_neighbour: Use nearest-neighbour interpolation.

Parameters:
interpolation - one of NEAREST_NEIGHBOUR or BILINEAR
Throws:
ExpressionException
See Also:
getInterpolation()

getInterpolation

public int getInterpolation()
Get the type of interpolation to perform.

Returns:
one of NEAREST_NEIGHBOUR or BILINEAR
See Also:
setInterpolation(java.lang.String)

filter

public BufferedImage filter(BufferedImage src,
                            BufferedImage dst)
Specified by:
filter in interface BufferedImageOp

filter

public BufferedImage filter(BufferedImage src,
                            Struct parameters)
                     throws PageException
Specified by:
filter in interface DynFiltering
Throws:
PageException


Copyright © 2012 Railo