/*
* @(#)ImageWriteParam.java 1.64 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.color.ICC_Profile;
import java.awt.image.LookupTable;
import java.awt.image.RenderedImage;
import java.awt.Dimension;
import java.util.Locale;
/**
* A class describing how a stream is to be encoded. Instances of
* this class or its subclasses are used to supply prescriptive
* "how-to" information to instances of <code>ImageWriter</code>.
*
* <p> A plug-in for a specific image format may define a subclass of
* this class, and return objects of that class from the
* <code>getDefaultWriteParam</code> method of its
* <code>ImageWriter</code> implementation. For example, the built-in
* JPEG writer plug-in will return instances of
* <code>javax.imageio.plugins.jpeg.JPEGImageWriteParam</code>.
*
* <p> The region of the image to be written is determined by first
* intersecting the actual bounds of the image with the rectangle
* specified by <code>IIOParam.setSourceRegion</code>, if any. If the
* resulting rectangle has a width or height of zero, the writer will
* throw an <code>IIOException</code>. If the intersection is
* non-empty, writing will commence with the first subsampled pixel
* and include additional pixels within the intersected bounds
* according to the horizontal and vertical subsampling factors
* specified by {@link IIOParam#setSourceSubsampling
* <code>IIOParam.setSourceSubsampling</code>}.
*
* <p> Individual features such as tiling, progressive encoding, and
* compression may be set in one of four modes.
* <code>MODE_DISABLED</code> disables the features;
* <code>MODE_DEFAULT</code> enables the feature with
* writer-controlled parameter values; <code>MODE_EXPLICIT</code>
* enables the feature and allows the use of a <code>set</code> method
* to provide additional parameters; and
* <code>MODE_COPY_FROM_METADATA</code> copies relevant parameter
* values from the stream and image metadata objects passed to the
* writer. The default for all features is
* <code>MODE_COPY_FROM_METADATA</code>. Non-standard features
* supplied in subclasses are encouraged, but not required to use a
* similar scheme.
*
* <p> Plug-in writers may extend the functionality of
* <code>ImageWriteParam</code> by providing a subclass that implements
* additional, plug-in specific interfaces. It is up to the plug-in
* to document what interfaces are available and how they are to be
* used. Writers will silently ignore any extended features of an
* <code>ImageWriteParam</code> subclass of which they are not aware.
* Also, they may ignore any optional features that they normally
* disable when creating their own <code>ImageWriteParam</code>
* instances via <code>getDefaultWriteParam</code>.
*
* <p> Note that unless a query method exists for a capability, it must
* be supported by all <code>ImageWriter</code> implementations
* (<i>e.g.</i> progressive encoding is optional, but subsampling must be
* supported).
*
* @version 0.5
*
* @see ImageReadParam
*/
public class ImageWriteParam extends IIOParam {
/**
* A constant value that may be passed into methods such as
* <code>setTilingMode</code>, <code>setProgressiveMode</code>,
* and <code>setCompressionMode</code> to disable a feature for
* future writes. That is, when this mode is set the stream will
* <b>not</b> be tiled, progressive, or compressed, and the
* relevant accessor methods will throw an
* <code>IllegalStateException</code>.
*
* @see #MODE_EXPLICIT
* @see #MODE_COPY_FROM_METADATA
* @see #MODE_DEFAULT
* @see #setProgressiveMode
* @see #getProgressiveMode
* @see #setTilingMode
* @see #getTilingMode
* @see #setCompressionMode
* @see #getCompressionMode
*/
public static final int MODE_DISABLED = 0;
/**
* A constant value that may be passed into methods such as
* <code>setTilingMode</code>,
* <code>setProgressiveMode</code>, and
* <code>setCompressionMode</code> to enable that feature for
* future writes. That is, when this mode is enabled the stream
=1= |