| javax.media.jai.PointOpImage javax.media.jai.ColormapOpImage com.sun.media.jai.opimage.RescaleOpImage
RescaleOpImage | final class RescaleOpImage extends ColormapOpImage (Code) | | An OpImage implementing the "Rescale" operation.
The "Rescale" operation 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. The pixel values of the destination
image are defined by the pseudocode:
for (int h = 0; h < dstHeight; h++) {
for (int w = 0; w < dstWidth; w++) {
for (int b = 0; b < dstNumBands; b++) {
scale = (scales.length < dstNumBands)?
scales[0]:scales[b];
offset = (offsets.length < dstNumBands)?
offsets[0]:offsets[b];
dst[h][w][b] = srcs[h][w][b] * scale + offset;
}
}
}
See Also: javax.media.jai.operator.RescaleDescriptor See Also: RescaleCRIF since: EA3 |
Field Summary | |
protected double[] | constants The constants to be multiplied, one for each band. | protected double[] | offsets |
Constructor Summary | |
public | RescaleOpImage(RenderedImage source, Map config, ImageLayout layout, double[] constants, double[] offsets) Constructor. |
Method Summary | |
protected void | computeRect(Raster[] sources, WritableRaster dest, Rectangle destRect) Rescales to the pixel values within a specified rectangle. | protected void | transformColormap(byte[][] colormap) Transform the colormap according to the rescaling parameters. |
constants | protected double[] constants(Code) | | The constants to be multiplied, one for each band.
|
offsets | protected double[] offsets(Code) | | |
RescaleOpImage | public RescaleOpImage(RenderedImage source, Map config, ImageLayout layout, double[] constants, double[] offsets)(Code) | | Constructor.
Parameters: source - The source image. Parameters: configuration - Configurable attributes of the image includingconfiguration variables indexed byRenderingHints.Key s and image properties indexedby String s or CaselessStringKey s.This is simply forwarded to the superclass constructor. Parameters: layout - The destination image layout. Parameters: constants - The constants to be multiplied, stored as reference. Parameters: offsets - The offsets to be added, stored as reference. |
computeRect | protected void computeRect(Raster[] sources, WritableRaster dest, Rectangle destRect)(Code) | | Rescales to the pixel values within a specified rectangle.
Parameters: sources - Cobbled sources, guaranteed to provide all thesource data necessary for computing the rectangle. Parameters: dest - The tile containing the rectangle to be computed. Parameters: destRect - The rectangle within the tile to be computed. |
transformColormap | protected void transformColormap(byte[][] colormap)(Code) | | Transform the colormap according to the rescaling parameters.
|
Methods inherited from javax.media.jai.ColormapOpImage | final protected void initializeColormapOperation()(Code)(Java Doc) final protected boolean isColormapOperation()(Code)(Java Doc) abstract protected void transformColormap(byte[][] colormap)(Code)(Java Doc)
|
|
|