Java Doc for JPEGImageWriteParam.java in  » 6.0-JDK-Core » image » javax » imageio » plugins » jpeg » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » image » javax.imageio.plugins.jpeg 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


javax.imageio.ImageWriteParam
   javax.imageio.plugins.jpeg.JPEGImageWriteParam

JPEGImageWriteParam
public class JPEGImageWriteParam extends ImageWriteParam (Code)
This class adds the ability to set JPEG quantization and Huffman tables when using the built-in JPEG writer plug-in, and to request that optimized Huffman tables be computed for an image. An instance of this class will be returned from the getDefaultImageWriteParam methods of the built-in JPEG ImageWriter.

The principal purpose of these additions is to allow the specification of tables to use in encoding abbreviated streams. The built-in JPEG writer will also accept an ordinary ImageWriteParam, in which case the writer will construct the necessary tables internally.

In either case, the quality setting in an ImageWriteParam has the same meaning as for the underlying library: 1.00 means a quantization table of all 1's, 0.75 means the "standard", visually lossless quantization table, and 0.00 means aquantization table of all 255's.

While tables for abbreviated streams are often specified by first writing an abbreviated stream containing only the tables, in some applications the tables are fixed ahead of time. This class allows the tables to be specified directly from client code.

Normally, the tables are specified in the IIOMetadata objects passed in to the writer, and any tables included in these objects are written to the stream. If no tables are specified in the metadata, then an abbreviated stream is written. If no tables are included in the metadata and no tables are specified in a JPEGImageWriteParam, then an abbreviated stream is encoded using the "standard" visually lossless tables. This class is necessary for specifying tables when an abbreviated stream must be written without writing any tables to a stream first. In order to use this class, the metadata object passed into the writer must contain no tables, and no stream metadata must be provided. See JPEGQTable JPEGQTable and JPEGHuffmanTable JPEGHuffmanTable for more information on the default tables.

The default JPEGImageWriteParam returned by the getDefaultWriteParam method of the writer contains no tables. Default tables are included in the default IIOMetadata objects returned by the writer.

If the metadata does contain tables, the tables given in a JPEGImageWriteParam are ignored. Furthermore, once a set of tables has been written, only tables in the metadata can override them for subsequent writes, whether to the same stream or a different one. In order to specify new tables using this class, the javax.imageio.ImageWriter.reset reset method of the writer must be called.

For more information about the operation of the built-in JPEG plug-ins, see the JPEG metadata format specification and usage notes.
version:
   0.5




Constructor Summary
public  JPEGImageWriteParam(Locale locale)
     Constructs a JPEGImageWriteParam.

Method Summary
public  booleanareTablesSet()
     Returns true if tables are currently set.
public  JPEGHuffmanTable[]getACHuffmanTables()
     Returns a copy of the array of AC Huffman tables set on the most recent call to setEncodeTables, or null if tables are not currently set.
public  String[]getCompressionQualityDescriptions()
    
public  float[]getCompressionQualityValues()
    
public  JPEGHuffmanTable[]getDCHuffmanTables()
     Returns a copy of the array of DC Huffman tables set on the most recent call to setEncodeTables, or null if tables are not currently set.
public  booleangetOptimizeHuffmanTables()
     Returns the value passed into the most recent call to setOptimizeHuffmanTables, or false if setOptimizeHuffmanTables has never been called.
public  JPEGQTable[]getQTables()
     Returns a copy of the array of quantization tables set on the most recent call to setEncodeTables, or null if tables are not currently set.
public  booleanisCompressionLossless()
     Returns false since the JPEG plug-in only supports lossy compression.
public  voidsetEncodeTables(JPEGQTable[] qTables, JPEGHuffmanTable[] DCHuffmanTables, JPEGHuffmanTable[] ACHuffmanTables)
     Sets the quantization and Huffman tables to use in encoding abbreviated streams.
public  voidsetOptimizeHuffmanTables(boolean optimize)
     Tells the writer to generate optimized Huffman tables for the image as part of the writing process.
public  voidunsetCompression()
     Removes any previous compression quality setting.
public  voidunsetEncodeTables()
     Removes any quantization and Huffman tables that are currently set.


Constructor Detail
JPEGImageWriteParam
public JPEGImageWriteParam(Locale locale)(Code)
Constructs a JPEGImageWriteParam. Tiling is not supported. Progressive encoding is supported. The default progressive mode is MODE_DISABLED. A single form of compression, named "JPEG", is supported. The default compression quality is 0.75.
Parameters:
  locale - a Locale to be used by thesuperclass to localize compression type names and qualitydescriptions, or null.




Method Detail
areTablesSet
public boolean areTablesSet()(Code)
Returns true if tables are currently set. true if tables are present.



getACHuffmanTables
public JPEGHuffmanTable[] getACHuffmanTables()(Code)
Returns a copy of the array of AC Huffman tables set on the most recent call to setEncodeTables, or null if tables are not currently set. an array of JPEGHuffmanTable objects, ornull.
See Also:   JPEGImageWriteParam.setEncodeTables



getCompressionQualityDescriptions
public String[] getCompressionQualityDescriptions()(Code)



getCompressionQualityValues
public float[] getCompressionQualityValues()(Code)



getDCHuffmanTables
public JPEGHuffmanTable[] getDCHuffmanTables()(Code)
Returns a copy of the array of DC Huffman tables set on the most recent call to setEncodeTables, or null if tables are not currently set. an array of JPEGHuffmanTable objects, ornull.
See Also:   JPEGImageWriteParam.setEncodeTables



getOptimizeHuffmanTables
public boolean getOptimizeHuffmanTables()(Code)
Returns the value passed into the most recent call to setOptimizeHuffmanTables, or false if setOptimizeHuffmanTables has never been called. true if the writer will generate optimizedHuffman tables.
See Also:   JPEGImageWriteParam.setOptimizeHuffmanTables



getQTables
public JPEGQTable[] getQTables()(Code)
Returns a copy of the array of quantization tables set on the most recent call to setEncodeTables, or null if tables are not currently set. an array of JPEGQTable objects, ornull.
See Also:   JPEGImageWriteParam.setEncodeTables



isCompressionLossless
public boolean isCompressionLossless()(Code)
Returns false since the JPEG plug-in only supports lossy compression. false.
exception:
  IllegalStateException - if the compression mode is notMODE_EXPLICIT.



setEncodeTables
public void setEncodeTables(JPEGQTable[] qTables, JPEGHuffmanTable[] DCHuffmanTables, JPEGHuffmanTable[] ACHuffmanTables)(Code)
Sets the quantization and Huffman tables to use in encoding abbreviated streams. There may be a maximum of 4 tables of each type. These tables are ignored if tables are specified in the metadata. All arguments must be non-null. The two arrays of Huffman tables must have the same number of elements. The table specifiers in the frame and scan headers in the metadata are assumed to be equivalent to indices into these arrays. The argument arrays are copied by this method.
Parameters:
  qTables - An array of quantization table objects.
Parameters:
  DCHuffmanTables - An array of Huffman table objects.
Parameters:
  ACHuffmanTables - An array of Huffman table objects.
exception:
  IllegalArgumentException - if any of the argumentsis null or has more than 4 elements, or if thenumbers of DC and AC tables differ.
See Also:   JPEGImageWriteParam.unsetEncodeTables



setOptimizeHuffmanTables
public void setOptimizeHuffmanTables(boolean optimize)(Code)
Tells the writer to generate optimized Huffman tables for the image as part of the writing process. The default is false. If this flag is set to true, it overrides any tables specified in the metadata. Note that this means that any image written with this flag set to true will always contain Huffman tables.
Parameters:
  optimize - A boolean indicating whether to generateoptimized Huffman tables when writing.
See Also:   JPEGImageWriteParam.getOptimizeHuffmanTables



unsetCompression
public void unsetCompression()(Code)
Removes any previous compression quality setting.

The default implementation resets the compression quality to 0.75F.
exception:
  IllegalStateException - if the compression mode is notMODE_EXPLICIT.




unsetEncodeTables
public void unsetEncodeTables()(Code)
Removes any quantization and Huffman tables that are currently set.
See Also:   JPEGImageWriteParam.setEncodeTables



Fields inherited from javax.imageio.ImageWriteParam
final public static int MODE_COPY_FROM_METADATA(Code)(Java Doc)
final public static int MODE_DEFAULT(Code)(Java Doc)
final public static int MODE_DISABLED(Code)(Java Doc)
final public static int MODE_EXPLICIT(Code)(Java Doc)
protected boolean canOffsetTiles(Code)(Java Doc)
protected boolean canWriteCompressed(Code)(Java Doc)
protected boolean canWriteProgressive(Code)(Java Doc)
protected boolean canWriteTiles(Code)(Java Doc)
protected int compressionMode(Code)(Java Doc)
protected float compressionQuality(Code)(Java Doc)
protected String compressionType(Code)(Java Doc)
protected String[] compressionTypes(Code)(Java Doc)
protected Locale locale(Code)(Java Doc)
protected Dimension[] preferredTileSizes(Code)(Java Doc)
protected int progressiveMode(Code)(Java Doc)
protected int tileGridXOffset(Code)(Java Doc)
protected int tileGridYOffset(Code)(Java Doc)
protected int tileHeight(Code)(Java Doc)
protected int tileWidth(Code)(Java Doc)
protected int tilingMode(Code)(Java Doc)
protected boolean tilingSet(Code)(Java Doc)

Methods inherited from javax.imageio.ImageWriteParam
public boolean canOffsetTiles()(Code)(Java Doc)
public boolean canWriteCompressed()(Code)(Java Doc)
public boolean canWriteProgressive()(Code)(Java Doc)
public boolean canWriteTiles()(Code)(Java Doc)
public float getBitRate(float quality)(Code)(Java Doc)
public int getCompressionMode()(Code)(Java Doc)
public float getCompressionQuality()(Code)(Java Doc)
public String[] getCompressionQualityDescriptions()(Code)(Java Doc)
public float[] getCompressionQualityValues()(Code)(Java Doc)
public String getCompressionType()(Code)(Java Doc)
public String[] getCompressionTypes()(Code)(Java Doc)
public Locale getLocale()(Code)(Java Doc)
public String getLocalizedCompressionTypeName()(Code)(Java Doc)
public Dimension[] getPreferredTileSizes()(Code)(Java Doc)
public int getProgressiveMode()(Code)(Java Doc)
public int getTileGridXOffset()(Code)(Java Doc)
public int getTileGridYOffset()(Code)(Java Doc)
public int getTileHeight()(Code)(Java Doc)
public int getTileWidth()(Code)(Java Doc)
public int getTilingMode()(Code)(Java Doc)
public boolean isCompressionLossless()(Code)(Java Doc)
public void setCompressionMode(int mode)(Code)(Java Doc)
public void setCompressionQuality(float quality)(Code)(Java Doc)
public void setCompressionType(String compressionType)(Code)(Java Doc)
public void setProgressiveMode(int mode)(Code)(Java Doc)
public void setTiling(int tileWidth, int tileHeight, int tileGridXOffset, int tileGridYOffset)(Code)(Java Doc)
public void setTilingMode(int mode)(Code)(Java Doc)
public void unsetCompression()(Code)(Java Doc)
public void unsetTiling()(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.