FileDocCategorySizeDatePackage
IIOParam.javaAPI DocAndroid 1.5 API10089Wed May 06 22:41:54 BST 2009javax.imageio

IIOParam

public abstract class IIOParam extends Object
The IIOParam abstract class is superclass for ImageReadParam and ImageWriteParam classes and provides methods and variables which they share.
since
Android 1.0

Fields Summary
protected Rectangle
sourceRegion
The source region.
protected int
sourceXSubsampling
The source x subsampling.
protected int
sourceYSubsampling
The source y subsampling.
protected int
subsamplingXOffset
The subsampling x offset.
protected int
subsamplingYOffset
The subsampling y offset.
protected int[]
sourceBands
The source bands.
protected ImageTypeSpecifier
destinationType
The destination type.
protected Point
destinationOffset
The destination offset.
protected IIOParamController
defaultController
The default controller.
protected IIOParamController
controller
The controller.
Constructors Summary
protected IIOParam()
Instantiates a new IIOParam.


             
      
    
Methods Summary
public booleanactivateController()
Activates the controller.

return
true, if successful, false otherwise.

        // TODO implement
        throw new UnsupportedOperationException("not implemented yet");
    
public javax.imageio.IIOParamControllergetController()
Gets the current IIOParamController controller for this IIOParam.

return
the current IIOParamController controller for this IIOParam.

        // TODO implement
        throw new UnsupportedOperationException("not implemented yet");
    
public javax.imageio.IIOParamControllergetDefaultController()
Gets the default IIOParamController controller for this IIOParam.

return
the default IIOParamController controller for this IIOParam, or null.

        // TODO implement
        throw new UnsupportedOperationException("not implemented yet");
    
public java.awt.PointgetDestinationOffset()
Gets the offset in the destination image for placing pixels.

return
the offset in the destination image.

        return (Point)destinationOffset.clone();
    
public javax.imageio.ImageTypeSpecifiergetDestinationType()
Gets the type of the destination image as an ImageTypeSpecifier. .

return
the ImageTypeSpecifier.

        // TODO implement
        throw new UnsupportedOperationException("not implemented yet");
    
public int[]getSourceBands()
Gets the array of source bands.

return
the array of source bands.

        // TODO implement
        throw new UnsupportedOperationException("not implemented yet");
    
public java.awt.RectanglegetSourceRegion()
Gets the source region.

return
the source region as Rectangle.

        if (sourceRegion == null) {
            return null;
        }
        // -- clone it to avoid unexpected modifications
        return (Rectangle)sourceRegion.clone();
    
public intgetSourceXSubsampling()
Gets the source X subsampling - the number of source columns to advance for each pixel.

return
the source X subsampling.

        return sourceXSubsampling;
    
public intgetSourceYSubsampling()
Gets the source Y subsampling - the number of source rows to advance for each pixel.

return
the source Y subsampling.

        return sourceYSubsampling;
    
public intgetSubsamplingXOffset()
Gets the horizontal offset of the subsampling grid.

return
the horizontal offset of the subsampling grid.

        return subsamplingXOffset;
    
public intgetSubsamplingYOffset()
Gets the vertical offset of the subsampling grid.

return
the vertical offset of the subsampling grid.

        return subsamplingYOffset;
    
public booleanhasController()
Returns true if IIOParamController is installed for this IIOParam.

return
true, if IIOParamController is installed for this IIOParam, false otherwise.

        // TODO implement
        throw new UnsupportedOperationException("not implemented yet");
    
public voidsetController(javax.imageio.IIOParamController controller)
Sets the IIOParamController to this IIOParam object for providing settings to this IIOParam.

param
controller the new IIOParamController.

        // TODO implement
        throw new UnsupportedOperationException("not implemented yet");
    
public voidsetDestinationOffset(java.awt.Point destinationOffset)
Sets the offset in the destination image where the decoded pixels are placed as a result of reading, or specified an area to be written while writing operation.

param
destinationOffset the destination offset.

        if (destinationOffset == null) {
            throw new IllegalArgumentException("destinationOffset == null!");
        }

        this.destinationOffset = (Point)destinationOffset.clone();
    
public voidsetDestinationType(javax.imageio.ImageTypeSpecifier destinationType)
Sets the specified ImageTypeSpecifier for the destination image.

param
destinationType the ImageTypeSpecifier.

        // TODO implement
        throw new UnsupportedOperationException("not implemented yet");
    
public voidsetSourceBands(int[] sourceBands)
Sets the indices of the source bands.

param
sourceBands the indices of the source bands.

        // TODO implement
        throw new UnsupportedOperationException("not implemented yet");
    
public voidsetSourceRegion(java.awt.Rectangle sourceRegion)
Sets the source region as a Rectangle object.

param
sourceRegion the Rectangle which specifies the source region.

        if (sourceRegion != null) {
            if (sourceRegion.x < 0) {
                throw new IllegalArgumentException("x < 0");
            }
            if (sourceRegion.y < 0) {
                throw new IllegalArgumentException("y < 0");
            }
            if (sourceRegion.width <= 0) {
                throw new IllegalArgumentException("width <= 0");
            }
            if (sourceRegion.height <= 0) {
                throw new IllegalArgumentException("height <= 0");
            }

            if (sourceRegion.width <= subsamplingXOffset) {
                throw new IllegalArgumentException("width <= subsamplingXOffset");
            }

            if (sourceRegion.height <= subsamplingYOffset) {
                throw new IllegalArgumentException("height <= subsamplingXOffset");
            }
            // -- clone it to avoid unexpected modifications
            this.sourceRegion = (Rectangle)sourceRegion.clone();
        } else {
            this.sourceRegion = null;
        }
    
public voidsetSourceSubsampling(int sourceXSubsampling, int sourceYSubsampling, int subsamplingXOffset, int subsamplingYOffset)
Sets the source subsampling. The sourceXSubsampling and sourceYSubsampling parameters specify the number of rows and columns to advance after every source pixel.

param
sourceXSubsampling the source X subsampling.
param
sourceYSubsampling the source Y subsampling.
param
subsamplingXOffset the subsampling X offset.
param
subsamplingYOffset the subsampling Y offset.


        if (sourceXSubsampling <= 0) {
            throw new IllegalArgumentException("sourceXSubsampling <= 0");
        }
        if (sourceYSubsampling <= 0) {
            throw new IllegalArgumentException("sourceYSubsampling <= 0");
        }

        if (subsamplingXOffset <= 0 || subsamplingXOffset >= sourceXSubsampling) {
            throw new IllegalArgumentException("subsamplingXOffset is wrong");
        }

        if (subsamplingYOffset <= 0 || subsamplingYOffset >= sourceYSubsampling) {
            throw new IllegalArgumentException("subsamplingYOffset is wrong");
        }

        // -- does region contain pixels
        if (sourceRegion != null) {
            if (sourceRegion.width <= subsamplingXOffset
                    || sourceRegion.height <= subsamplingYOffset) {
                throw new IllegalArgumentException("there are no pixels in region");
            }
        }

        this.sourceXSubsampling = sourceXSubsampling;
        this.sourceYSubsampling = sourceYSubsampling;
        this.subsamplingXOffset = subsamplingXOffset;
        this.subsamplingYOffset = subsamplingYOffset;