Java Doc for PNGFileFormat.java in  » IDE-Eclipse » swt » org » eclipse » swt » internal » image » 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 » IDE Eclipse » swt » org.eclipse.swt.internal.image 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.eclipse.swt.internal.image.FileFormat
      org.eclipse.swt.internal.image.PNGFileFormat

PNGFileFormat
final class PNGFileFormat extends FileFormat (Code)


Field Summary
final static  intPRIME
    
final static  intSIGNATURE_LENGTH
    
 intadler
    
 byte[]alphaPalette
    
 byte[]data
    
 byteheaderByte1
    
 byteheaderByte2
    
 PngIhdrChunkheaderChunk
    
 ImageDataimageData
    
 PngPlteChunkpaletteChunk
    


Method Summary
static  voidcompress16BitDepthTo8BitDepth(byte[] source, int sourceOffset, byte[] destination, int destinationOffset, int numberOfValues)
     SWT does not support 16-bit depth color formats.
static  intcompress16BitDepthTo8BitDepth(int value)
     SWT does not support 16-bit depth color formats.
 voidfilterRow(byte[] row, byte[] previousRow, int filterType)
     PNG supports four filtering types.
 voidfireInterlacedFrameEvent(int frameCount)
     Fire an event to let listeners know that an interlaced frame has been loaded.
 intgetAlignedBytesPerRow()
     Answer the number of bytes in a word-aligned row of pixel data.
 intgetBytesPerPixel()
     Answer the number of bytes needed to represent a pixel. This value depends on the image's color type and bit depth.
 intgetBytesPerRow()
     Answer the number of bytes in each row of the image data.
 intgetBytesPerRow(int rowWidthInPixels)
     Answer the number of bytes in a row of the given pixel width.
 booleanisFileFormat(LEDataInputStream stream)
    
 ImageData[]loadFromByteStream()
     Load the PNG image from the byte stream.
 voidreadInterlaceFrame(InputStream inputStream, int rowInterval, int columnInterval, int startRow, int startColumn, int frameCount)
     1.
 voidreadInterlacedImage(InputStream inputStream)
     Read the pixel data for an interlaced image from the data stream.
 voidreadNextChunk(PngChunkReader chunkReader)
     Read and handle the next chunk of data from the PNG file.
 voidreadNonInterlacedImage(InputStream inputStream)
     Read the pixel data for a non-interlaced image from the data stream.
 voidreadPixelData(PngIdatChunk chunk, PngChunkReader chunkReader)
     Read the image data from the data stream.
 voidreadSignature()
     Skip over signature data.
 voidsetImageDataValues(byte[] data, ImageData imageData)
     PNG supports some color types and bit depths that are unsupported by SWT.
 voidsetPixelData(byte[] data, ImageData imageData)
     SWT does not support greyscale as a color type.
 voidunloadIntoByteStream(ImageLoader loader)
    
 byte[]validateBitDepth(byte[] data)
     SWT does not support 16-bit depths.

Field Detail
PRIME
final static int PRIME(Code)



SIGNATURE_LENGTH
final static int SIGNATURE_LENGTH(Code)



adler
int adler(Code)



alphaPalette
byte[] alphaPalette(Code)



data
byte[] data(Code)



headerByte1
byte headerByte1(Code)



headerByte2
byte headerByte2(Code)



headerChunk
PngIhdrChunk headerChunk(Code)



imageData
ImageData imageData(Code)



paletteChunk
PngPlteChunk paletteChunk(Code)





Method Detail
compress16BitDepthTo8BitDepth
static void compress16BitDepthTo8BitDepth(byte[] source, int sourceOffset, byte[] destination, int destinationOffset, int numberOfValues)(Code)
SWT does not support 16-bit depth color formats. Convert the 16-bit data to 8-bit data. The correct way to do this is to multiply each 16 bit value by the value: (2^8 - 1) / (2^16 - 1). The fast way to do this is just to drop the low byte of the 16-bit value.



compress16BitDepthTo8BitDepth
static int compress16BitDepthTo8BitDepth(int value)(Code)
SWT does not support 16-bit depth color formats. Convert the 16-bit data to 8-bit data. The correct way to do this is to multiply each 16 bit value by the value: (2^8 - 1) / (2^16 - 1). The fast way to do this is just to drop the low byte of the 16-bit value.



filterRow
void filterRow(byte[] row, byte[] previousRow, int filterType)(Code)
PNG supports four filtering types. These types are applied per row of image data. This method unfilters the given row based on the filterType.



fireInterlacedFrameEvent
void fireInterlacedFrameEvent(int frameCount)(Code)
Fire an event to let listeners know that an interlaced frame has been loaded. finalFrame should be true if the image has finished loading, false if there are more frames to come.



getAlignedBytesPerRow
int getAlignedBytesPerRow()(Code)
Answer the number of bytes in a word-aligned row of pixel data.



getBytesPerPixel
int getBytesPerPixel()(Code)
Answer the number of bytes needed to represent a pixel. This value depends on the image's color type and bit depth. Note that this method rounds up if an image's pixel size isn't byte-aligned.



getBytesPerRow
int getBytesPerRow()(Code)
Answer the number of bytes in each row of the image data. Each PNG row is byte-aligned, so images with bit depths less than a byte may have unused bits at the end of each row. The value of these bits is undefined.



getBytesPerRow
int getBytesPerRow(int rowWidthInPixels)(Code)
Answer the number of bytes in a row of the given pixel width. Each row is byte-aligned, so images with bit depths less than a byte may have unused bits at the end of each row. The value of these bits is undefined.



isFileFormat
boolean isFileFormat(LEDataInputStream stream)(Code)



loadFromByteStream
ImageData[] loadFromByteStream()(Code)
Load the PNG image from the byte stream.



readInterlaceFrame
void readInterlaceFrame(InputStream inputStream, int rowInterval, int columnInterval, int startRow, int startColumn, int frameCount) throws IOException(Code)
1. Read one of the seven frames of interlaced data. 2. Update the imageData. 3. Notify the image loader's listeners of the frame load.



readInterlacedImage
void readInterlacedImage(InputStream inputStream) throws IOException(Code)
Read the pixel data for an interlaced image from the data stream.



readNextChunk
void readNextChunk(PngChunkReader chunkReader) throws IOException(Code)
Read and handle the next chunk of data from the PNG file.



readNonInterlacedImage
void readNonInterlacedImage(InputStream inputStream) throws IOException(Code)
Read the pixel data for a non-interlaced image from the data stream. Update the imageData to reflect the new data.



readPixelData
void readPixelData(PngIdatChunk chunk, PngChunkReader chunkReader) throws IOException(Code)
Read the image data from the data stream. This must handle decoding the data, filtering, and interlacing.



readSignature
void readSignature() throws IOException(Code)
Skip over signature data. This has already been verified in isFileFormat().



setImageDataValues
void setImageDataValues(byte[] data, ImageData imageData)(Code)
PNG supports some color types and bit depths that are unsupported by SWT. If the image uses an unsupported color type (either of the gray scale types) or bit depth (16), convert the data to an SWT-supported format. Then assign the data into the ImageData given.



setPixelData
void setPixelData(byte[] data, ImageData imageData)(Code)
SWT does not support greyscale as a color type. For plain grayscale, we create a palette. For Grayscale with Alpha, however, we need to convert the pixels to use RGB values. Note: This method assumes that the bit depth of the data has already been restricted to 8 or less.



unloadIntoByteStream
void unloadIntoByteStream(ImageLoader loader)(Code)



validateBitDepth
byte[] validateBitDepth(byte[] data)(Code)
SWT does not support 16-bit depths. If this image uses 16-bit depths, convert the data to an 8-bit depth.



Fields inherited from org.eclipse.swt.internal.image.FileFormat
final static String[] FORMATS(Code)(Java Doc)
final static String FORMAT_PACKAGE(Code)(Java Doc)
final static String FORMAT_SUFFIX(Code)(Java Doc)
int compression(Code)(Java Doc)
LEDataInputStream inputStream(Code)(Java Doc)
ImageLoader loader(Code)(Java Doc)
LEDataOutputStream outputStream(Code)(Java Doc)

Methods inherited from org.eclipse.swt.internal.image.FileFormat
abstract boolean isFileFormat(LEDataInputStream stream)(Code)(Java Doc)
public static ImageData[] load(InputStream is, ImageLoader loader)(Code)(Java Doc)
abstract ImageData[] loadFromByteStream()(Code)(Java Doc)
public ImageData[] loadFromStream(LEDataInputStream stream)(Code)(Java Doc)
public static void save(OutputStream os, int format, ImageLoader loader)(Code)(Java Doc)
abstract void unloadIntoByteStream(ImageLoader loader)(Code)(Java Doc)
public void unloadIntoStream(ImageLoader loader, LEDataOutputStream stream)(Code)(Java Doc)

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.