artofillusion.image.filter
Class ImageFilter

java.lang.Object
  extended by artofillusion.image.filter.ImageFilter
Direct Known Subclasses:
BlurFilter, BrightnessFilter, DepthOfFieldFilter, ExposureFilter, GlowFilter, NoiseReductionFilter, OutlineFilter, SaturationFilter, TintFilter

public abstract class ImageFilter
extends java.lang.Object

This class defines an object which can filter rendered images. It is an abstract class, whose subclasses implement specific types of filters. An ImageFilter may present a user interface for configuring filtering options, and also may have a list of keyframeable parameters.


Constructor Summary
ImageFilter()
          Every ImageFilter subclass must provide a constructor which takes no arguments.
 
Method Summary
 void copy(ImageFilter f)
          Given another ImageFilter (of the same class as this one), make this one identical to it.
 ImageFilter duplicate()
          Create an exact duplicate of this filter.
abstract  void filterImage(ComplexImage image, Scene scene, SceneCamera camera, CoordinateSystem cameraPos)
          Apply the filter to an image.
 Widget getConfigPanel(java.lang.Runnable changeCallback)
          Get a Widget with which the user can specify options for the filter.
 int getDesiredComponents()
          Get a list of all the image components required by this filter.
abstract  java.lang.String getName()
          Get the name of this filter.
 TextureParameter[] getParameters()
          Deprecated. 
 double[] getParameterValues()
          Deprecated. 
 Property[] getProperties()
          Get a list of Properties which affect the behavior of the filter.
 java.lang.Object getPropertyValue(int index)
          Get the value of a Property.
abstract  void initFromStream(java.io.DataInputStream in, Scene theScene)
          Reconstruct this filter from its serialized representation.
 void setParameterValue(int index, double value)
          Deprecated. 
 void setPropertyValue(int index, java.lang.Object value)
          Set the value of a Property.
abstract  void writeToStream(java.io.DataOutputStream out, Scene theScene)
          Write a serialized description of this filter to a stream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageFilter

public ImageFilter()
Every ImageFilter subclass must provide a constructor which takes no arguments.

Method Detail

getName

public abstract java.lang.String getName()
Get the name of this filter.


getDesiredComponents

public int getDesiredComponents()
Get a list of all the image components required by this filter. This should be a sum of the constants defined in ComplexImage. The renderer will attempt to provide all requested components, but some renderers may not support all components. The filter should therefore be prepared for the possibility that some components may be null (aside from the basic red, green, blue, and alpha components, which are always available).


filterImage

public abstract void filterImage(ComplexImage image,
                                 Scene scene,
                                 SceneCamera camera,
                                 CoordinateSystem cameraPos)
Apply the filter to an image.

Parameters:
image - the image to filter
scene - the Scene which was rendered to create the image
camera - the camera from which the Scene was rendered
cameraPos - the position of the camera in the scene

duplicate

public ImageFilter duplicate()
Create an exact duplicate of this filter.


copy

public void copy(ImageFilter f)
Given another ImageFilter (of the same class as this one), make this one identical to it.


getParameters

@Deprecated
public TextureParameter[] getParameters()
Deprecated. 

This method is deprecated. Call getProperties() instead.


getParameterValues

@Deprecated
public double[] getParameterValues()
Deprecated. 

This method is deprecated. Call getPropertyValue() instead.


setParameterValue

@Deprecated
public void setParameterValue(int index,
                                         double value)
Deprecated. 

This method is deprecated. Call setPropertyValue() instead.


getProperties

public Property[] getProperties()
Get a list of Properties which affect the behavior of the filter.


getPropertyValue

public java.lang.Object getPropertyValue(int index)
Get the value of a Property.

Parameters:
index - the index of the Property to get

setPropertyValue

public void setPropertyValue(int index,
                             java.lang.Object value)
Set the value of a Property.

Parameters:
index - the index of the Property to set
value - the value of the Property

writeToStream

public abstract void writeToStream(java.io.DataOutputStream out,
                                   Scene theScene)
                            throws java.io.IOException
Write a serialized description of this filter to a stream.

Throws:
java.io.IOException

initFromStream

public abstract void initFromStream(java.io.DataInputStream in,
                                    Scene theScene)
                             throws java.io.IOException
Reconstruct this filter from its serialized representation.

Throws:
java.io.IOException

getConfigPanel

public Widget getConfigPanel(java.lang.Runnable changeCallback)
Get a Widget with which the user can specify options for the filter.

Parameters:
changeCallback - a Runnable which should be invoked whenever the filter's configuration changes, so the containing window can update its preview


Copyright © 1999-2011 by Peter Eastman.