@(#)OpMods.txt 1.5 Proposal: Operator Modifications ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Brian Burkhalter Created: 10 August 2000 Revised: 12/18/00 CHANGES DURING COMMUNITY REVIEW ------------------------------- . Added getInvalidRegion() to BorderDescriptor and NullDescriptor. . Add "page" parameter to "TIFF" operation. . Renamed "FilteredAffine" operation "FilteredSubsample" to more accurately describe the case it supports. PROPOSAL -------- 1. Background This proposal discusses the changes to the set of operations provided by default by Java Advanced Imaging. These changes fall into two categories: 1) changes to operations which existed in JAI 1.0.2, and 2) operations new to JAI 1.1. 2. Modifications of Pre-existing Operations The changes described in this section are backward incompatible. 2.1 Specification Changes 2.1.1 Border 2.1.1.1 Parameters The operation will be modified to accept a BorderExtender object instead of a constant value indicating which BorderExtender. This permits any BorderExtender subclass to be used rather than limiting the choice to the specific set of BorderExtenders defined in JAI. * The static final constants BORDER_* to be deleted. * The "constants" parameter to be deleted. * The class of the "type" parameter to be changed from Integer to javax.media.jai.BorderExtender. 2.1.1.2 getInvalidRegion() An implementation of OperationDescriptor.getInvalidRegion() will be provided. The algorithm for this is: . if the mode is not "rendered", return null; . if the RenderingHints are not the same, return null; . if the source has changed, return null; . if the top or left padding changed, return null; . if the BorderExtender only changed, return the complement of the source bounds within the destination bounds; . if the right or bottom padding only was increased, return an empty Shape; . if the right or bottom padding only was decreased, return the old destination bounds minus the new destination bounds; For more information on getInvalidRegion() please refer to the proposal "Support for Editing Rendered Op Chains". 2.1.2 ColorConvert The operation specification will be modified to accept a ColorModel parameter "colorModel" instead of the current ColorSpace parameter "colorSpace". The operation implementation will be modified to select an optimal processing pathway based on the class type of the source and destination ColorSpaces and on the source and destination data types. 2.1.3 Histogram A Histogram object will no longer be accepted as a parameter of the operation. Instead, parameters sufficient to create a Histogram object will be passed in. The computed Histogram will still be available as a property named "histogram" on the destination image. New parameter set: Name Class Default ---- ----- ------- roi ROI null (entire image) xPeriod Integer 1 (all pixels across rows) yPeriod Integer 1 (all pixels down columns) numBins int[] 256 lowValue double[] 0 highValue double[] 256.0 Old parameter set: Name Class Default ---- ----- ------- histogram Histogram none (required) roi ROI null (entire image) xPeriod Integer 1 (all pixels across rows) yPeriod Integer 1 (all pixels down columns) 2.1.4 TIFF Add a parameter "page" of type "int" with default zero. The OperationDescriptor comments will also be updated. This allows reading via the API of an arbitrary page of a multi-page TIFF stream. 2.2 Operations with Enumerated Constants In all of the following operations the integer constants defined as the range of allowable values for certain parameters are to be replaced with constants which are subclasses of javax.media.jai.EnumeratedParameter. The affected parameter is listed in each case; for more specific information please refer to the respective OperationDescriptor. Operation Parameter New Class (in javax.media.jai.operator) --------- --------- --------- Composite destAlpha CompositeDestAlpha DFT scalingType DFTScalingType dataNature DFTDataNature IDFT scalingType DFTScalingType dataNature DFTDataNature MaxFilter maskShape MaxFilterShape MedianFilter maskShape MedianFilterShape MinFilter maskShape MinFilterShape Shear shearDir ShearDir Transpose type TransposeType 3. New Operations The operations listed in the following sections will be added. A brief description is included for each. For elaboration please refer to the respective OperationDescriptor. 3.1 BandMerge Creates an image consisting of all bands of all sources concatenated in the order encountered. 3.2 Binarize Thresholds a single-band image to two levels to generate a binary output. 3.3 Dilate Performs morphological dilation. Binary and grayscale dilation are supported directly. The bands of multi-band images are processed independently. 3.4 Erode Performs morphological erosion. Binary and grayscale erosion are supported directly. The bands of multi-band images are processed independently. 3.5 FilteredSubsample Performs an anti-aliased filtered subsampling operation. This operation combines the convolve and (fractional) scale operations in a single step. 3.6 MaxFilter Computes each destination pixel value as the maximum of all source pixel values in the same band for a given mask centered on the corresponding source pixel location. 3.7 MinFilter Computes each destination pixel value as the minimum of all source pixel values in the same band for a given mask centered on the corresponding source pixel location. 3.8 Null Performs no processing. May be used as a placeholder in a chain or as a no-op with which to register PropertyGenerators. The associated OperationDescriptor will have a getInvalidRegion() method which returns null unless the first source has not changed in which case an empty Shape is returned. 3.9 SubsampleBinaryToGray Subsamples a binary image to generate a grayscale image with values ranging from zero to the product of the ceiling of each of the scale factors. 3.10 UnsharpMask Apply an unsharp masking operation to an image.