|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.imageio.IIOParam
public abstract class IIOParam
An IIOParam stores parameters used when encoding or decoding image streams. ImageReadParam and ImageWriteParam extend this abstract base class. IIOParams allow control over how source pixels converted into destination pixels. This conversion can take place between a stream and in-memory image data, when an image reader is doing the conversion, or a writer can be doing the conversion from an in-memory source to a stream destination. An image reader can be restricted to only read from a given region; likewise a writer can be restricted to only write output to a given region. For image readers and writers, IIOParam supports image pixelation -- where the input image is approximated by the output image using larger-sized pixel blocks. For example: FIXME IIOParams can control how pixels are combined into larger blocks using sub-sampling matrices. For example: FIXME They can also control which source bands are read and written; this example reads the RGBA (red, green, blue, transparency) data from a PNG image and outputs just the red and transparency bands: FIXME
Field Summary | |
---|---|
protected IIOParamController |
controller
The controller called by this IIOParam to retrieve parameters. |
protected IIOParamController |
defaultController
The default controller called by this IIOParam to retrieve parameters. |
protected Point |
destinationOffset
The offset in the destination where the upper-left decoded/encoded pixel should be located. |
protected ImageTypeSpecifier |
destinationType
Sets the output colour type when writing or the destination image type when reading. |
protected int[] |
sourceBands
An array indicating which source bands will be used or null. |
protected Rectangle |
sourceRegion
The source pixel region or null. |
protected int |
sourceXSubsampling
Sample every sourceXSubsampling'th pixel in the source image when pixelating the destination image in the horizontal direction. |
protected int |
sourceYSubsampling
Sample every sourceYSubsampling'th pixel in the source image when pixelating the destination image in the vertical direction. |
protected int |
subsamplingXOffset
Start sampling at this horizontal offset within the source region when pixelating the destination image in the horizontal direction. |
protected int |
subsamplingYOffset
Start sampling at this vertical offset within the source region when pixelating the destination image in the vertical direction. |
Constructor Summary | |
---|---|
protected |
IIOParam()
Constructs an IIOParam object. |
Method Summary | |
---|---|
boolean |
activateController()
Activates the parameter controller by calling its activate method and passing it this IIOParam. |
IIOParamController |
getController()
Retrieve the currently set controller if one has been set, or the default controller, or null if the controller has been explicitly set to null. |
IIOParamController |
getDefaultController()
Retrieve the default controller regardless of whether or not a non-default controller has been set. |
Point |
getDestinationOffset()
Retrieve the offset in the destination where the upper-left decoded/encoded pixel should be located. (0, 0) by default. |
ImageTypeSpecifier |
getDestinationType()
Retrieve the currently set image-type specifier or null if none has been set. |
int[] |
getSourceBands()
Retrieve the current source band values or null if source band values have not been set. |
Rectangle |
getSourceRegion()
Retrieve the source rectangle from which pixels should be read or null if no source region has been set. |
int |
getSourceXSubsampling()
Retrieve the number of pixel columns to advance before taking a pixel sample. |
int |
getSourceYSubsampling()
Retrieve the number of pixel rows to advance before taking a pixel sample. |
int |
getSubsamplingXOffset()
Retrieve the number of pixel columns to advance before taking any pixel samples. |
int |
getSubsamplingYOffset()
Retrieve the number of pixel rows to advance before taking any pixel samples. |
boolean |
hasController()
Check if a non-null controller is currently available. |
void |
setController(IIOParamController controller)
Sets the controller for this IIOParam. |
void |
setDestinationOffset(Point destinationOffset)
Specify the destination pixel offset. |
void |
setDestinationType(ImageTypeSpecifier destinationType)
Set the destination image type. |
void |
setSourceBands(int[] sourceBands)
Set the indices of the source bands to be used. |
void |
setSourceRegion(Rectangle sourceRegion)
Set the source region from which to read. |
void |
setSourceSubsampling(int sourceXSubsampling,
int sourceYSubsampling,
int subsamplingXOffset,
int subsamplingYOffset)
Set the source sampling intervals and offsets. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected IIOParamController controller
protected IIOParamController defaultController
protected Point destinationOffset
protected ImageTypeSpecifier destinationType
protected int[] sourceBands
protected Rectangle sourceRegion
protected int sourceXSubsampling
protected int sourceYSubsampling
protected int subsamplingXOffset
protected int subsamplingYOffset
Constructor Detail |
---|
protected IIOParam()
Method Detail |
---|
public boolean activateController()
public IIOParamController getController()
public IIOParamController getDefaultController()
public Point getDestinationOffset()
public ImageTypeSpecifier getDestinationType()
public int[] getSourceBands()
public Rectangle getSourceRegion()
public int getSourceXSubsampling()
public int getSourceYSubsampling()
public int getSubsamplingXOffset()
public int getSubsamplingYOffset()
public boolean hasController()
public void setController(IIOParamController controller)
controller
- the controller to set or nullpublic void setDestinationType(ImageTypeSpecifier destinationType)
destinationType
- the sample and colour models of the
destination imagepublic void setDestinationOffset(Point destinationOffset)
destinationOffset
- the offset where pixel writing should
beginpublic void setSourceBands(int[] sourceBands)
sourceBands
- the array of source bands to usepublic void setSourceRegion(Rectangle sourceRegion)
sourceRegion
- the rectangular source region
IllegalArgumentException
- if sourceRegion has width or
height <= 0 or x or y < 0
IllegalStateException
- if the given sourceRegion and
the current sampling settings would produce zero samplespublic void setSourceSubsampling(int sourceXSubsampling, int sourceYSubsampling, int subsamplingXOffset, int subsamplingYOffset)
sourceXSubsampling
- the horizontal sampling intervalsourceYSubsampling
- the vertical sampling intervalsubsamplingXOffset
- the horizontal offset of the initial
samplesubsamplingYOffset
- the vertical offset of the initial
sample
IllegalArgumentException
- if either subsamplingXOffset
or subsamplingYOffset is < 0
IllegalStateException
- if the current source region
combined with the given sub-sampling parameters would produce
zero pixel samples
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |