railo.runtime.img.filter
Class SaturationFilter

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

public class SaturationFilter
extends PointFilter
implements DynFiltering

A filter to change the saturation of an image. This works by calculating a grayscale version of the image and then extrapolating away from it.


Field Summary
 float amount
           
 
Constructor Summary
SaturationFilter()
          Construct a SaturationFilter.
SaturationFilter(float amount)
          Construct a SaturationFilter.
 
Method Summary
 BufferedImage filter(BufferedImage src, Struct parameters)
           
 int filterRGB(int x, int y, int rgb)
           
 float getAmount()
          Set the amount of saturation change.
 void setAmount(float amount)
          Set the amount of saturation change.
 String toString()
           
 
Methods inherited from class railo.runtime.img.filter.PointFilter
filter, setDimensions
 
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
 

Field Detail

amount

public float amount
Constructor Detail

SaturationFilter

public SaturationFilter()
Construct a SaturationFilter.


SaturationFilter

public SaturationFilter(float amount)
Construct a SaturationFilter. The amount of saturation change.

Method Detail

setAmount

public void setAmount(float amount)
Set the amount of saturation change. 1 leaves the image unchanged, values between 0 and 1 desaturate, 0 completely desaturates it and values above 1 increase the saturation.

Parameters:
amount - the amount

getAmount

public float getAmount()
Set the amount of saturation change.

Returns:
the amount

filterRGB

public int filterRGB(int x,
                     int y,
                     int rgb)
Specified by:
filterRGB in class PointFilter

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 PointFilter
Throws:
PageException


Copyright © 2012 Railo