Java Doc for JPEGEncodeParam.java in  » 6.0-JDK-Modules » Java-Advanced-Imaging » com » sun » media » jai » codec » Java Source Code / Java DocumentationJava Source Code and Java Documentation

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 geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » Java Advanced Imaging » com.sun.media.jai.codec 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.media.jai.codec.JPEGEncodeParam

JPEGEncodeParam
public class JPEGEncodeParam implements ImageEncodeParam(Code)
A class which encapsulates the most common functionality required for the parameters to a Jpeg encode operation. It does not include all of the parameters of the com.sun.image.codec.jpeg classes. Users needing that additional functionality should use those classes directly, bearing in mind that they are part of an uncommitted non-core interface that may be modified or removed in the future. This class makes very simple assumptions about the image colorspaces. Images with a single band are assumed to be grayscale. Images with three bands are assumed to be RGB and are encoded to YCbCr.

This class is not a committed part of the JAI API. It may be removed or changed in future releases of JAI.




Constructor Summary
public  JPEGEncodeParam()
     Constructs a JAI JPEGEncodeParam object with default settings.

Method Summary
public  Objectclone()
     Returns a copy of this JPEGEncodeParam object.
public  intgetHorizontalSubsampling(int component)
     Get the horizontal subsampling factor for a band.
Parameters:
  component - The band of the image for which to retrieve subsampling.
public  int[]getQTable(int component)
     Retrieve the contents of the quantization table used for a component.
Parameters:
  component - The band to which this table applies.
public  intgetQTableSlot(int component)
     Retrieve the quantization table slot used for a component.
Parameters:
  component - The band to which this table slot applies.
public  floatgetQuality()
     Retrieve the quality setting for this encoding.
public  intgetRestartInterval()
     Gets the restart interval in Minimum Coded Units (MCUs).
public  intgetVerticalSubsampling(int component)
     Get the vertical subsampling factor for a band.
Parameters:
  component - The band of the image for which to retrieve subsampling.
public  booleangetWriteImageOnly()
     Retrieve the setting of the writeImageOnly flag.
public  booleangetWriteJFIFHeader()
     Retrieve the setting of the writeJFIF flag.
public  booleangetWriteTablesOnly()
     Retrieve the setting of the writeTablesOnly flag.
public  booleanisQTableSet(int component)
     Tests if a Quantization table has been set.
public  booleanisQualitySet()
     Tests if the quality parameter has been set in this JPEGEncodeParam.
public  voidsetChromaQTable(int[] qTable)
     Sets the quantization table to be used for chrominance data. This is a convenience method which explicitly sets the contents of quantization table 1.
public  voidsetHorizontalSubsampling(int component, int subsample)
     Sets the horizontal subsampling to be applied to an image band.
public  voidsetLumaQTable(int[] qTable)
     Sets the quantization table to be used for luminance data. This is a convenience method which explicitly sets the contents of quantization table 0.
public  voidsetQTable(int component, int tableSlot, int[] qTable)
     Sets a quantization table to be used for a component.
public  voidsetQuality(float quality)
     This creates new quantization tables that replace the currently installed quantization tables.
public  voidsetRestartInterval(int restartInterval)
     Sets the restart interval in Minimum Coded Units (MCUs).
public  voidsetVerticalSubsampling(int component, int subsample)
     Sets the vertical subsampling to be applied to an image band.
public  voidsetWriteImageOnly(boolean imageOnly)
     Controls whether the encoder writes only the compressed image data to the output stream. This is considered an abbreviated JPEG stream.
public  voidsetWriteJFIFHeader(boolean writeJFIF)
     Controls whether the encoder writes a JFIF header using the APP0 marker.
public  voidsetWriteTablesOnly(boolean tablesOnly)
     Instructs the encoder to write only the table data to the output stream. This is considered an abbreviated JPEG stream.


Constructor Detail
JPEGEncodeParam
public JPEGEncodeParam()(Code)
Constructs a JAI JPEGEncodeParam object with default settings.




Method Detail
clone
public Object clone()(Code)
Returns a copy of this JPEGEncodeParam object.



getHorizontalSubsampling
public int getHorizontalSubsampling(int component)(Code)
Get the horizontal subsampling factor for a band.
Parameters:
  component - The band of the image for which to retrieve subsampling. The horizontal subsampling factor to be applied to this band



getQTable
public int[] getQTable(int component)(Code)
Retrieve the contents of the quantization table used for a component.
Parameters:
  component - The band to which this table applies. The contents of the quantization table as a reference.
throws:
  IllegalStateException - if table has not been previously set for this component.



getQTableSlot
public int getQTableSlot(int component)(Code)
Retrieve the quantization table slot used for a component.
Parameters:
  component - The band to which this table slot applies. The table slot used for this band.
throws:
  IllegalStateException - if table has not been previously set for this component.



getQuality
public float getQuality()(Code)
Retrieve the quality setting for this encoding. This is a number between 0.0 and 1.0. The specified quality setting (0.75 if not set).



getRestartInterval
public int getRestartInterval()(Code)
Gets the restart interval in Minimum Coded Units (MCUs). The restart interval in MCUs (0 if not set).



getVerticalSubsampling
public int getVerticalSubsampling(int component)(Code)
Get the vertical subsampling factor for a band.
Parameters:
  component - The band of the image for which to retrieve subsampling. The vertical subsampling factor to be applied to this band



getWriteImageOnly
public boolean getWriteImageOnly()(Code)
Retrieve the setting of the writeImageOnly flag. The setting of the writeImageOnly flag (false if not set).



getWriteJFIFHeader
public boolean getWriteJFIFHeader()(Code)
Retrieve the setting of the writeJFIF flag. The setting of the writeJFIF flag (true if not set).



getWriteTablesOnly
public boolean getWriteTablesOnly()(Code)
Retrieve the setting of the writeTablesOnly flag. The setting of the writeTablesOnly flag (false if not set).



isQTableSet
public boolean isQTableSet(int component)(Code)
Tests if a Quantization table has been set. Returns true is the specified quantization table has been set.



isQualitySet
public boolean isQualitySet()(Code)
Tests if the quality parameter has been set in this JPEGEncodeParam. True/false flag indicating if quality has been set.



setChromaQTable
public void setChromaQTable(int[] qTable)(Code)
Sets the quantization table to be used for chrominance data. This is a convenience method which explicitly sets the contents of quantization table 1. The length of the table must be 64. This method assumes that all chroma components will use the same table. This disables any quality setting.
Parameters:
  qTable - Quantization table values in "zig-zag" order.



setHorizontalSubsampling
public void setHorizontalSubsampling(int component, int subsample)(Code)
Sets the horizontal subsampling to be applied to an image band. Defaults to 1 for grayscale and (1,2,2) for RGB.
Parameters:
  component - The band for which to set horizontal subsampling.
Parameters:
  subsample - The horizontal subsampling factor.



setLumaQTable
public void setLumaQTable(int[] qTable)(Code)
Sets the quantization table to be used for luminance data. This is a convenience method which explicitly sets the contents of quantization table 0. The length of the table must be 64. This disables any quality setting.
Parameters:
  qTable - Quantization table values in "zig-zag" order.



setQTable
public void setQTable(int component, int tableSlot, int[] qTable)(Code)
Sets a quantization table to be used for a component. This method allows up to four independent tables to be specified. This disables any quality setting.
Parameters:
  component - The band to which this table applies.
Parameters:
  tableSlot - The table number that this table is assigned to (0 to 3).
Parameters:
  qTable - Quantization table values in "zig-zag" order.



setQuality
public void setQuality(float quality)(Code)
This creates new quantization tables that replace the currently installed quantization tables. The created quantization table varies from very high compression, very low quality, (0.0) to low compression, very high quality (1.0) based on the quality parameter.

At a quality level of 1.0 the table will be all 1's which will lead to no loss of data due to quantization (however chrominace subsampling, if used, and roundoff error in the DCT will still degrade the image some what).

The default setting is 0.75 which provides high quality while insuring a good compression ratio.

Some guidelines: 0.75 high quality
 0.5  medium quality
 0.25 low quality
 

Parameters:
  quality - 0.0-1.0 setting of desired quality level.



setRestartInterval
public void setRestartInterval(int restartInterval)(Code)
Sets the restart interval in Minimum Coded Units (MCUs). This can be useful in some environments to limit the effect of bitstream errors to a single restart interval. The default is zero (no restart interval markers).
Parameters:
  restartInterval - Number of MCUs between restart markers.



setVerticalSubsampling
public void setVerticalSubsampling(int component, int subsample)(Code)
Sets the vertical subsampling to be applied to an image band. Defaults to 1 for grayscale and (1,2,2) for RGB.
Parameters:
  component - The band for which to set vertical subsampling.
Parameters:
  subsample - The vertical subsampling factor.



setWriteImageOnly
public void setWriteImageOnly(boolean imageOnly)(Code)
Controls whether the encoder writes only the compressed image data to the output stream. This is considered an abbreviated JPEG stream. Defaults to false -- normally both tables and compressed image data are written.
Parameters:
  imageOnly - If true, only the compressed image will be written.



setWriteJFIFHeader
public void setWriteJFIFHeader(boolean writeJFIF)(Code)
Controls whether the encoder writes a JFIF header using the APP0 marker. By default an APP0 marker is written to create a JFIF file.
Parameters:
  writeJFIF - If true, writes a JFIF header.



setWriteTablesOnly
public void setWriteTablesOnly(boolean tablesOnly)(Code)
Instructs the encoder to write only the table data to the output stream. This is considered an abbreviated JPEG stream. Defaults to false -- normally both tables and encoded image data are written.
Parameters:
  tablesOnly - If true, only the tables will be written.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(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.