javax.media.jai.operator
Class ClampDescriptor
java.lang.Object
|
+--javax.media.jai.OperationDescriptorImpl
|
+--javax.media.jai.operator.ClampDescriptor
- All Implemented Interfaces:
- OperationDescriptor, RegistryElementDescriptor, Serializable
- public class ClampDescriptor
- extends OperationDescriptorImpl
An OperationDescriptor
describing the "Clamp" operation.
The Clamp operation takes one rendered or renderable source
image, and sets all the pixels whose value is below a "low" value
to that low value and all the pixels whose value is above a "high"
value to that high value. The pixels whose value is between the
"low" value and the "high" value are left unchanged.
A different set of "low" and "high" values may be applied to each
band of the source image, or the same set of "low" and "high" values
may be applied to all bands of the source. If the number of "low" and
"high" values supplied is less than the number of bands of the source,
then the values from entry 0 are applied to all the bands. Each "low"
value must be less than or equal to its corresponding "high" value.
The destination pixel values are defined by the pseudocode:
lowVal = (low.length < dstNumBands) ?
low[0] : low[b];
highVal = (high.length < dstNumBands) ?
high[0] : high[b];
if (src[x][y][b] < lowVal) {
dst[x][y][b] = lowVal;
} else if (src[x][y][b] > highVal) {
dst[x][y][b] = highVal;
} else {
dst[x][y][b] = src[x][y][b];
}
Resource List
Name | Value |
GlobalName | Clamp |
LocalName | Clamp |
Vendor | com.sun.media.jai |
Description | Clamps the pixel values of a rendered image
to a specified range. |
DocURL | http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/javax/media/jai/operator/ClampDescriptor.html |
Version | 1.0 |
arg0Desc | The lower boundary for each band. |
arg1Desc | The upper boundary for each band. |
Parameter List
Name | Class Type |
Default Value |
low | double[] |
NO_PARAMETER_DEFAULT |
high | double[] |
NO_PARAMETER_DEFAULT |
- See Also:
OperationDescriptor
, 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,
getPropertyGenerators,
getRenderableDestClass,
getRenderableSourceClasses,
getResourceBundle,
getResources,
getSourceClasses,
getSourceClasses,
getSourceNames,
getSupportedModes,
isImmediate,
isModeSupported,
isRenderedSupported,
makeDefaultSourceClassList,
validateArguments,
validateArguments,
validateParameters,
validateRenderableArguments,
validateRenderableSources,
validateSources,
validateSources |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
ClampDescriptor
public ClampDescriptor()
- Constructor.
isRenderableSupported
public boolean isRenderableSupported()
- Returns
true
since renderable operation is supported.
- Overrides:
- isRenderableSupported in class OperationDescriptorImpl
- Tags copied from class: OperationDescriptorImpl
- See Also:
OperationDescriptorImpl.isModeSupported(java.lang.String)
validateParameters
protected boolean validateParameters(ParameterBlock args,
StringBuffer msg)
- Validates the input parameters.
In addition to the standard checks performed by the
superclass method, this method checks that "low" and "high"
have length at least 1 and that each "low" value is less than
or equal to the corresponding "high" value.
- Overrides:
- validateParameters in class OperationDescriptorImpl
- Tags copied from class: OperationDescriptorImpl
- Throws:
- IllegalArgumentException - if
args
is null
.- IllegalArgumentException - if
msg
is null
and the validation fails. - See Also:
OperationDescriptorImpl.validateParameters(java.lang.String, java.awt.image.renderable.ParameterBlock, java.lang.StringBuffer)