javax.imageio.plugins.jpeg

Class JPEGImageReadParam


public class JPEGImageReadParam
extends ImageReadParam

The JPEGImageReadParam class is only used to set JPEG decoding tables for streams that do not provide their own tables. If a stream does not provide tables and a custom JPEGImageReadParam is not provided, then the standard JPEG tables are used from the JPEGQTable and JPEGHuffmanTable classes. If a stream does provide decoding tables then JPEGImageReadParam will be ignored. JPEGImageReadParam cannot be used to retrieve the tables from a stream. Instead, use IIOMetadata for this purpose. A JPEGImageReadParam instance is retrieved from the built-in JPEG ImageReader using the getDefaultImageReadParam method.

Field Summary

Fields inherited from class javax.imageio.ImageReadParam

canSetSourceRenderSize, destination, destinationBands, minProgressivePass, numProgressivePasses, sourceRenderSize

Fields inherited from class javax.imageio.IIOParam

controller, defaultController, destinationOffset, destinationType, sourceBands, sourceRegion, sourceXSubsampling, sourceYSubsampling, subsamplingXOffset, subsamplingYOffset

Constructor Summary

JPEGImageReadParam()
Construct a JPEGImageReadParam.

Method Summary

boolean
areTablesSet()
Check if the decoding tables are set.
JPEGHuffmanTable[]
getACHuffmanTables()
Retrieve the AC Huffman tables.
JPEGHuffmanTable[]
getDCHuffmanTables()
Retrieve the DC Huffman tables.
JPEGQTable[]
getQTables()
Retrieve the quantization tables.
void
setDecodeTables(JPEGQTable[] qTables, JPEGHuffmanTable[] DCHuffmanTables, JPEGHuffmanTable[] ACHuffmanTables)
Set the quantization and Huffman tables that will be used to decode the stream.
void
unsetDecodeTables()
Clear the quantization and Huffman decoding tables.

Methods inherited from class javax.imageio.ImageReadParam

canSetSourceRenderSize, getDestination, getDestinationBands, getSourceMaxProgressivePass, getSourceMinProgressivePass, getSourceNumProgressivePasses, getSourceRenderSize, setDestination, setDestinationBands, setSourceProgressivePasses, setSourceRenderSize

Methods inherited from class javax.imageio.IIOParam

activateController, getController, getDefaultController, getDestinationOffset, getDestinationType, getSourceBands, getSourceRegion, getSourceXSubsampling, getSourceYSubsampling, getSubsamplingXOffset, getSubsamplingYOffset, hasController, setController, setDestinationOffset, setDestinationType, setSourceBands, setSourceRegion, setSourceSubsampling

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

JPEGImageReadParam

public JPEGImageReadParam()
Construct a JPEGImageReadParam.

Method Details

areTablesSet

public boolean areTablesSet()
Check if the decoding tables are set.
Returns:
true if the decoding tables are set, false otherwise

getACHuffmanTables

public JPEGHuffmanTable[] getACHuffmanTables()
Retrieve the AC Huffman tables.
Returns:
an array of JPEG AC Huffman tables

getDCHuffmanTables

public JPEGHuffmanTable[] getDCHuffmanTables()
Retrieve the DC Huffman tables.
Returns:
an array of JPEG DC Huffman tables

getQTables

public JPEGQTable[] getQTables()
Retrieve the quantization tables.

setDecodeTables

public void setDecodeTables(JPEGQTable[] qTables,
                            JPEGHuffmanTable[] DCHuffmanTables,
                            JPEGHuffmanTable[] ACHuffmanTables)
Set the quantization and Huffman tables that will be used to decode the stream. Copies are created of the array arguments. The number of Huffman tables must be the same in both Huffman table arrays. No argument may be null and no array may be longer than four elements.
Parameters:
qTables - JPEG quantization tables
DCHuffmanTables - JPEG DC Huffman tables
ACHuffmanTables - JPEG AC Huffman tables
Throws:
IllegalArgumentException - if any argument is null, if any of the arrays are longer than four elements, or if the Huffman table arrays do not have the same number of elements

unsetDecodeTables

public void unsetDecodeTables()
Clear the quantization and Huffman decoding tables.

JPEGImageReadParam.java -- Copyright (C) 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.