/*
* @(#)IIOParam.java 1.30 05/11/17
*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package javax.imageio;
import java.awt.Point;
import java.awt.Rectangle;
/**
* 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 <code>ImageReadParam</code> and
* <code>ImageWriteParam</code>.
*
* <p> 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.
* <p>
* Decimation subsampling may be specified for both readers
* and writers, using a movable subsampling grid.
* <p>
* Subsets of the source and destination bands may be selected.
*
* @version 0.5
*/
public abstract class IIOParam {
/**
* The source region, on <code>null</code> if none is set.
*/
protected Rectangle sourceRegion = null;
/**
* The decimation subsampling to be applied in the horizontal
* direction. By default, the value is <code>1</code>.
* The value must not be negative or 0.
*/
protected int sourceXSubsampling = 1;
/**
* The decimation subsampling to be applied in the vertical
* direction. By default, the value is <code>1</code>.
* The value must not be negative or 0.
*/
protected int sourceYSubsampling = 1;
/**
* 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.
*/
protected int subsamplingXOffset = 0;
/**
* 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.
*/
protected int subsamplingYOffset = 0;
/**
* An array of <code>int</code>s indicating which source bands
* will be used, or <code>null</code>. If <code>null</code>, the
* set of source bands to be used is as described in the comment
* for the <code>setSourceBands</code> method. No value should
* be allowed to be negative.
*/
protected int[] sourceBands = null;
/**
* An <code>ImageTypeSpecifier</code> 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
* <code>null</code>. By default, the value is <code>null</code>.
*/
protected ImageTypeSpecifier destinationType = null;
/**
* The offset in the destination where the upper-left decoded
* pixel should be placed. By default, the value is (0, 0).
*/
protected Point destinationOffset = new Point(0, 0);
/**
* The default <code>IIOParamController</code> that will be
* used to provide settings for this <code>IIOParam</code>
* object when the <code>activateController</code> 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 IIOParamController
=1= |