javax.media.jai.operator
Class ImageFunctionDescriptor

java.lang.Object
  extended byjavax.media.jai.OperationDescriptorImpl
      extended byjavax.media.jai.operator.ImageFunctionDescriptor
All Implemented Interfaces:
OperationDescriptor, RegistryElementDescriptor, Serializable

public class ImageFunctionDescriptor
extends OperationDescriptorImpl

An OperationDescriptor describing the "ImageFunction" operation.

The "ImageFunction" operation generates an image on the basis of a functional description provided by an object which is an instance of a class which implements the ImageFunction interface. The (x,y) coordinates passed to the getElements() methods of the ImageFunction object are derived by applying an optional translation and scaling to the X- and Y-coordinates of the image. The image X- and Y-coordinates as usual depend on the values of the minimum X- and Y- coordinates of the image which need not be zero. Specifically, the function coordinates passed to getElements() are calculated from the image coordinates as:

 functionX = xScale*(imageX - xTrans);
 functionY = yScale*(imageY - yTrans);
 
This implies that the pixel at coordinates (xTrans,yTrans) will be assigned the value of the function at (0,0).

The number of bands in the destination image must be equal to the value returned by the getNumElements() method of the ImageFunction unless the isComplex() method of the ImageFunction returns true in which case it will be twice that. The data type of the destination image is determined by the SampleModel specified by an ImageLayout object provided via a hint. If no layout hint is provided, the data type will default to single-precision floating point. The double precision floating point form of the getElements() method of the ImageFunction will be invoked if and only if the data type is specified to be double. For all other data types the single precision form of getElements() will be invoked and the destination sample values will be clamped to the data type of the image.

The width and height of the image are provided explicitely as parameters. These values override the width and height specified via an ImageLayout if such is provided.

"ImageFunction" defines a PropertyGenerator that sets the "COMPLEX" property of the image to java.lang.Boolean.TRUE or java.lang.Boolean.FALSE depending on whether the isComplex() method of the ImageFunction parameter returns true or false, respectively. This property may be retrieved by calling the getProperty() method with "COMPLEX" as the property name.

Resource List
Name Value
GlobalName ImageFunction
LocalName ImageFunction
Vendor com.sun.media.jai
Description Generates an image from a functional description.
DocURL http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/javax/media/jai/operator/ImageFunctionDescriptor.html
Version 1.0
arg0Desc The functional description.
arg1Desc The image width.
arg2Desc The image height.
arg3Desc The X scale factor.
arg4Desc The Y scale factor.
arg5Desc The X translation.
arg6Desc The Y translation.

Parameter List
Name Class Type Default Value
function javax.media.jai.ImageFunction NO_PARAMETER_DEFAULT
width java.lang.Integer NO_PARAMETER_DEFAULT
height java.lang.Integer NO_PARAMETER_DEFAULT
xScale java.lang.Float 1.0F
yScale java.lang.Float 1.0F
xTrans java.lang.Float 0.0F
yTrans java.lang.Float 0.0F

See Also:
AffineTransform, OperationDescriptor, ImageFunction, Serialized Form

Field Summary
 
Fields inherited from class javax.media.jai.OperationDescriptorImpl
sourceNames, supportedModes
 
Fields inherited from interface javax.media.jai.OperationDescriptor
NO_PARAMETER_DEFAULT
 
Constructor Summary
ImageFunctionDescriptor()
          Constructor.
 
Method Summary
static RenderedOp create(ImageFunction function, Integer width, Integer height, Float xScale, Float yScale, Float xTrans, Float yTrans, RenderingHints hints)
          Generates an image from a functional description.
 PropertyGenerator[] getPropertyGenerators()
          Returns an array of PropertyGenerators implementing property inheritance for the "ImageFunction" operation.
 
Methods inherited from class javax.media.jai.OperationDescriptorImpl
arePropertiesSupported, getDefaultSourceClass, getDestClass, getDestClass, getInvalidRegion, getName, getNumParameters, getNumSources, getParamClasses, getParamDefaults, getParamDefaultValue, getParameterListDescriptor, getParamMaxValue, getParamMinValue, getParamNames, getPropertyGenerators, getRenderableDestClass, getRenderableSourceClasses, getResourceBundle, getResources, getSourceClasses, getSourceClasses, getSourceNames, getSupportedModes, isImmediate, isModeSupported, isRenderableSupported, isRenderedSupported, makeDefaultSourceClassList, validateArguments, validateArguments, validateParameters, validateParameters, validateRenderableArguments, validateRenderableSources, validateSources, validateSources
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageFunctionDescriptor

public ImageFunctionDescriptor()
Constructor.

Method Detail

getPropertyGenerators

public PropertyGenerator[] getPropertyGenerators()
Returns an array of PropertyGenerators implementing property inheritance for the "ImageFunction" operation.

Specified by:
getPropertyGenerators in interface OperationDescriptor
Overrides:
getPropertyGenerators in class OperationDescriptorImpl
Returns:
An array of property generators.
See Also:
OperationDescriptorImpl.getPropertyGenerators(java.lang.String)

create

public static RenderedOp create(ImageFunction function,
                                Integer width,
                                Integer height,
                                Float xScale,
                                Float yScale,
                                Float xTrans,
                                Float yTrans,
                                RenderingHints hints)
Generates an image from a functional description.

Creates a ParameterBlockJAI from all supplied arguments except hints and invokes JAI.create(String,ParameterBlock,RenderingHints).

Parameters:
function - The functional description.
width - The image width.
height - The image height.
xScale - The X scale factor. May be null.
yScale - The Y scale factor. May be null.
xTrans - The X translation. May be null.
yTrans - The Y translation. May be null.
hints - The RenderingHints to use. May be null.
Returns:
The RenderedOp destination.
Throws:
IllegalArgumentException - if function is null.
IllegalArgumentException - if width is null.
IllegalArgumentException - if height is null.
See Also:
JAI, ParameterBlockJAI, RenderedOp