javax.imageio
Class IIOParam

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.imageio.IIOParam
Direct Known Subclasses:
ImageReadParam sample code for javax.imageio.ImageReadParam definition code for javax.imageio.ImageReadParam , ImageWriteParam sample code for javax.imageio.ImageWriteParam definition code for javax.imageio.ImageWriteParam

public abstract class IIOParam
extends Object sample code for java.lang.Object definition code for java.lang.Object

A superclass of all classes describing how streams should be decoded or encoded. This class contains all the variables and methods that are shared by 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.


Field Summary
protected  IIOParamController sample code for javax.imageio.IIOParamController definition code for javax.imageio.IIOParamController controller sample code for javax.imageio.IIOParam.controller definition code for javax.imageio.IIOParam.controller
          The IIOParamController that will be used to provide settings for this IIOParam object when the activateController method is called.
protected  IIOParamController sample code for javax.imageio.IIOParamController definition code for javax.imageio.IIOParamController defaultController sample code for javax.imageio.IIOParam.defaultController definition code for javax.imageio.IIOParam.defaultController
          The default IIOParamController that will be used to provide settings for this IIOParam object when the activateController method is called.
protected  Point sample code for java.awt.Point definition code for java.awt.Point destinationOffset sample code for javax.imageio.IIOParam.destinationOffset definition code for javax.imageio.IIOParam.destinationOffset
          The offset in the destination where the upper-left decoded pixel should be placed.
protected  ImageTypeSpecifier sample code for javax.imageio.ImageTypeSpecifier definition code for javax.imageio.ImageTypeSpecifier destinationType sample code for javax.imageio.IIOParam.destinationType definition code for javax.imageio.IIOParam.destinationType
          An ImageTypeSpecifier to be used to generate a destination image when reading, or to set the output color type when writing.
protected  int[] sourceBands sample code for javax.imageio.IIOParam.sourceBands definition code for javax.imageio.IIOParam.sourceBands
          An array of ints indicating which source bands will be used, or null.
protected  Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle sourceRegion sample code for javax.imageio.IIOParam.sourceRegion definition code for javax.imageio.IIOParam.sourceRegion
          The source region, on null if none is set.
protected  int sourceXSubsampling sample code for javax.imageio.IIOParam.sourceXSubsampling definition code for javax.imageio.IIOParam.sourceXSubsampling
          The decimation subsampling to be applied in the horizontal direction.
protected  int sourceYSubsampling sample code for javax.imageio.IIOParam.sourceYSubsampling definition code for javax.imageio.IIOParam.sourceYSubsampling
          The decimation subsampling to be applied in the vertical direction.
protected  int subsamplingXOffset sample code for javax.imageio.IIOParam.subsamplingXOffset definition code for javax.imageio.IIOParam.subsamplingXOffset
          A horizontal offset to be applied to the subsampling grid before subsampling.
protected  int subsamplingYOffset sample code for javax.imageio.IIOParam.subsamplingYOffset definition code for javax.imageio.IIOParam.subsamplingYOffset
          A vertical offset to be applied to the subsampling grid before subsampling.
 
Constructor Summary
protected IIOParam sample code for javax.imageio.IIOParam.IIOParam() definition code for javax.imageio.IIOParam.IIOParam() ()
          Protected constructor may be called only by subclasses.
 
Method Summary
 boolean activateController sample code for javax.imageio.IIOParam.activateController() definition code for javax.imageio.IIOParam.activateController() ()
          Activates the installed IIOParamController for this IIOParam object and returns the resulting value.
 IIOParamController sample code for javax.imageio.IIOParamController definition code for javax.imageio.IIOParamController getController sample code for javax.imageio.IIOParam.getController() definition code for javax.imageio.IIOParam.getController() ()
          Returns whatever IIOParamController is currently installed.
 IIOParamController sample code for javax.imageio.IIOParamController definition code for javax.imageio.IIOParamController getDefaultController sample code for javax.imageio.IIOParam.getDefaultController() definition code for javax.imageio.IIOParam.getDefaultController() ()
          Returns the default IIOParamController, if there is one, regardless of the currently installed controller.
 Point sample code for java.awt.Point definition code for java.awt.Point getDestinationOffset sample code for javax.imageio.IIOParam.getDestinationOffset() definition code for javax.imageio.IIOParam.getDestinationOffset() ()
          Returns the offset in the destination image at which pixels are to be placed.
 ImageTypeSpecifier sample code for javax.imageio.ImageTypeSpecifier definition code for javax.imageio.ImageTypeSpecifier getDestinationType sample code for javax.imageio.IIOParam.getDestinationType() definition code for javax.imageio.IIOParam.getDestinationType() ()
          Returns the type of image to be returned by the read, if one was set by a call to setDestination(ImageTypeSpecifier), as an ImageTypeSpecifier.
 int[] getSourceBands sample code for javax.imageio.IIOParam.getSourceBands() definition code for javax.imageio.IIOParam.getSourceBands() ()
          Returns the set of of source bands to be used.
 Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle getSourceRegion sample code for javax.imageio.IIOParam.getSourceRegion() definition code for javax.imageio.IIOParam.getSourceRegion() ()
          Returns the source region to be used.
 int getSourceXSubsampling sample code for javax.imageio.IIOParam.getSourceXSubsampling() definition code for javax.imageio.IIOParam.getSourceXSubsampling() ()
          Returns the number of source columns to advance for each pixel.
 int getSourceYSubsampling sample code for javax.imageio.IIOParam.getSourceYSubsampling() definition code for javax.imageio.IIOParam.getSourceYSubsampling() ()
          Returns the number of rows to advance for each pixel.
 int getSubsamplingXOffset sample code for javax.imageio.IIOParam.getSubsamplingXOffset() definition code for javax.imageio.IIOParam.getSubsamplingXOffset() ()
          Returns the horizontal offset of the subsampling grid.
 int getSubsamplingYOffset sample code for javax.imageio.IIOParam.getSubsamplingYOffset() definition code for javax.imageio.IIOParam.getSubsamplingYOffset() ()
          Returns the vertical offset of the subsampling grid.
 boolean hasController sample code for javax.imageio.IIOParam.hasController() definition code for javax.imageio.IIOParam.hasController() ()
          Returns true if there is a controller installed for this IIOParam object.
 void setController sample code for javax.imageio.IIOParam.setController(javax.imageio.IIOParamController) definition code for javax.imageio.IIOParam.setController(javax.imageio.IIOParamController) (IIOParamController sample code for javax.imageio.IIOParamController definition code for javax.imageio.IIOParamController  controller)
          Sets the IIOParamController to be used to provide settings for this IIOParam object when the activateController method is called, overriding any default controller.
 void setDestinationOffset sample code for javax.imageio.IIOParam.setDestinationOffset(java.awt.Point) definition code for javax.imageio.IIOParam.setDestinationOffset(java.awt.Point) (Point sample code for java.awt.Point definition code for java.awt.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.
 void setDestinationType sample code for javax.imageio.IIOParam.setDestinationType(javax.imageio.ImageTypeSpecifier) definition code for javax.imageio.IIOParam.setDestinationType(javax.imageio.ImageTypeSpecifier) (ImageTypeSpecifier sample code for javax.imageio.ImageTypeSpecifier definition code for javax.imageio.ImageTypeSpecifier  destinationType)
          Sets the desired image type for the destination image, using an ImageTypeSpecifier.
 void setSourceBands sample code for javax.imageio.IIOParam.setSourceBands(int[]) definition code for javax.imageio.IIOParam.setSourceBands(int[]) (int[] sourceBands)
          Sets the indices of the source bands to be used.
 void setSourceRegion sample code for javax.imageio.IIOParam.setSourceRegion(java.awt.Rectangle) definition code for javax.imageio.IIOParam.setSourceRegion(java.awt.Rectangle) (Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  sourceRegion)
          Sets the source region of interest.
 void setSourceSubsampling sample code for javax.imageio.IIOParam.setSourceSubsampling(int, int, int, int) definition code for javax.imageio.IIOParam.setSourceSubsampling(int, int, int, int) (int sourceXSubsampling, int sourceYSubsampling, int subsamplingXOffset, int subsamplingYOffset)
          Specifies a decimation subsampling to apply on I/O.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Field Detail

sourceRegion sample code for javax.imageio.IIOParam.sourceRegion

protected Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  sourceRegion
The source region, on null if none is set.


sourceXSubsampling sample code for javax.imageio.IIOParam.sourceXSubsampling

protected int sourceXSubsampling
The decimation subsampling to be applied in the horizontal direction. By default, the value is 1. The value must not be negative or 0.


sourceYSubsampling sample code for javax.imageio.IIOParam.sourceYSubsampling

protected int sourceYSubsampling
The decimation subsampling to be applied in the vertical direction. By default, the value is 1. The value must not be negative or 0.


subsamplingXOffset sample code for javax.imageio.IIOParam.subsamplingXOffset

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 sample code for javax.imageio.IIOParam.subsamplingYOffset

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.


sourceBands sample code for javax.imageio.IIOParam.sourceBands

protected int[] sourceBands
An array of ints indicating which source bands will be used, or null. If null, the set of source bands to be used is as described in the comment for the setSourceBands method. No value should be allowed to be negative.


destinationType sample code for javax.imageio.IIOParam.destinationType

protected ImageTypeSpecifier sample code for javax.imageio.ImageTypeSpecifier definition code for javax.imageio.ImageTypeSpecifier  destinationType
An ImageTypeSpecifier to be used to generate a destination image when reading, or to set the output color type when writing. If non has been setm the value will be null. By default, the value is null.


destinationOffset sample code for javax.imageio.IIOParam.destinationOffset

protected Point sample code for java.awt.Point definition code for java.awt.Point  destinationOffset
The offset in the destination where the upper-left decoded pixel should be placed. By default, the value is (0, 0).


defaultController sample code for javax.imageio.IIOParam.defaultController

protected IIOParamController sample code for javax.imageio.IIOParamController definition code for javax.imageio.IIOParamController  defaultController
The default IIOParamController that will be used to provide settings for this IIOParam object when the activateController method is called. This default should be set by subclasses that choose to provide their own default controller, usually a GUI, for setting parameters.

See Also:
IIOParamController sample code for javax.imageio.IIOParamController definition code for javax.imageio.IIOParamController , getDefaultController() sample code for javax.imageio.IIOParam.getDefaultController() definition code for javax.imageio.IIOParam.getDefaultController() , activateController() sample code for javax.imageio.IIOParam.activateController() definition code for javax.imageio.IIOParam.activateController()

controller sample code for javax.imageio.IIOParam.controller

protected IIOParamController sample code for javax.imageio.IIOParamController definition code for javax.imageio.IIOParamController  controller
The IIOParamController that will be used to provide settings for this IIOParam object when the activateController method is called. This value overrides any default controller, even when null.

See Also:
IIOParamController sample code for javax.imageio.IIOParamController definition code for javax.imageio.IIOParamController , setController(IIOParamController) sample code for javax.imageio.IIOParam.setController(javax.imageio.IIOParamController) definition code for javax.imageio.IIOParam.setController(javax.imageio.IIOParamController) , hasController() sample code for javax.imageio.IIOParam.hasController() definition code for javax.imageio.IIOParam.hasController() , activateController() sample code for javax.imageio.IIOParam.activateController() definition code for javax.imageio.IIOParam.activateController()
Constructor Detail

IIOParam sample code for javax.imageio.IIOParam() definition code for javax.imageio.IIOParam()

protected IIOParam()
Protected constructor may be called only by subclasses.

Method Detail

setSourceRegion sample code for javax.imageio.IIOParam.setSourceRegion(java.awt.Rectangle) definition code for javax.imageio.IIOParam.setSourceRegion(java.awt.Rectangle)

public void setSourceRegion(Rectangle sample code for java.awt.Rectangle definition code for java.awt.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 setSourceSubsampling. If subsampling has been set such that this number is zero, an IllegalStateException will be thrown.

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 null for sourceRegion will remove any region specification, causing the entire image to be used.

Parameters:
sourceRegion - a Rectangle specifying the source region of interest, or null.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if sourceRegion is non-null and either sourceRegion.x or sourceRegion.y is negative.
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if sourceRegion is non-null and either sourceRegion.width or sourceRegion.height is negative or 0.
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if subsampling is such that this region will have a subsampled width or height of zero.
See Also:
getSourceRegion() sample code for javax.imageio.IIOParam.getSourceRegion() definition code for javax.imageio.IIOParam.getSourceRegion() , setSourceSubsampling(int, int, int, int) sample code for javax.imageio.IIOParam.setSourceSubsampling(int, int, int, int) definition code for javax.imageio.IIOParam.setSourceSubsampling(int, int, int, int) , setDestinationOffset(java.awt.Point) sample code for javax.imageio.IIOParam.setDestinationOffset(java.awt.Point) definition code for javax.imageio.IIOParam.setDestinationOffset(java.awt.Point) , getDestinationOffset() sample code for javax.imageio.IIOParam.getDestinationOffset() definition code for javax.imageio.IIOParam.getDestinationOffset()

getSourceRegion sample code for javax.imageio.IIOParam.getSourceRegion() definition code for javax.imageio.IIOParam.getSourceRegion()

public Rectangle sample code for java.awt.Rectangle definition code for java.awt.Rectangle  getSourceRegion()
Returns the source region to be used. The returned value is that set by the most recent call to setSourceRegion, and will be null if there is no region set.

Returns:
the source region of interest as a Rectangle, or null.
See Also:
setSourceRegion(java.awt.Rectangle) sample code for javax.imageio.IIOParam.setSourceRegion(java.awt.Rectangle) definition code for javax.imageio.IIOParam.setSourceRegion(java.awt.Rectangle)

setSourceSubsampling sample code for javax.imageio.IIOParam.setSourceSubsampling(int, int, int, int) definition code for javax.imageio.IIOParam.setSourceSubsampling(int, int, int, int)

public void setSourceSubsampling(int sourceXSubsampling,
                                 int sourceYSubsampling,
                                 int subsamplingXOffset,
                                 int subsamplingYOffset)
Specifies a decimation subsampling to apply on I/O. The sourceXSubsampling and sourceYSubsampling parameters specify the subsampling period (i.e., the number of rows and columns to advance after every source pixel). Specifically, a period of 1 will use every row or column; a period of 2 will use every other row or column. The subsamplingXOffset and subsamplingYOffset parameters specify an offset from the region (or image) origin for the first subsampled pixel. Adjusting the origin of the subsample grid is useful for avoiding seams when subsampling a very large source image into destination regions that will be assembled into a complete subsampled image. Most users will want to simply leave these parameters at 0.

The number of pixels and scanlines to be used are calculated as follows.

The number of subsampled pixels in a scanline is given by

truncate[(width - subsamplingXOffset + sourceXSubsampling - 1) / sourceXSubsampling].

If the region is such that this width is zero, an IllegalStateException is thrown.

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:
grid offset = [period - (region offset modulo period)] modulo period)

If either sourceXSubsampling or sourceYSubsampling is 0 or negative, an IllegalArgumentException will be thrown.

If either subsamplingXOffset or subsamplingYOffset is negative or greater than or equal to the corresponding period, an IllegalArgumentException will be thrown.

There is no unsetSourceSubsampling method; simply call setSourceSubsampling(1, 1, 0, 0) to restore default values.

Parameters:
sourceXSubsampling - the number of columns to advance between pixels.
sourceYSubsampling - the number of rows to advance between pixels.
subsamplingXOffset - the horizontal offset of the first subsample within the region, or within the image if no region is set.
subsamplingYOffset - the horizontal offset of the first subsample within the region, or within the image if no region is set.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if either period is negative or 0, or if either grid offset is negative or greater than the corresponding period.
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if the source region is such that the subsampled output would contain no pixels.

getSourceXSubsampling sample code for javax.imageio.IIOParam.getSourceXSubsampling() definition code for javax.imageio.IIOParam.getSourceXSubsampling()

public int getSourceXSubsampling()
Returns the number of source columns to advance for each pixel.

If setSourceSubsampling has not been called, 1 is returned (which is the correct value).

Returns:
the source subsampling X period.
See Also:
setSourceSubsampling(int, int, int, int) sample code for javax.imageio.IIOParam.setSourceSubsampling(int, int, int, int) definition code for javax.imageio.IIOParam.setSourceSubsampling(int, int, int, int) , getSourceYSubsampling() sample code for javax.imageio.IIOParam.getSourceYSubsampling() definition code for javax.imageio.IIOParam.getSourceYSubsampling()

getSourceYSubsampling sample code for javax.imageio.IIOParam.getSourceYSubsampling() definition code for javax.imageio.IIOParam.getSourceYSubsampling()

public int getSourceYSubsampling()
Returns the number of rows to advance for each pixel.

If setSourceSubsampling has not been called, 1 is returned (which is the correct value).

Returns:
the source subsampling Y period.
See Also:
setSourceSubsampling(int, int, int, int) sample code for javax.imageio.IIOParam.setSourceSubsampling(int, int, int, int) definition code for javax.imageio.IIOParam.setSourceSubsampling(int, int, int, int) , getSourceXSubsampling() sample code for javax.imageio.IIOParam.getSourceXSubsampling() definition code for javax.imageio.IIOParam.getSourceXSubsampling()

getSubsamplingXOffset sample code for javax.imageio.IIOParam.getSubsamplingXOffset() definition code for javax.imageio.IIOParam.getSubsamplingXOffset()

public int getSubsamplingXOffset()
Returns the horizontal offset of the subsampling grid.

If setSourceSubsampling has not been called, 0 is returned (which is the correct value).

Returns:
the source subsampling grid X offset.
See Also:
setSourceSubsampling(int, int, int, int) sample code for javax.imageio.IIOParam.setSourceSubsampling(int, int, int, int) definition code for javax.imageio.IIOParam.setSourceSubsampling(int, int, int, int) , getSubsamplingYOffset() sample code for javax.imageio.IIOParam.getSubsamplingYOffset() definition code for javax.imageio.IIOParam.getSubsamplingYOffset()

getSubsamplingYOffset sample code for javax.imageio.IIOParam.getSubsamplingYOffset() definition code for javax.imageio.IIOParam.getSubsamplingYOffset()

public int getSubsamplingYOffset()
Returns the vertical offset of the subsampling grid.

If setSourceSubsampling has not been called, 0 is returned (which is the correct value).

Returns:
the source subsampling grid Y offset.
See Also:
setSourceSubsampling(int, int, int, int) sample code for javax.imageio.IIOParam.setSourceSubsampling(int, int, int, int) definition code for javax.imageio.IIOParam.setSourceSubsampling(int, int, int, int) , getSubsamplingXOffset() sample code for javax.imageio.IIOParam.getSubsamplingXOffset() definition code for javax.imageio.IIOParam.getSubsamplingXOffset()

setSourceBands sample code for javax.imageio.IIOParam.setSourceBands(int[]) definition code for javax.imageio.IIOParam.setSourceBands(int[])

public void setSourceBands(int[] sourceBands)
Sets the indices of the source bands to be used. Duplicate indices are not allowed.

A null value indicates that all source bands will be used.

At the time of reading, an IllegalArgumentException will be thrown by the reader or writer if a value larger than the largest available source band index has been specified or if the number of source bands and destination bands to be used differ. The ImageReader.checkReadParamBandSettings method may be used to automate this test.

Semantically, a copy is made of the array; changes to the array contents subsequent to this call have no effect on this IIOParam.

Parameters:
sourceBands - an array of integer band indices to be used.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if sourceBands contains a negative or duplicate value.
See Also:
getSourceBands() sample code for javax.imageio.IIOParam.getSourceBands() definition code for javax.imageio.IIOParam.getSourceBands() , ImageReadParam.setDestinationBands(int[]) sample code for javax.imageio.ImageReadParam.setDestinationBands(int[]) definition code for javax.imageio.ImageReadParam.setDestinationBands(int[]) , ImageReader.checkReadParamBandSettings(javax.imageio.ImageReadParam, int, int) sample code for javax.imageio.ImageReader.checkReadParamBandSettings(javax.imageio.ImageReadParam, int, int) definition code for javax.imageio.ImageReader.checkReadParamBandSettings(javax.imageio.ImageReadParam, int, int)

getSourceBands sample code for javax.imageio.IIOParam.getSourceBands() definition code for javax.imageio.IIOParam.getSourceBands()

public int[] getSourceBands()
Returns the set of of source bands to be used. The returned value is that set by the most recent call to setSourceBands, or null if there have been no calls to setSourceBands.

Semantically, the array returned is a copy; changes to array contents subsequent to this call have no effect on this IIOParam.

Returns:
the set of source bands to be used, or null.
See Also:
setSourceBands(int[]) sample code for javax.imageio.IIOParam.setSourceBands(int[]) definition code for javax.imageio.IIOParam.setSourceBands(int[])

setDestinationType sample code for javax.imageio.IIOParam.setDestinationType(javax.imageio.ImageTypeSpecifier) definition code for javax.imageio.IIOParam.setDestinationType(javax.imageio.ImageTypeSpecifier)

public void setDestinationType(ImageTypeSpecifier sample code for javax.imageio.ImageTypeSpecifier definition code for javax.imageio.ImageTypeSpecifier  destinationType)
Sets the desired image type for the destination image, using an ImageTypeSpecifier.

When reading, if the layout of the destination has been set using this method, each call to an ImageReader read method will return a new BufferedImage using the format specified by the supplied type specifier. As a side effect, any destination BufferedImage set by ImageReadParam.setDestination(BufferedImage) will no longer be set as the destination. In other words, this method may be thought of as calling setDestination((BufferedImage)null).

When writing, the destination type maybe used to determine the color type of the image. The SampleModel information will be ignored, and may be null. For example, a 4-banded image could represent either CMYK or RGBA data. If a destination type is set, its ColorModel will override any ColorModel on the image itself. This is crucial when setSourceBands is used since the image's ColorModel will refer to the entire image rather than to the subset of bands being written.

Parameters:
destinationType - the ImageTypeSpecifier to be used to determine the destination layout and color type.
See Also:
getDestinationType() sample code for javax.imageio.IIOParam.getDestinationType() definition code for javax.imageio.IIOParam.getDestinationType()

getDestinationType sample code for javax.imageio.IIOParam.getDestinationType() definition code for javax.imageio.IIOParam.getDestinationType()

public ImageTypeSpecifier sample code for javax.imageio.ImageTypeSpecifier definition code for javax.imageio.ImageTypeSpecifier  getDestinationType()
Returns the type of image to be returned by the read, if one was set by a call to setDestination(ImageTypeSpecifier), as an ImageTypeSpecifier. If none was set, null is returned.

Returns:
an ImageTypeSpecifier describing the destination type, or null.
See Also:
setDestinationType(javax.imageio.ImageTypeSpecifier) sample code for javax.imageio.IIOParam.setDestinationType(javax.imageio.ImageTypeSpecifier) definition code for javax.imageio.IIOParam.setDestinationType(javax.imageio.ImageTypeSpecifier)

setDestinationOffset sample code for javax.imageio.IIOParam.setDestinationOffset(java.awt.Point) definition code for javax.imageio.IIOParam.setDestinationOffset(java.awt.Point)

public void setDestinationOffset(Point sample code for java.awt.Point definition code for java.awt.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 BufferedImage will start at this offset and have a width and height determined by the source region of interest, the subsampling parameters, and the destination bounds.

Normal writes are not affected by this method, only writes performed using ImageWriter.replacePixels. For such writes, the offset specified is within the output stream image whose pixels are being modified.

There is no unsetDestinationOffset method; simply call setDestinationOffset(new Point(0, 0)) to restore default values.

Parameters:
destinationOffset - the offset in the destination, as a Point.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if destinationOffset is null.
See Also:
getDestinationOffset() sample code for javax.imageio.IIOParam.getDestinationOffset() definition code for javax.imageio.IIOParam.getDestinationOffset() , ImageWriter.replacePixels(java.awt.image.RenderedImage, javax.imageio.ImageWriteParam) sample code for javax.imageio.ImageWriter.replacePixels(java.awt.image.RenderedImage, javax.imageio.ImageWriteParam) definition code for javax.imageio.ImageWriter.replacePixels(java.awt.image.RenderedImage, javax.imageio.ImageWriteParam)

getDestinationOffset sample code for javax.imageio.IIOParam.getDestinationOffset() definition code for javax.imageio.IIOParam.getDestinationOffset()

public Point sample code for java.awt.Point definition code for java.awt.Point  getDestinationOffset()
Returns the offset in the destination image at which pixels are to be placed.

If setDestinationOffsets has not been called, a Point with zero X and Y values is returned (which is the correct value).

Returns:
the destination offset as a Point.
See Also:
setDestinationOffset(java.awt.Point) sample code for javax.imageio.IIOParam.setDestinationOffset(java.awt.Point) definition code for javax.imageio.IIOParam.setDestinationOffset(java.awt.Point)

setController sample code for javax.imageio.IIOParam.setController(javax.imageio.IIOParamController) definition code for javax.imageio.IIOParam.setController(javax.imageio.IIOParamController)

public void setController(IIOParamController sample code for javax.imageio.IIOParamController definition code for javax.imageio.IIOParamController  controller)
Sets the IIOParamController to be used to provide settings for this IIOParam object when the activateController method is called, overriding any default controller. If the argument is null, no controller will be used, including any default. To restore the default, use setController(getDefaultController()).

Parameters:
controller - An appropriate IIOParamController, or null.
See Also:
IIOParamController sample code for javax.imageio.IIOParamController definition code for javax.imageio.IIOParamController , getController() sample code for javax.imageio.IIOParam.getController() definition code for javax.imageio.IIOParam.getController() , getDefaultController() sample code for javax.imageio.IIOParam.getDefaultController() definition code for javax.imageio.IIOParam.getDefaultController() , hasController() sample code for javax.imageio.IIOParam.hasController() definition code for javax.imageio.IIOParam.hasController() , activateController() sample code for javax.imageio.IIOParam.activateController() definition code for javax.imageio.IIOParam.activateController()

getController sample code for javax.imageio.IIOParam.getController() definition code for javax.imageio.IIOParam.getController()

public IIOParamController sample code for javax.imageio.IIOParamController definition code for javax.imageio.IIOParamController  getController()
Returns whatever IIOParamController is currently installed. This could be the default if there is one, null, or the argument of the most recent call to setController.

Returns:
the currently installed IIOParamController, or null.
See Also:
IIOParamController sample code for javax.imageio.IIOParamController definition code for javax.imageio.IIOParamController , setController(javax.imageio.IIOParamController) sample code for javax.imageio.IIOParam.setController(javax.imageio.IIOParamController) definition code for javax.imageio.IIOParam.setController(javax.imageio.IIOParamController) , getDefaultController() sample code for javax.imageio.IIOParam.getDefaultController()