railo.runtime.img.filter
Class PerspectiveFilter

java.lang.Object
  extended by railo.runtime.img.filter.AbstractBufferedImageOp
      extended by railo.runtime.img.filter.TransformFilter
          extended by railo.runtime.img.filter.PerspectiveFilter
All Implemented Interfaces:
BufferedImageOp, Cloneable, DynFiltering

public class PerspectiveFilter
extends TransformFilter
implements DynFiltering

A filter which performs a perspective distortion on an image.


Field Summary
 
Fields inherited from class railo.runtime.img.filter.TransformFilter
BILINEAR, NEAREST_NEIGHBOUR
 
Constructor Summary
PerspectiveFilter()
          Construct a PerspectiveFilter.
PerspectiveFilter(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3)
          Construct a PerspectiveFilter.
 
Method Summary
 BufferedImage filter(BufferedImage src, BufferedImage dst)
           
 BufferedImage filter(BufferedImage src, Struct parameters)
           
 float getOriginX()
          Get the origin of the output image.
 float getOriginY()
          Get the origin of the output image.
 void setCorners(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3)
          Set the new positions of the image corners.
 void setXLB(float xlb)
          the new horizontal position of the bottom left corner, negative values are translated to image-width - x.
 void setXLT(float xlt)
          the new horizontal position of the top left corner, negative values are translated to image-width - x.
 void setXRB(float xrb)
          the new horizontal position of the bottom right corner, negative values are translated to image-width - x.
 void setXRT(float xrt)
          the new horizontal position of the top right corner, negative values are translated to image-width - x.
 void setYLB(float ylb)
          the new vertical position of the bottom left corner, negative values are translated to image-height - y.
 void setYLT(float ylt)
          the new vertical position of the top left corner, negative values are translated to image-height - y.
 void setYRB(float yrb)
          the new vertical position of the bottom right corner, negative values are translated to image-height - y.
 void setYRT(float yrt)
          the new vertical position of the top right corner, negative values are translated to image-height - y.
 String toString()
           
 
Methods inherited from class railo.runtime.img.filter.TransformFilter
getEdgeAction, getInterpolation, setEdgeAction, setInterpolation
 
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, wait, wait, wait
 

Constructor Detail

PerspectiveFilter

public PerspectiveFilter()
Construct a PerspectiveFilter.


PerspectiveFilter

public PerspectiveFilter(float x0,
                         float y0,
                         float x1,
                         float y1,
                         float x2,
                         float y2,
                         float x3,
                         float y3)
Construct a PerspectiveFilter.

Parameters:
x0 - the new position of the top left corner
y0 - the new position of the top left corner
x1 - the new position of the top right corner
y1 - the new position of the top right corner
x2 - the new position of the bottom right corner
y2 - the new position of the bottom right corner
x3 - the new position of the bottom left corner
y3 - the new position of the bottom left corner
Method Detail

setCorners

public void setCorners(float x0,
                       float y0,
                       float x1,
                       float y1,
                       float x2,
                       float y2,
                       float x3,
                       float y3)
Set the new positions of the image corners.

Parameters:
x0 - the new position of the top left corner
y0 - the new position of the top left corner
x1 - the new position of the top right corner
y1 - the new position of the top right corner
x2 - the new position of the bottom right corner
y2 - the new position of the bottom right corner
x3 - the new position of the bottom left corner
y3 - the new position of the bottom left corner

setXLT

public void setXLT(float xlt)
the new horizontal position of the top left corner, negative values are translated to image-width - x.

Parameters:
x0 - the x0 to set

setYLT

public void setYLT(float ylt)
the new vertical position of the top left corner, negative values are translated to image-height - y.

Parameters:
y0 - the y0 to set

setXRT

public void setXRT(float xrt)
the new horizontal position of the top right corner, negative values are translated to image-width - x.

Parameters:
x1 - the x1 to set

setYRT

public void setYRT(float yrt)
the new vertical position of the top right corner, negative values are translated to image-height - y.

Parameters:
y1 - the y1 to set

setXRB

public void setXRB(float xrb)
the new horizontal position of the bottom right corner, negative values are translated to image-width - x.

Parameters:
x2 - the x2 to set

setYRB

public void setYRB(float yrb)
the new vertical position of the bottom right corner, negative values are translated to image-height - y.

Parameters:
y2 - the y2 to set

setXLB

public void setXLB(float xlb)
the new horizontal position of the bottom left corner, negative values are translated to image-width - x.

Parameters:
xlb - the x3 to set

setYLB

public void setYLB(float ylb)
the new vertical position of the bottom left corner, negative values are translated to image-height - y.

Parameters:
y3 - the y3 to set

getOriginX

public float getOriginX()
Get the origin of the output image. Use this for working out where to draw your new image.

Returns:
the X origin.

getOriginY

public float getOriginY()
Get the origin of the output image. Use this for working out where to draw your new image.

Returns:
the Y origin.

toString

public String toString()
Overrides:
toString in class Object

filter

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

filter

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


Copyright © 2012 Railo