| javax.media.jai.GeometricOpImage com.sun.media.jai.opimage.SubsampleBinaryToGrayOpImage
All known Subclasses: com.sun.media.jai.mlib.MlibSubsampleBinaryToGrayOpImage,
SubsampleBinaryToGrayOpImage | public class SubsampleBinaryToGrayOpImage extends GeometricOpImage (Code) | | A class extending GeometricOpImage to
subsample binary images to gray scale images. Image scaling operations
require rectilinear backwards mapping and padding by the resampling
filter dimensions.
When applying scale factors of scaleX, scaleY to a source image
with width of src_width and height of src_height, the resulting image
is defined to have the following bounds:
dst minX = floor(src minX * scaleX)
dst minY = floor(src minY * scaleY)
dst width = floor(src width * scaleX)
dst height = floor(src height * scaleY)
See Also: ScaleOpImage |
Field Summary | |
protected float | invScaleX Cached value equal to 1/scaleX. | protected float | invScaleY Cached value equal to 1/scaleY. | protected byte[] | lutGray Convert from number of bits on count to gray value, with
scaling, i.e. | protected float | scaleX The horizontal scale factor. | protected float | scaleY The vertical scale factor. |
Constructor Summary | |
public | SubsampleBinaryToGrayOpImage(RenderedImage source, ImageLayout layout, Map config, float scaleX, float scaleY) Constructs a SubsampleBinaryToGrayOpImage
from a RenderedImage source, x and y scale
object. |
Method Summary | |
protected Rectangle | backwardMapRect(Rectangle destRect, int sourceIndex) Returns the minimum bounding box of the region of the specified
source to which a particular Rectangle of the
destination will be mapped.
Parameters: destRect - the Rectangle in destination coordinates. Parameters: sourceIndex - the index of the source image. | protected void | computeRect(Raster[] sources, WritableRaster dest, Rectangle destRect) Performs a subsamplebinarytogray operation on a specified rectangle. | protected Rectangle | forwardMapRect(Rectangle sourceRect, int sourceIndex) Returns the minimum bounding box of the region of the destination
to which a particular Rectangle of the specified source
will be mapped.
Parameters: sourceRect - the Rectangle in source coordinates. Parameters: sourceIndex - the index of the source image. | static boolean | isMinWhite(ColorModel cm) | static ImageLayout | layoutHelper(RenderedImage source, float scaleX, float scaleY, ImageLayout il, Map config) | public Point2D | mapDestPoint(Point2D destPt) Computes the source point corresponding to the supplied point.
Parameters: destPt - the position in destination image coordinatesto map to source image coordinates. | public Point2D | mapSourcePoint(Point2D sourcePt) Computes the destination point corresponding to the supplied point.
Parameters: sourcePt - the position in source image coordinatesto map to destination image coordinates. |
invScaleX | protected float invScaleX(Code) | | Cached value equal to 1/scaleX.
|
invScaleY | protected float invScaleY(Code) | | Cached value equal to 1/scaleY.
|
lutGray | protected byte[] lutGray(Code) | | Convert from number of bits on count to gray value, with
scaling, i.e. if invScaleX,Y=3,3, then the possible bit
counts are 0..9, hence the lookup tables are [0..9] * 255/9.
|
scaleX | protected float scaleX(Code) | | The horizontal scale factor.
|
scaleY | protected float scaleY(Code) | | The vertical scale factor.
|
SubsampleBinaryToGrayOpImage | public SubsampleBinaryToGrayOpImage(RenderedImage source, ImageLayout layout, Map config, float scaleX, float scaleY)(Code) | | Constructs a SubsampleBinaryToGrayOpImage
from a RenderedImage source, x and y scale
object. The image dimensions are determined by forward-mapping
the source bounds, and are passed to the superclass constructor
by means of the layout parameter. Other fields of
the layout are passed through unchanged. If
layout is null , a new
ImageLayout will be constructor to hold the bounds
information.
The float rounding errors, such as 1.2 being
internally represented as 1.200001, are dealt with
the floatTol, which is set up so that only 1/10 of pixel
error will occur at the end of a line, which yields correct
results with Math.round() operation.
The repeatability is guaranteed with a one-time computed
table xvalues and yvalues.
Parameters: layout - an ImageLayout optionally containingthe tile grid layout, SampleModel , andColorModel , or null . Parameters: source - a RenderedImage .from this OpImage , or null . Ifnull , no caching will be performed. Parameters: cobbleSources - a boolean indicating whethercomputeRect expects contiguous sources. Parameters: extender - a BorderExtender , or null . Parameters: interp - an Interpolation object to use forresampling. Parameters: scaleX - scale factor along x axis. Parameters: scaleY - scale factor along y axis. throws: IllegalArgumentException - if combining thesource bounds with the layout parameter results in negativeoutput width or height. |
backwardMapRect | protected Rectangle backwardMapRect(Rectangle destRect, int sourceIndex)(Code) | | Returns the minimum bounding box of the region of the specified
source to which a particular Rectangle of the
destination will be mapped.
Parameters: destRect - the Rectangle in destination coordinates. Parameters: sourceIndex - the index of the source image. a Rectangle indicating the source bounding box,or null if the bounding box is unknown. throws: IllegalArgumentException - if sourceIndex isnegative or greater than the index of the last source. throws: IllegalArgumentException - if destRect isnull . |
computeRect | protected void computeRect(Raster[] sources, WritableRaster dest, Rectangle destRect)(Code) | | Performs a subsamplebinarytogray operation on a specified rectangle.
The sources are cobbled.
Parameters: sources - an array of source Rasters, guaranteed to provide allnecessary source data for computing the output. Parameters: dest - a WritableRaster containing the area to be computed. Parameters: destRect - the rectangle within dest to be processed. |
forwardMapRect | protected Rectangle forwardMapRect(Rectangle sourceRect, int sourceIndex)(Code) | | Returns the minimum bounding box of the region of the destination
to which a particular Rectangle of the specified source
will be mapped.
Parameters: sourceRect - the Rectangle in source coordinates. Parameters: sourceIndex - the index of the source image. a Rectangle indicating the destinationbounding box, or null if the bounding boxis unknown. throws: IllegalArgumentException - if sourceIndex isnegative or greater than the index of the last source. throws: IllegalArgumentException - if sourceRect isnull . |
mapDestPoint | public Point2D mapDestPoint(Point2D destPt)(Code) | | Computes the source point corresponding to the supplied point.
Parameters: destPt - the position in destination image coordinatesto map to source image coordinates. a Point2D of the same class asdestPt . throws: IllegalArgumentException - if destPt isnull . since: JAI 1.1.2 |
mapSourcePoint | public Point2D mapSourcePoint(Point2D sourcePt)(Code) | | Computes the destination point corresponding to the supplied point.
Parameters: sourcePt - the position in source image coordinatesto map to destination image coordinates. a Point2D of the same class assourcePt . throws: IllegalArgumentException - if sourcePt isnull . since: JAI 1.1.2 |
|
|