Java Doc for PNGDecodeParam.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.PNGDecodeParam

PNGDecodeParam
public class PNGDecodeParam implements ImageDecodeParam(Code)
An instance of ImageDecodeParam for decoding images in the PNG format. PNGDecodeParam allows several aspects of the decoding process for PNG images to be controlled. By default, decoding produces output images with the following properties:

Images with a bit depth of 8 or less use a DataBufferByte to hold the pixel data. 16-bit images use a DataBufferUShort.

Palette color images and non-transparent grayscale images with bit depths of 1, 2, or 4 will have a MultiPixelPackedSampleModel and an IndexColorModel. For palette color images, the ColorModel palette contains the red, green, blue, and optionally alpha palette information. For grayscale images, the palette is used to expand the pixel data to cover the range 0-255. The pixels are stored packed 8, 4, or 2 to the byte.

All other images are stored using a PixelInterleavedSampleModel with each sample of a pixel occupying its own byte or short within the DataBuffer. A ComponentColorModel is used which simply extracts the red, green, blue, gray, and/or alpha information from separate DataBuffer entries.

Five aspects of this process may be altered by means of methods in this class.

setSuppressAlpha() prevents an alpha channel from appearing in the output.

setExpandPalette() turns palette-color images into 3-or 4-channel full-color images.

setOutput8BitGray() causes 1, 2, or 4 bit grayscale images to be output in 8-bit form, using a ComponentSampleModel and ComponentColorModel.

setDecodingExponent() causes the output image to be gamma-corrected using a supplied output gamma value.

setExpandGrayAlpha() causes 2-channel gray/alpha (GA) images to be output as full-color (GGGA) images, which may simplify further processing and display.

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  PNGDecodeParam()
     Constructs a default instance of PNGDecodeParam.

Method Summary
public  floatgetDisplayExponent()
     Returns the current value of the display exponent parameter.
public  PNGEncodeParamgetEncodeParam()
     If getGenerateEncodeParam() is true, this method may be called after decoding has completed, and will return an instance of PNGEncodeParam containing information about the contents of the PNG file just decoded.
public  booleangetExpandGrayAlpha()
     Returns the current setting of the gray/alpha expansion.
public  booleangetExpandPalette()
     Returns true if palette-color images will be expanded to produce full-color output.
public  booleangetGenerateEncodeParam()
     Returns true if an instance of PNGEncodeParam will be available after an image has been decoded via the getEncodeParam method.
public  booleangetOutput8BitGray()
     Returns the current value of the 8-bit gray output parameter.
public  booleangetPerformGammaCorrection()
     Returns true if gamma correction is to be performed on the image data.
public  booleangetSuppressAlpha()
     Returns true if alpha (transparency) will be prevented from appearing in the output.
public  floatgetUserExponent()
     Returns the current value of the user exponent parameter.
public  voidsetDisplayExponent(float displayExponent)
     Sets the display exponent to a given value.
public  voidsetEncodeParam(PNGEncodeParam encodeParam)
     Sets the current encoder param instance.
public  voidsetExpandGrayAlpha(boolean expandGrayAlpha)
     If set, images containing one channel of gray and one channel of alpha (GA) will be output in a 4-channel format (GGGA).
public  voidsetExpandPalette(boolean expandPalette)
     If set, palette color images (PNG color type 3) will be decoded into full-color (RGB) output images.
public  voidsetGenerateEncodeParam(boolean generateEncodeParam)
     If set, an instance of PNGEncodeParam will be available after an image has been decoded via the getEncodeParam method that encapsulates information about the contents of the PNG file.
public  voidsetOutput8BitGray(boolean output8BitGray)
     If set, grayscale images with a bit depth less than 8 (1, 2, or 4) will be output in 8 bit form.
public  voidsetPerformGammaCorrection(boolean performGammaCorrection)
     Turns gamma corection of the image data on or off.
public  voidsetSuppressAlpha(boolean suppressAlpha)
     If set, no alpha (transparency) channel will appear in the output image.
public  voidsetUserExponent(float userExponent)
     Sets the user exponent to a given value.


Constructor Detail
PNGDecodeParam
public PNGDecodeParam()(Code)
Constructs a default instance of PNGDecodeParam.




Method Detail
getDisplayExponent
public float getDisplayExponent()(Code)
Returns the current value of the display exponent parameter. By default, the display exponent is equal to 2.2F.



getEncodeParam
public PNGEncodeParam getEncodeParam()(Code)
If getGenerateEncodeParam() is true, this method may be called after decoding has completed, and will return an instance of PNGEncodeParam containing information about the contents of the PNG file just decoded.



getExpandGrayAlpha
public boolean getExpandGrayAlpha()(Code)
Returns the current setting of the gray/alpha expansion.



getExpandPalette
public boolean getExpandPalette()(Code)
Returns true if palette-color images will be expanded to produce full-color output.



getGenerateEncodeParam
public boolean getGenerateEncodeParam()(Code)
Returns true if an instance of PNGEncodeParam will be available after an image has been decoded via the getEncodeParam method.



getOutput8BitGray
public boolean getOutput8BitGray()(Code)
Returns the current value of the 8-bit gray output parameter.



getPerformGammaCorrection
public boolean getPerformGammaCorrection()(Code)
Returns true if gamma correction is to be performed on the image data. The default is false.

If gamma correction is to be performed, the getUserExponent() and getDisplayExponent() methods are used in addition to the gamma value stored within the file (or the default value of 1/2.2 used if no value is found) to produce a single exponent using the formula:

 decoding_exponent = user_exponent/(gamma_from_file * display_exponent)
 



getSuppressAlpha
public boolean getSuppressAlpha()(Code)
Returns true if alpha (transparency) will be prevented from appearing in the output.



getUserExponent
public float getUserExponent()(Code)
Returns the current value of the user exponent parameter. By default, the user exponent is equal to 1.0F.



setDisplayExponent
public void setDisplayExponent(float displayExponent)(Code)
Sets the display exponent to a given value. The exponent must be positive. If not, an IllegalArgumentException will be thrown.

The output image pixels will be placed through a transformation of the form:

 sample = integer_sample / (2^bitdepth - 1.0)
 decoding_exponent = user_exponent/(gamma_from_file * display_exponent)
 output = sample ^ decoding_exponent
 
where gamma_from_file is the gamma of the file data, as determined by the gAMA, sRGB, and/or iCCP chunks, and user_exponent is an additional user-supplied parameter.

Input files which do not specify any gamma are assumed to have a gamma of 1/2.2; such images should be decoding using the default display exponent of 2.2.

If an image is to be processed further before being displayed, it may be preferable to set the display exponent to 1.0 in order to produce a linear output image.

This parameter affects the decoding of all image types.
throws:
  IllegalArgumentException - if userExponent is negative.




setEncodeParam
public void setEncodeParam(PNGEncodeParam encodeParam)(Code)
Sets the current encoder param instance. This method is intended to be called by the PNG decoder and will overwrite the current instance returned by getEncodeParam.



setExpandGrayAlpha
public void setExpandGrayAlpha(boolean expandGrayAlpha)(Code)
If set, images containing one channel of gray and one channel of alpha (GA) will be output in a 4-channel format (GGGA). This produces output that may be simpler to process and display.

This setting affects both images of color type 4 (explicit alpha) and images of color type 0 (grayscale) that contain transparency information.

By default, no expansion is performed.




setExpandPalette
public void setExpandPalette(boolean expandPalette)(Code)
If set, palette color images (PNG color type 3) will be decoded into full-color (RGB) output images. The output image may have 3 or 4 channels, depending on the presence of transparency information.

The default is to output palette images using a single channel. The palette information is used to construct the output image's ColorModel.




setGenerateEncodeParam
public void setGenerateEncodeParam(boolean generateEncodeParam)(Code)
If set, an instance of PNGEncodeParam will be available after an image has been decoded via the getEncodeParam method that encapsulates information about the contents of the PNG file. If not set, this information will not be recorded and getEncodeParam() will return null.



setOutput8BitGray
public void setOutput8BitGray(boolean output8BitGray)(Code)
If set, grayscale images with a bit depth less than 8 (1, 2, or 4) will be output in 8 bit form. The output values will occupy the full 8-bit range. For example, gray values 0, 1, 2, and 3 of a 2-bit image will be output as 0, 85, 170, and 255.

The decoding of non-grayscale images and grayscale images with a bit depth of 8 or 16 are unaffected by this setting.

The default is not to perform expansion. Grayscale images with a depth of 1, 2, or 4 bits will be represented using a MultiPixelPackedSampleModel and an IndexColorModel.




setPerformGammaCorrection
public void setPerformGammaCorrection(boolean performGammaCorrection)(Code)
Turns gamma corection of the image data on or off.



setSuppressAlpha
public void setSuppressAlpha(boolean suppressAlpha)(Code)
If set, no alpha (transparency) channel will appear in the output image.

The default is to allow transparency to appear in the output image.




setUserExponent
public void setUserExponent(float userExponent)(Code)
Sets the user exponent to a given value. The exponent must be positive. If not, an IllegalArgumentException will be thrown.

The output image pixels will be placed through a transformation of the form:

 sample = integer_sample / (2^bitdepth - 1.0)
 decoding_exponent = user_exponent/(gamma_from_file * display_exponent)
 output = sample ^ decoding_exponent
 
where gamma_from_file is the gamma of the file data, as determined by the gAMA, sRGB, and/or iCCP chunks, and display_exponent is the exponent of the intrinsic transfer curve of the display, generally 2.2.

Input files which do not specify any gamma are assumed to have a gamma of 1/2.2; such images may be displayed on a CRT with an exponent of 2.2 using the default user exponent of 1.0.

The user exponent may be used in order to change the effective gamma of a file. If a file has a stored gamma of X, but the decoder believes that the true file gamma is Y, setting a user exponent of Y/X will produce the same result as changing the file gamma.

This parameter affects the decoding of all image types.
throws:
  IllegalArgumentException - if userExponent is negative.




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.