|
|||||||||
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.RescaleDescriptor
An OperationDescriptor
describing the "Rescale" operation.
The "Rescale" operation takes a rendered or renderable source image and maps the pixel values of an image from one range to another range by multiplying each pixel value by one of a set of constants and then adding another constant to the result of the multiplication. If the number of constants supplied is less than the number of bands of the destination, then the constant from entry 0 is applied to all the bands. Otherwise, a constant from a different entry is applied to each band. There must be at least one entry in each of the contants and offsets arrays.
The destination pixel values are defined by the pseudocode:
constant = (constants.length < dstNumBands) ? constants[0] : constants[b]; offset = (offsets.length < dstNumBands) ? offsets[0] : offsets[b]; dst[x][y][b] = src[x][y][b]*constant + offset;
The pixel arithmetic is performed using the data type of the
destination image. By default, the destination will have the same
data type as the source image unless an ImageLayout
containing a SampleModel
with a different data type
is supplied as a rendering hint.
Name | Value |
---|---|
GlobalName | Rescale |
LocalName | Rescale |
Vendor | com.sun.media.jai |
Description | Maps the pixels values of an image from one range to another range. |
DocURL | http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/javax/media/jai/operator/RescaleDescriptor.html |
Version | 1.0 |
arg0Desc | The per-band constants to multiply by. |
arg1Desc | The per-band offsets to be added. |
Name | Class Type | Default Value |
---|---|---|
constants | double[] | {1.0} |
offsets | double[] | {0.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 | |
RescaleDescriptor()
Constructor. |
Method Summary | |
static RenderedOp |
create(RenderedImage source0,
double[] constants,
double[] offsets,
RenderingHints hints)
Maps the pixels values of an image from one range to another range. |
static RenderableOp |
createRenderable(RenderableImage source0,
double[] constants,
double[] offsets,
RenderingHints hints)
Maps the pixels values of an image from one range to another 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 RescaleDescriptor()
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 the length of the "constants" and "offsets" arrays are each at least 1.
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[] constants, double[] offsets, RenderingHints hints)
Creates a ParameterBlockJAI
from all
supplied arguments except hints
and invokes
JAI.create(String,ParameterBlock,RenderingHints)
.
source0
- RenderedImage
source 0.constants
- The per-band constants to multiply by.
May be null
.offsets
- The per-band offsets to be added.
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[] constants, double[] offsets, RenderingHints hints)
Creates a ParameterBlockJAI
from all
supplied arguments except hints
and invokes
JAI.createRenderable(String,ParameterBlock,RenderingHints)
.
source0
- RenderableImage
source 0.constants
- The per-band constants to multiply by.
May be null
.offsets
- The per-band offsets to be added.
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 |