ImageReadParam and
ImageWriteParam.
This class provides mechanisms to specify a source region and a destination region. When reading, the source is the stream and the in-memory image is the destination. When writing, these are reversed. In the case of writing, destination regions may be used only with a writer that supports pixel replacement.
Decimation subsampling may be specified for both readers and writers, using a movable subsampling grid.
Subsets of the source and destination bands may be selected.
| Modifier and Type | Field and Description |
|---|---|
| protected IIOParamController | controller
The |
| protected IIOParamController | defaultController
The default |
| protected Point | destinationOffset
The offset in the destination where the upper-left decoded pixel should be placed. |
| protected ImageTypeSpecifier | destinationType
An |
| protected int[] | sourceBands
An array of |
| protected Rectangle | sourceRegion
The source region, on |
| protected int | sourceXSubsampling
The decimation subsampling to be applied in the horizontal direction. |
| protected int | sourceYSubsampling
The decimation subsampling to be applied in the vertical direction. |
| protected int | subsamplingXOffset
A horizontal offset to be applied to the subsampling grid before subsampling. |
| protected int | subsamplingYOffset
A vertical offset to be applied to the subsampling grid before subsampling. |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if the controller completed normally.Activates the installed |
| public IIOParamController | Returns: the currently installedIIOParamController, or null.Returns whatever |
| public IIOParamController | Returns: the defaultIIOParamController, or
null.Returns the default |
| public Point | Returns: the destination offset as aPoint.Returns the offset in the destination image at which pixels are to be placed. |
| public ImageTypeSpecifier | Returns: anImageTypeSpecifier describing the
destination type, or null.Returns the type of image to be returned by the read, if one
was set by a call to
|
| public int[] | Returns: the set of source bands to be used, ornull.Returns the set of source bands to be used. |
| public Rectangle | Returns: the source region of interest as aRectangle, or null.Returns the source region to be used. |
| public int | Returns: the source subsampling X period.Returns the number of source columns to advance for each pixel. |
| public int | Returns: the source subsampling Y period.Returns the number of rows to advance for each pixel. |
| public int | Returns: the source subsampling grid X offset.Returns the horizontal offset of the subsampling grid. |
| public int | Returns: the source subsampling grid Y offset.Returns the vertical offset of the subsampling grid. |
| public boolean | Returns: true if a controller is installed.Returns |
| public void | setController(IIOParamController
An appropriate
controller)IIOParamController, or null.Sets the |
| public void | setDestinationOffset(Point
the offset in the destination, as a
destinationOffset)Point.Specifies the offset in the destination image at which future decoded pixels are to be placed, when reading, or where a region will be written, when writing. |
| public void | setDestinationType(ImageTypeSpecifier
the destinationType)ImageTypeSpecifier to
be used to determine the destination layout and color type.Sets the desired image type for the destination image, using an
|
| public void | setSourceBands(int[]
an array of integer band indices to be
used. sourceBands)Sets the indices of the source bands to be used. |
| public void | setSourceRegion(Rectangle
a sourceRegion)Rectangle specifying the
source region of interest, or null.Sets the source region of interest. |
| public void | setSourceSubsampling(int
the number of columns to advance
between pixels. sourceXSubsampling, int the number of rows to advance between
pixels. sourceYSubsampling, int the horizontal offset of the first subsample
within the region, or within the image if no region is set. subsamplingXOffset, int the horizontal offset of the first subsample
within the region, or within the image if no region is set. subsamplingYOffset)Specifies a decimation subsampling to apply on I/O. |
| controller | back to summary |
|---|---|
| protected IIOParamController controller The | |
| defaultController | back to summary |
|---|---|
| protected IIOParamController defaultController The default | |
| destinationOffset | back to summary |
|---|---|
| protected Point destinationOffset The offset in the destination where the upper-left decoded pixel should be placed. By default, the value is (0, 0). | |
| destinationType | back to summary |
|---|---|
| protected ImageTypeSpecifier destinationType An | |
| sourceBands | back to summary |
|---|---|
| protected int[] sourceBands An array of | |
| sourceRegion | back to summary |
|---|---|
| protected Rectangle sourceRegion The source region, on | |
| sourceXSubsampling | back to summary |
|---|---|
| protected int sourceXSubsampling The decimation subsampling to be applied in the horizontal
direction. By default, the value is | |
| sourceYSubsampling | back to summary |
|---|---|
| protected int sourceYSubsampling The decimation subsampling to be applied in the vertical
direction. By default, the value is | |
| subsamplingXOffset | back to summary |
|---|---|
| protected int subsamplingXOffset A horizontal offset to be applied to the subsampling grid before subsampling. The first pixel to be used will be offset this amount from the origin of the region, or of the image if no region is specified. | |
| subsamplingYOffset | back to summary |
|---|---|
| protected int subsamplingYOffset A vertical offset to be applied to the subsampling grid before subsampling. The first pixel to be used will be offset this amount from the origin of the region, or of the image if no region is specified. | |
| IIOParam | back to summary |
|---|---|
| protected IIOParam() Protected constructor may be called only by subclasses. | |
| activateController | back to summary |
|---|---|
| public boolean activateController() Activates the installed Ordinarily, the controller will be a GUI providing a user
interface for a subclass of
| |
| getController | back to summary |
|---|---|
| public IIOParamController getController() Returns whatever
| |
| getDefaultController | back to summary |
|---|---|
| public IIOParamController getDefaultController() Returns the default
| |
| getDestinationOffset | back to summary |
|---|---|
| public Point getDestinationOffset() Returns the offset in the destination image at which pixels are to be placed. If
| |
| getDestinationType | back to summary |
|---|---|
| public ImageTypeSpecifier getDestinationType() Returns the type of image to be returned by the read, if one
was set by a call to
| |
| getSourceBands | back to summary |
|---|---|
| public int[] getSourceBands() Returns the set of source bands to be used. The returned
value is that set by the most recent call to
Semantically, the array returned is a copy; changes to
array contents subsequent to this call have no effect on this
| |
| getSourceRegion | back to summary |
|---|---|
| public Rectangle getSourceRegion() Returns the source region to be used. The returned value is
that set by the most recent call to
| |
| getSourceXSubsampling | back to summary |
|---|---|
| public int getSourceXSubsampling() Returns the number of source columns to advance for each pixel. If
| |
| getSourceYSubsampling | back to summary |
|---|---|
| public int getSourceYSubsampling() Returns the number of rows to advance for each pixel. If
| |
| getSubsamplingXOffset | back to summary |
|---|---|
| public int getSubsamplingXOffset() Returns the horizontal offset of the subsampling grid. If
| |
| getSubsamplingYOffset | back to summary |
|---|---|
| public int getSubsamplingYOffset() Returns the vertical offset of the subsampling grid. If
| |
| hasController | back to summary |
|---|---|
| public boolean hasController() Returns
| |
| setController | back to summary |
|---|---|
| public void setController(IIOParamController controller) Sets the
| |
| setDestinationOffset | back to summary |
|---|---|
| public void setDestinationOffset(Point destinationOffset) Specifies the offset in the destination image at which future decoded pixels are to be placed, when reading, or where a region will be written, when writing. When reading, the region to be written within the
destination Normal writes are not affected by this method, only writes
performed using There is no
| |
| setDestinationType | back to summary |
|---|---|
| public void setDestinationType(ImageTypeSpecifier destinationType) Sets the desired image type for the destination image, using an
When reading, if the layout of the destination has been set
using this method, each call to an When writing, the destination type maybe used to determine
the color type of the image. The
| |
| setSourceBands | back to summary |
|---|---|
| public void setSourceBands(int[] sourceBands) Sets the indices of the source bands to be used. Duplicate indices are not allowed. A At the time of reading, an
Semantically, a copy is made of the array; changes to the
array contents subsequent to this call have no effect on
this
| |
| setSourceRegion | back to summary |
|---|---|
| public void setSourceRegion(Rectangle sourceRegion) Sets the source region of interest. The region of interest is
described as a rectangle, with the upper-left corner of the
source image as pixel (0, 0) and increasing values down and to
the right. The actual number of pixels used will depend on
the subsampling factors set by The source region of interest specified by this method will be clipped as needed to fit within the source bounds, as well as the destination offsets, width, and height at the time of actual I/O. A value of
| |
| setSourceSubsampling | back to summary |
|---|---|
| public void setSourceSubsampling(int sourceXSubsampling, int sourceYSubsampling, int subsamplingXOffset, int subsamplingYOffset) Specifies a decimation subsampling to apply on I/O. The
The number of pixels and scanlines to be used are calculated as follows. The number of subsampled pixels in a scanline is given by
If the region is such that this width is zero, an
The number of scanlines to be used can be computed similarly. The ability to set the subsampling grid to start somewhere
other than the source region origin is useful if the
region is being used to create subsampled tiles of a large image,
where the tile width and height are not multiples of the
subsampling periods. If the subsampling grid does not remain
consistent from tile to tile, there will be artifacts at the tile
boundaries. By adjusting the subsampling grid offset for each
tile to compensate, these artifacts can be avoided. The tradeoff
is that in order to avoid these artifacts, the tiles are not all
the same size. The grid offset to use in this case is given by:
If either If either There is no
| |