javax.media.jai.operator
Class DFTDescriptor

java.lang.Object
  |
  +--javax.media.jai.OperationDescriptorImpl
        |
        +--javax.media.jai.operator.DFTDescriptor
All Implemented Interfaces:
OperationDescriptor, RegistryElementDescriptor, Serializable

public class DFTDescriptor
extends OperationDescriptorImpl

An OperationDescriptor describing the "DFT" operation.

The "DFT" operation computes the discrete Fourier transform of an image. A negative exponential is used as the basis function for the transform. The operation supports real-to-complex, complex-to-complex, and complex-to-real transforms. A complex image must have an even number of bands, with the even bands (0, 2, ...) representing the real parts and the odd bands (1, 3, ...) the imaginary parts of each complex pixel.

The nature of the source and destination data is specified by the "dataNature" operation parameter. If the source data are complex then the number of bands in the source image must be a multiple of 2. The number of bands in the destination must match that which would be expected given the number of bands in the source image and the specified nature of the source and destination data. If the source image is real then the number of bands in the destination will be twice that in the source. If the destination image is real than the number of bands in the destination will be half that in the source. Otherwise the number of bands in the source and destination must be equal.

If an underlying fast Fourier transform (FFT) implementation is used which requires that the image dimensions be powers of 2, then the width and height may each be increased to the power of 2 greater than or equal to the original width and height, respectively.

"DFT" defines a PropertyGenerator that sets the "COMPLEX" property of the image to java.lang.Boolean.FALSE if the "dataNature" operation parameter is equal to COMPLEX_TO_REAL and to java.lang.Boolean.TRUE otherwise. The value of this property may be retrieved by calling the getProperty() method with "COMPLEX" as the property name.

Resource List
Name Value
GlobalName DFT
LocalName DFT
Vendor com.sun.media.jai
Description Computes the discrete Fourier transform of an image.
DocURL http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/javax/media/jai/operator/DFTDescriptor.html
Version 1.0
arg0Desc The type of scaling to be used.
arg1Desc The nature of the data.

Parameter List
Name Class Type Default Value
scalingType javax.media.jai.operator.DFTScalingType DFTDescriptor.SCALING_NONE
dataNature javax.media.jai.operator.DFTDataNature DFTDescriptor.REAL_TO_COMPLEX

See Also:
DFTDataNature, DFTScalingType, OperationDescriptor, Serialized Form

Field Summary
static DFTDataNature COMPLEX_TO_COMPLEX
          A flag indicating that the source and destination data are both complex.
static DFTDataNature COMPLEX_TO_REAL
          A flag indicating that the source data are complex and the destination data real.
static DFTDataNature REAL_TO_COMPLEX
          A flag indicating that the source data are real and the destination data complex.
static DFTScalingType SCALING_DIMENSIONS
          A flag indicating that the transform is to be scaled by the product of its dimensions.
static DFTScalingType SCALING_NONE
          A flag indicating that the transform is not to be scaled.
static DFTScalingType SCALING_UNITARY
          A flag indicating that the transform is to be scaled by the square root of the product of its dimensions.
 
Fields inherited from class javax.media.jai.OperationDescriptorImpl
resources, sourceNames, supportedModes
 
Fields inherited from interface javax.media.jai.OperationDescriptor
NO_PARAMETER_DEFAULT
 
Constructor Summary
DFTDescriptor()
          Constructor.
 
Method Summary
static RenderedOp create(RenderedImage source0, DFTScalingType scalingType, DFTDataNature dataNature, RenderingHints hints)
          Computes the discrete Fourier transform of an image.
static RenderableOp createRenderable(RenderableImage source0, DFTScalingType scalingType, DFTDataNature dataNature, RenderingHints hints)
          Computes the discrete Fourier transform of an image.
 PropertyGenerator[] getPropertyGenerators(String modeName)
          Returns an array of PropertyGenerators implementing property inheritance for the "DFT" operation.
 boolean validateArguments(String modeName, ParameterBlock args, StringBuffer msg)
          Validates the input source and parameters.
 
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, validateParameters, validateParameters, validateRenderableArguments, validateRenderableSources, validateSources, validateSources
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SCALING_NONE

public static final DFTScalingType SCALING_NONE
A flag indicating that the transform is not to be scaled.

SCALING_UNITARY

public static final DFTScalingType SCALING_UNITARY
A flag indicating that the transform is to be scaled by the square root of the product of its dimensions.

SCALING_DIMENSIONS

public static final DFTScalingType SCALING_DIMENSIONS
A flag indicating that the transform is to be scaled by the product of its dimensions.

REAL_TO_COMPLEX

public static final DFTDataNature REAL_TO_COMPLEX
A flag indicating that the source data are real and the destination data complex.

COMPLEX_TO_COMPLEX

public static final DFTDataNature COMPLEX_TO_COMPLEX
A flag indicating that the source and destination data are both complex.

COMPLEX_TO_REAL

public static final DFTDataNature COMPLEX_TO_REAL
A flag indicating that the source data are complex and the destination data real.
Constructor Detail

DFTDescriptor

public DFTDescriptor()
Constructor.
Method Detail

validateArguments

public boolean validateArguments(String modeName,
                                 ParameterBlock args,
                                 StringBuffer msg)
Validates the input source and parameters.

In addition to the standard checks performed by the superclass method, this method checks that "scalingType" is one of SCALING_NONE, SCALING_UNITARY, or SCALING_DIMENSIONS, and that "dataNature" is one of REAL_TO_COMPLEX, COMPLEX_TO_COMPLEX, or COMPLEX_TO_REAL. Also, if "dataNature" is COMPLEX_TO_COMPLEX or COMPLEX_TO_REAL the number of source bands must be even.

Overrides:
validateArguments in class OperationDescriptorImpl
Following copied from class: javax.media.jai.OperationDescriptorImpl
Parameters:
modeName - the operation mode name
args - Input arguments, including source(s) and/or parameter(s).
msg - A string that may contain error messages.
Throws:
IllegalArgumentException - if modeName is null
See Also:
OperationDescriptorImpl.validateSources(java.lang.String, java.awt.image.renderable.ParameterBlock, java.lang.StringBuffer), OperationDescriptorImpl.validateParameters(java.lang.String, java.awt.image.renderable.ParameterBlock, java.lang.StringBuffer)

getPropertyGenerators

public PropertyGenerator[] getPropertyGenerators(String modeName)
Returns an array of PropertyGenerators implementing property inheritance for the "DFT" operation.
Overrides:
getPropertyGenerators in class OperationDescriptorImpl
Returns:
An array of property generators.

create

public static RenderedOp create(RenderedImage source0,
                                DFTScalingType scalingType,
                                DFTDataNature dataNature,
                                RenderingHints hints)
Computes the discrete Fourier transform of an image.

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

Parameters:
source0 - RenderedImage source 0.
scalingType - The type of scaling to perform. May be null.
dataNature - The nature of the data. May be null.
hints - The RenderingHints to use. May be null.
Returns:
The RenderedOp destination.
Throws:
IllegalArgumentException - if source0 is null.
See Also:
JAI, ParameterBlockJAI, RenderedOp

createRenderable

public static RenderableOp createRenderable(RenderableImage source0,
                                            DFTScalingType scalingType,
                                            DFTDataNature dataNature,
                                            RenderingHints hints)
Computes the discrete Fourier transform of an image.

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

Parameters:
source0 - RenderableImage source 0.
scalingType - The type of scaling to perform. May be null.
dataNature - The nature of the data. May be null.
hints - The RenderingHints to use. May be null.
Returns:
The RenderableOp destination.
Throws:
IllegalArgumentException - if source0 is null.
See Also:
JAI, ParameterBlockJAI, RenderableOp