|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.media.jai.OperationDescriptorImpl | +--javax.media.jai.operator.ClampDescriptor
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]; }
Name | Value |
---|---|
GlobalName | Clamp |
LocalName | Clamp |
Vendor | com.sun.media.jai |
Description | Clamps the pixel values of an 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. |
Name | Class Type | Default Value |
---|---|---|
low | double[] | {0.0} |
high | double[] | {255.0} |
OperationDescriptor
, Serialized FormFields inherited from class javax.media.jai.OperationDescriptorImpl |
resources, sourceNames, supportedModes |
Fields inherited from interface javax.media.jai.OperationDescriptor |
NO_PARAMETER_DEFAULT |
Constructor Summary | |
ClampDescriptor()
Constructor. |
Method Summary | |
static RenderedOp |
create(RenderedImage source0,
double[] low,
double[] high,
RenderingHints hints)
Clamps the pixel values of an image to a specified range. |
static RenderableOp |
createRenderable(RenderableImage source0,
double[] low,
double[] high,
RenderingHints hints)
Clamps the pixel values of an image to a specified range. |
boolean |
isRenderableSupported()
Returns true since renderable operation is supported. |
protected boolean |
validateParameters(ParameterBlock args,
StringBuffer msg)
Validates the input parameters. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ClampDescriptor()
Method Detail |
public boolean isRenderableSupported()
true
since renderable operation is supported.isRenderableSupported
in class OperationDescriptorImpl
javax.media.jai.OperationDescriptorImpl
OperationDescriptorImpl.isModeSupported(java.lang.String)
protected boolean validateParameters(ParameterBlock args, StringBuffer msg)
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.
validateParameters
in class OperationDescriptorImpl
javax.media.jai.OperationDescriptorImpl
IllegalArgumentException
- if args
is null
.IllegalArgumentException
- if msg
is null
and the validation fails.OperationDescriptorImpl.validateParameters(java.lang.String, java.awt.image.renderable.ParameterBlock, java.lang.StringBuffer)
public static RenderedOp create(RenderedImage source0, double[] low, double[] high, RenderingHints hints)
Creates a ParameterBlockJAI
from all
supplied arguments except hints
and invokes
JAI.create(String,ParameterBlock,RenderingHints)
.
source0
- RenderedImage
source 0.low
- The lower boundary for each band.
May be null
.high
- The upper boundary for each band.
May be null
.hints
- The RenderingHints
to use.
May be null
.RenderedOp
destination.IllegalArgumentException
- if source0
is null
.JAI
,
ParameterBlockJAI
,
RenderedOp
public static RenderableOp createRenderable(RenderableImage source0, double[] low, double[] high, RenderingHints hints)
Creates a ParameterBlockJAI
from all
supplied arguments except hints
and invokes
JAI.createRenderable(String,ParameterBlock,RenderingHints)
.
source0
- RenderableImage
source 0.low
- The lower boundary for each band.
May be null
.high
- The upper boundary for each band.
May be null
.hints
- The RenderingHints
to use.
May be null
.RenderableOp
destination.IllegalArgumentException
- if source0
is null
.JAI
,
ParameterBlockJAI
,
RenderableOp
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |