src/share/classes/sun/awt/image/PNGImageDecoder.java

Print this page




  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package sun.awt.image;
  27 
  28 import java.io.*;
  29 import java.util.*;
  30 import java.util.zip.*;
  31 import java.awt.image.*;
  32 import java.awt.Color;
  33 
  34 /** PNG - Portable Network Graphics - image file reader.
  35     See <a href=ftp://ds.internic.net/rfc/rfc2083.txt>RFC2083</a> for details. */
  36 
  37 /* this is changed
  38 public class PNGImageDecoder extends FilterInputStream implements Runnable
  39 { */
  40 
  41 public class PNGImageDecoder extends ImageDecoder
  42 {
  43     private static final int GRAY=0;
  44     private static final int PALETTE=1;
  45     private static final int COLOR=2;
  46     private static final int ALPHA=4;
  47 
  48     private static final int bKGDChunk = 0x624B4744;
  49     private static final int cHRMChunk = 0x6348524D;
  50     private static final int gAMAChunk = 0x67414D41;
  51     private static final int hISTChunk = 0x68495354;
  52     private static final int IDATChunk = 0x49444154;
  53     private static final int IENDChunk = 0x49454E44;
  54     private static final int IHDRChunk = 0x49484452;
  55     private static final int PLTEChunk = 0x504C5445;




  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package sun.awt.image;
  27 
  28 import java.io.*;
  29 import java.util.*;
  30 import java.util.zip.*;
  31 import java.awt.image.*;
  32 import java.awt.Color;
  33 
  34 /** PNG - Portable Network Graphics - image file reader.
  35     See <a href=http://www.ietf.org/rfc/rfc2083.txt>RFC2083</a> for details. */
  36 
  37 /* this is changed
  38 public class PNGImageDecoder extends FilterInputStream implements Runnable
  39 { */
  40 
  41 public class PNGImageDecoder extends ImageDecoder
  42 {
  43     private static final int GRAY=0;
  44     private static final int PALETTE=1;
  45     private static final int COLOR=2;
  46     private static final int ALPHA=4;
  47 
  48     private static final int bKGDChunk = 0x624B4744;
  49     private static final int cHRMChunk = 0x6348524D;
  50     private static final int gAMAChunk = 0x67414D41;
  51     private static final int hISTChunk = 0x68495354;
  52     private static final int IDATChunk = 0x49444154;
  53     private static final int IENDChunk = 0x49454E44;
  54     private static final int IHDRChunk = 0x49484452;
  55     private static final int PLTEChunk = 0x504C5445;