changeset in /hg/icedtea: 2007-11-16 Lillian Angel <langel at red...

Lillian Angel langel at redhat.com
Fri Nov 16 06:20:10 PST 2007


changeset 2989dbf0b643 in /hg/icedtea
details: http://icedtea.classpath.org/hg/icedtea?cmd=changeset;node=2989dbf0b643
description:
	2007-11-16  Lillian Angel  <langel at redhat.com>

	        * AUTHORS: Added Mathhew Flaschen.

	2007-11-16  Matthew Flaschen  <matthew.flaschen at gatech.edu>

	        * rt/com/sun/image/codec/jpeg/JPEGCodec.java: Partially implemented.
	        * rt/com/sun/image/codec/jpeg/JPEGImageDecoder.java: Implemented.
	        * rt/com/sun/image/codec/jpeg/ImageFormatException.java: New Class,
	        implemented.
	        * rt/com/sun/image/codec/jpeg/JPEGDecodeParam.java: New Class,
	        stubbed.

diffstat:

6 files changed, 217 insertions(+), 11 deletions(-)
AUTHORS                                               |    1 
ChangeLog                                             |   13 ++
rt/com/sun/image/codec/jpeg/ImageFormatException.java |   51 ++++++++
rt/com/sun/image/codec/jpeg/JPEGCodec.java            |   98 +++++++++++++++--
rt/com/sun/image/codec/jpeg/JPEGDecodeParam.java      |   44 +++++++
rt/com/sun/image/codec/jpeg/JPEGImageDecoder.java     |   21 ++-

diffs (296 lines):

diff -r 1f7f39188e9f -r 2989dbf0b643 AUTHORS
--- a/AUTHORS	Fri Nov 16 13:18:29 2007 +0000
+++ b/AUTHORS	Fri Nov 16 09:19:22 2007 -0500
@@ -5,6 +5,7 @@ Gary Benson <gbenson at redhat.com>
 Gary Benson <gbenson at redhat.com>
 Tania Bento <tbento at redhat.com>
 Thomas Fitzsimmons <fitzsim at redhat.com>
+Matthew Flaschen <matthew.flaschen at gatech.edu>
 Kyle Galloway <kgallowa at redhat.com>
 Andrew Haley <aph at redhat.com>
 Matthias Klose <doko at ubuntu.com>
diff -r 1f7f39188e9f -r 2989dbf0b643 ChangeLog
--- a/ChangeLog	Fri Nov 16 13:18:29 2007 +0000
+++ b/ChangeLog	Fri Nov 16 09:19:22 2007 -0500
@@ -1,3 +1,16 @@ 2007-11-16  Gary Benson  <gbenson at redhat
+2007-11-16  Lillian Angel  <langel at redhat.com>
+
+	* AUTHORS: Added Mathhew Flaschen.
+
+2007-11-16  Matthew Flaschen  <matthew.flaschen at gatech.edu>
+
+	* rt/com/sun/image/codec/jpeg/JPEGCodec.java: Partially implemented.
+	* rt/com/sun/image/codec/jpeg/JPEGImageDecoder.java: Implemented.
+	* rt/com/sun/image/codec/jpeg/ImageFormatException.java: New Class,
+	implemented.
+	* rt/com/sun/image/codec/jpeg/JPEGDecodeParam.java: New Class,
+	stubbed.
+
 2007-11-16  Gary Benson  <gbenson at redhat.com>
 
 	* contrib: New directory.
diff -r 1f7f39188e9f -r 2989dbf0b643 rt/com/sun/image/codec/jpeg/ImageFormatException.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rt/com/sun/image/codec/jpeg/ImageFormatException.java	Fri Nov 16 09:19:22 2007 -0500
@@ -0,0 +1,51 @@
+/* ImageFormatException.java
+   Copyright (C) 2007 Matthew Flaschen
+
+   This file is part of IcedTea
+
+   IcedTea is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   IcedTea is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with GNU Classpath; see the file COPYING.  If not, write to the
+   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301 USA.
+
+   Linking this library statically or dynamically with other modules is
+   making a combined work based on this library.  Thus, the terms and
+   conditions of the GNU General Public License cover the whole
+   combination.
+
+   As a special exception, the copyright holders of this library give you
+   permission to link this library with independent modules to produce an
+   executable, regardless of the license terms of these independent
+   modules, and to copy and distribute the resulting executable under
+   terms of your choice, provided that you also meet, for each linked
+   independent module, the terms and conditions of the license of that
+   module.  An independent module is a module which is not derived from
+   or based on this library.  If you modify this library, you may extend
+   this exception to your version of the library, but you are not
+   obligated to do so.  If you do not wish to do so, delete this
+   exception statement from your version. */
+
+package com.sun.image.codec.jpeg;
+
+public class ImageFormatException extends RuntimeException
+{
+	public ImageFormatException()
+	{
+		this("");
+	}
+
+	public ImageFormatException(String s)
+	{
+		super(s);
+	}
+}
diff -r 1f7f39188e9f -r 2989dbf0b643 rt/com/sun/image/codec/jpeg/JPEGCodec.java
--- a/rt/com/sun/image/codec/jpeg/JPEGCodec.java	Fri Nov 16 13:18:29 2007 +0000
+++ b/rt/com/sun/image/codec/jpeg/JPEGCodec.java	Fri Nov 16 09:19:22 2007 -0500
@@ -1,5 +1,6 @@
 /* JPEGCodec.java -- 
    Copyright (C) 2007 Free Software Foundation, Inc.
+   Copyright (C) 2007 Matthew Flaschen
 
    This file is part of GNU Classpath.
 
@@ -39,22 +40,107 @@ package com.sun.image.codec.jpeg;
 
 import java.io.InputStream;
 import java.io.OutputStream;
-import com.sun.image.codec.jpeg.*;
+import java.io.IOException;
+
+import java.awt.image.BufferedImage;
+import java.awt.image.Raster;
+
+import javax.imageio.*;
+import javax.imageio.stream.*;
+import javax.imageio.plugins.jpeg.*;
+
+import java.util.Iterator;
 
 public class JPEGCodec
 {
 
-	public JPEGCodec()
-	{
-	}	
-
 	public static JPEGImageDecoder createJPEGDecoder(InputStream is)
 	{
-		return null;
+		return new ImageIOJPEGImageDecoder(is);
 	}
 
 	public static JPEGImageEncoder createJPEGEncoder(OutputStream os)
 	{
 		return null;
 	}
+
+	public static JPEGImageDecoder createJPEGDecoder(InputStream src, JPEGDecodeParam jdp)
+	{
+		return null; 
+	}
+        
+	public static JPEGImageEncoder createJPEGEncoder(OutputStream dest, JPEGEncodeParam jep)
+	{
+		return null;
+	}
+        
+	public static JPEGEncodeParam getDefaultJPEGEncodeParam(BufferedImage bi)
+	{
+		return null;
+	}
+        
+	public static JPEGEncodeParam getDefaultJPEGEncodeParam(int numBands, int colorID)
+	{
+		return null;
+	}
+		
+	public static JPEGEncodeParam getDefaultJPEGEncodeParam(JPEGDecodeParam jdp)
+	{
+		return null;
+	}
+        
+	public static JPEGEncodeParam getDefaultJPEGEncodeParam(Raster ras, int colorID)
+	{
+		return null;
+	}
+        
+
+	private static class ImageIOJPEGImageDecoder implements JPEGImageDecoder
+	{
+		
+		private static final String JPGMime = "image/jpeg";
+    
+		private ImageReader JPGReader;
+		
+		private InputStream in;
+		
+		private ImageIOJPEGImageDecoder (InputStream newIs)
+		{
+			in = newIs;
+			
+			Iterator<ImageReader> JPGReaderIter = ImageIO.getImageReadersByMIMEType(JPGMime);
+			if(JPGReaderIter.hasNext())
+			{
+				JPGReader  = JPGReaderIter.next();
+			}
+			
+			JPGReader.setInput(new MemoryCacheImageInputStream(in));
+		}
+
+		public BufferedImage decodeAsBufferedImage() throws IOException, ImageFormatException
+		{
+			return JPGReader.read(0);
+		}
+		
+		public Raster decodeAsRaster() throws IOException, ImageFormatException
+		{
+			return JPGReader.readRaster(0, null);
+		}
+		
+		public InputStream getInputStream()
+		{
+			return in;
+		}
+		
+		public JPEGDecodeParam getJPEGDecodeParam()
+		{
+			return null;
+		}
+
+		public void setJPEGDecodeParam(JPEGDecodeParam jdp)
+		{
+			return;
+		}
+
+	}
 }
diff -r 1f7f39188e9f -r 2989dbf0b643 rt/com/sun/image/codec/jpeg/JPEGDecodeParam.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rt/com/sun/image/codec/jpeg/JPEGDecodeParam.java	Fri Nov 16 09:19:22 2007 -0500
@@ -0,0 +1,44 @@
+/* JPEGImageDecoder.java -- 
+   Copyright (C) 2007 Free Software Foundation, Inc.
+   Copyright (C) 2007 Matthew Flaschen
+
+   This file is part of GNU Classpath.
+
+   GNU Classpath is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   GNU Classpath is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with GNU Classpath; see the file COPYING.  If not, write to the
+   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301 USA.
+
+   Linking this library statically or dynamically with other modules is
+   making a combined work based on this library.  Thus, the terms and
+   conditions of the GNU General Public License cover the whole
+   combination.
+
+   As a special exception, the copyright holders of this library give you
+   permission to link this library with independent modules to produce an
+   executable, regardless of the license terms of these independent
+   modules, and to copy and distribute the resulting executable under
+   terms of your choice, provided that you also meet, for each linked
+   independent module, the terms and conditions of the license of that
+   module.  An independent module is a module which is not derived from
+   or based on this library.  If you modify this library, you may extend
+   this exception to your version of the library, but you are not
+   obligated to do so.  If you do not wish to do so, delete this
+   exception statement from your version. */
+
+package com.sun.image.codec.jpeg;
+
+public interface JPEGDecodeParam
+{
+
+}
diff -r 1f7f39188e9f -r 2989dbf0b643 rt/com/sun/image/codec/jpeg/JPEGImageDecoder.java
--- a/rt/com/sun/image/codec/jpeg/JPEGImageDecoder.java	Fri Nov 16 13:18:29 2007 +0000
+++ b/rt/com/sun/image/codec/jpeg/JPEGImageDecoder.java	Fri Nov 16 09:19:22 2007 -0500
@@ -1,5 +1,6 @@
 /* JPEGImageDecoder.java -- 
    Copyright (C) 2007 Free Software Foundation, Inc.
+   Copyright (C) 2007 Matthew Flaschen
 
    This file is part of GNU Classpath.
 
@@ -38,12 +39,22 @@
 
 package com.sun.image.codec.jpeg;
 import java.awt.image.BufferedImage;
+import java.awt.image.Raster;
 
-public class JPEGImageDecoder
+import java.io.InputStream;
+import java.io.IOException;
+
+
+public interface JPEGImageDecoder
 {
 
-	public BufferedImage decodeAsBufferedImage()
-	{
-		return null;
-	}
+	public BufferedImage decodeAsBufferedImage() throws IOException, ImageFormatException;
+	
+	public Raster decodeAsRaster() throws IOException, ImageFormatException;
+	
+	public InputStream getInputStream();
+
+	public JPEGDecodeParam getJPEGDecodeParam();
+
+	public void setJPEGDecodeParam(JPEGDecodeParam jdp);
 }



More information about the distro-pkg-dev mailing list