Java Doc for GifDecoder.java in  » Testing » abbot-1.0.1 » abbot » editor » widgets » 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 » Testing » abbot 1.0.1 » abbot.editor.widgets 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   abbot.editor.widgets.GifDecoder

GifDecoder
public class GifDecoder (Code)
Class GifDecoder - Decodes a GIF file into one or more frames.
 Example:
 GifDecoder d = new GifDecoder();
 d.read("sample.gif");
 int n = d.getFrameCount();
 for (int i = 0; i < n; i++) {
 BufferedImage frame = d.getFrame(i);  // frame i
 int t = d.getDelay(i);  // display duration of frame in milliseconds
 // do something with frame
 }
 
No copyright asserted on the source code of this class. May be used for any purpose, however, refer to the Unisys LZW patent for any additional restrictions. Please forward any corrections to kweiner@fmsware.com.
author:
   Kevin Weiner, FM Software; LZW decoder adapted from John
author:
   Cristy's ImageMagick.
version:
   1.03 November 2003

Inner Class :static class GifFrame

Field Summary
final protected static  intMaxStackSize
    
final public static  intSTATUS_FORMAT_ERROR
    
final public static  intSTATUS_OK
     File read status: No errors.
final public static  intSTATUS_OPEN_ERROR
     File read status: Unable to open source.
protected  int[]act
    
protected  intbgColor
    
protected  intbgIndex
    
protected  byte[]block
    
protected  intblockSize
    
protected  intdelay
    
protected  intdispose
    
protected  intframeCount
    
protected  ArrayListframes
    
protected  int[]gct
    
protected  booleangctFlag
    
protected  intgctSize
    
protected  intheight
    
protected  BufferedImageimage
    
protected  BufferedInputStreamin
    
protected  booleaninterlace
    
protected  intixiyiwih
    
protected  intlastBgColor
    
protected  intlastDispose
    
protected  BufferedImagelastImage
    
protected  RectanglelastRect
    
protected  int[]lct
    
protected  booleanlctFlag
    
protected  intlctSize
    
protected  intloopCount
    
protected  intpixelAspect
    
protected  byte[]pixelStack
    
protected  byte[]pixels
    
protected  short[]prefix
    
protected  intstatus
    
protected  byte[]suffix
    
protected  inttransIndex
    
protected  booleantransparency
    
protected  intwidth
    


Method Summary
protected  voiddecodeImageData()
     Decodes LZW image data into pixel array.
protected  booleanerr()
    
public  intgetDelay(int n)
     Gets display duration for specified frame.
public  BufferedImagegetFrame(int n)
     Gets the image contents of frame n.
public  intgetFrameCount()
     Gets the number of frames read from file.
public  DimensiongetFrameSize()
     Gets image size.
public  BufferedImagegetImage()
     Gets the first (or only) image read.
public  intgetLoopCount()
     Gets the "Netscape" iteration count, if any.
protected  voidinit()
    
public  intread(BufferedInputStream is)
     Reads GIF image from stream
Parameters:
  is - BufferedInputStreamcontaining GIF file.
public  intread(InputStream is)
     Reads GIF image from stream
Parameters:
  is - InputStream containing GIF file.
public  intread(String name)
    
protected  intread()
     Reads a single byte from the input stream.
protected  intreadBlock()
     Reads next variable length block from input.
protected  int[]readColorTable(int ncolors)
    
protected  voidreadContents()
     Main file parser.
protected  voidreadGraphicControlExt()
    
protected  voidreadHeader()
     Reads GIF file header information.
protected  voidreadImage()
    
protected  voidreadLSD()
    
protected  voidreadNetscapeExt()
    
protected  intreadShort()
    
protected  voidresetFrame()
     Resets frame state for reading next image.
protected  voidsetPixels()
     Creates new frame image from current data (and previous frames as specified by their disposition codes).
protected  voidskip()
     Skips variable length blocks up to and including next zero length block.

Field Detail
MaxStackSize
final protected static int MaxStackSize(Code)



STATUS_FORMAT_ERROR
final public static int STATUS_FORMAT_ERROR(Code)
File read status: Error decoding file (may be partially decoded)



STATUS_OK
final public static int STATUS_OK(Code)
File read status: No errors.



STATUS_OPEN_ERROR
final public static int STATUS_OPEN_ERROR(Code)
File read status: Unable to open source.



act
protected int[] act(Code)



bgColor
protected int bgColor(Code)



bgIndex
protected int bgIndex(Code)



block
protected byte[] block(Code)



blockSize
protected int blockSize(Code)



delay
protected int delay(Code)



dispose
protected int dispose(Code)



frameCount
protected int frameCount(Code)



frames
protected ArrayList frames(Code)



gct
protected int[] gct(Code)



gctFlag
protected boolean gctFlag(Code)



gctSize
protected int gctSize(Code)



height
protected int height(Code)



image
protected BufferedImage image(Code)



in
protected BufferedInputStream in(Code)



interlace
protected boolean interlace(Code)



ixiyiwih
protected int ixiyiwih(Code)



lastBgColor
protected int lastBgColor(Code)



lastDispose
protected int lastDispose(Code)



lastImage
protected BufferedImage lastImage(Code)



lastRect
protected Rectangle lastRect(Code)



lct
protected int[] lct(Code)



lctFlag
protected boolean lctFlag(Code)



lctSize
protected int lctSize(Code)



loopCount
protected int loopCount(Code)



pixelAspect
protected int pixelAspect(Code)



pixelStack
protected byte[] pixelStack(Code)



pixels
protected byte[] pixels(Code)



prefix
protected short[] prefix(Code)



status
protected int status(Code)



suffix
protected byte[] suffix(Code)



transIndex
protected int transIndex(Code)



transparency
protected boolean transparency(Code)



width
protected int width(Code)





Method Detail
decodeImageData
protected void decodeImageData()(Code)
Decodes LZW image data into pixel array. Adapted from John Cristy's ImageMagick.



err
protected boolean err()(Code)
Returns true if an error was encountered during reading/decoding



getDelay
public int getDelay(int n)(Code)
Gets display duration for specified frame.
Parameters:
  n - int index of frame delay in milliseconds



getFrame
public BufferedImage getFrame(int n)(Code)
Gets the image contents of frame n. BufferedImage representation of frame, or null if n isinvalid.



getFrameCount
public int getFrameCount()(Code)
Gets the number of frames read from file. frame count



getFrameSize
public Dimension getFrameSize()(Code)
Gets image size. GIF image dimensions



getImage
public BufferedImage getImage()(Code)
Gets the first (or only) image read. BufferedImage containing first frame, or null if none.



getLoopCount
public int getLoopCount()(Code)
Gets the "Netscape" iteration count, if any. A count of 0 means repeat indefinitiely. iteration count if one was specified, else 1.



init
protected void init()(Code)
Initializes or re-initializes reader



read
public int read(BufferedInputStream is)(Code)
Reads GIF image from stream
Parameters:
  is - BufferedInputStreamcontaining GIF file. read status code (0 = no errors)



read
public int read(InputStream is)(Code)
Reads GIF image from stream
Parameters:
  is - InputStream containing GIF file. read status code (0 = no errors)



read
public int read(String name)(Code)
Reads GIF file from specified file/URL source (URL assumed if name contains ":/" or "file:")
Parameters:
  name - String containing source read status code (0 = no errors)



read
protected int read()(Code)
Reads a single byte from the input stream.



readBlock
protected int readBlock()(Code)
Reads next variable length block from input. number of bytes stored in "buffer"



readColorTable
protected int[] readColorTable(int ncolors)(Code)
Reads color table as 256 RGB integer values
Parameters:
  ncolors - int number of colors to read int array containing 256 colors (packed ARGB with fullalpha)



readContents
protected void readContents()(Code)
Main file parser. Reads GIF content blocks.



readGraphicControlExt
protected void readGraphicControlExt()(Code)
Reads Graphics Control Extension values



readHeader
protected void readHeader()(Code)
Reads GIF file header information.



readImage
protected void readImage()(Code)
Reads next frame image



readLSD
protected void readLSD()(Code)
Reads Logical Screen Descriptor



readNetscapeExt
protected void readNetscapeExt()(Code)
Reads Netscape extenstion to obtain iteration count



readShort
protected int readShort()(Code)
Reads next 16-bit value, LSB first



resetFrame
protected void resetFrame()(Code)
Resets frame state for reading next image.



setPixels
protected void setPixels()(Code)
Creates new frame image from current data (and previous frames as specified by their disposition codes).



skip
protected void skip()(Code)
Skips variable length blocks up to and including next zero length block.



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.