javax.media.jai.operator
Class ConvolveDescriptor
java.lang.Object
|
+--javax.media.jai.OperationDescriptorImpl
|
+--javax.media.jai.operator.ConvolveDescriptor
- All Implemented Interfaces:
- OperationDescriptor, RegistryElementDescriptor, Serializable
- public class ConvolveDescriptor
- extends OperationDescriptorImpl
An OperationDescriptor
describing the "Convolve" operation.
Convolution is a spatial operation that computes each output
sample by multiplying elements of a kernel with the samples
surrounding a particular source sample.
For each destination sample, the kernel is rotated 180 degrees
and its "key element," or origin, is placed over the source pixel
corresponding with the destination pixel. The kernel elements are
multiplied with the source pixels beneath them, and the resulting
products are summed together to produce the destination sample
value.
Pseudocode for the convolution operation on a single sample
dst[x][y] is as follows, assuming the kernel is of size width x height
and has already been rotated through 180 degrees. The kernel's Origin
element is located at position (xOrigin, yOrigin):
dst[x][y] = 0;
for (int i = -xOrigin; i < -xOrigin + width; i++) {
for (int j = -yOrigin; j < -yOrigin + height; j++) {
dst[x][y] += src[x + i][y + j]*kernel[xOrigin + i][yOrigin + j];
}
}
Convolution, like any neighborhood operation, leaves a band of
pixels around the edges undefined. For example, for a 3x3 kernel
only four kernel elements and four source pixels contribute to the
convolution pixel at the corners of the source image. Pixels that
do not allow the full kernel to be applied to the source are not
included in the destination image. A "Border" operation may be used
to add an appropriate border to the source image in order to avoid
shrinkage of the image boundaries.
The kernel may not be bigger in any dimension than the image data.
Resource List
Name | Value |
GlobalName | Convolve |
LocalName | Convolve |
Vendor | com.sun.media.jai |
Description | Performs kernel-based convolution
on an image. |
DocURL | http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/javax/media/jai/operator/ConvolveDescriptor.html |
Version | 1.0 |
arg0Desc | The convolution kernel. |
Parameter List
Name | Class Type |
Default Value |
kernel | javax.media.jai.KernelJAI |
NO_PARAMETER_DEFAULT |
- See Also:
OperationDescriptor
,
KernelJAI
, Serialized Form
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 |
ConvolveDescriptor
public ConvolveDescriptor()
- Constructor.
getPropertyGenerators
public PropertyGenerator[] getPropertyGenerators()
- Returns an array of
PropertyGenerators
implementing
property inheritance for the "Convolve" operation.
- Overrides:
- getPropertyGenerators in class OperationDescriptorImpl
- Returns:
- An array of property generators.