summaryrefslogtreecommitdiff
path: root/javax
diff options
context:
space:
mode:
authorMichael Koch <konqueror@gmx.de>2004-10-04 08:15:26 +0000
committerMichael Koch <konqueror@gmx.de>2004-10-04 08:15:26 +0000
commitc677168acb72d581b78db20a73c987adb5e5044b (patch)
treec9bd8b04d9513a4752eac6f684eb4930125097f9 /javax
parentbd05a35240c58f829acbd64a3564f379a1edd968 (diff)
downloadclasspath-c677168acb72d581b78db20a73c987adb5e5044b.tar.gz
2004-10-04 Michael Koch <konqueror@gmx.de>
* javax/imageio/IIOImage.java, javax/imageio/ImageReadParam.java, javax/imageio/metadata/IIOMetadataController.java, javax/imageio/metadata/IIOMetadataFormat.java: New files. * javax/imageio/stream/ImageOutputStream.java: Implemented.
Diffstat (limited to 'javax')
-rw-r--r--javax/imageio/IIOImage.java138
-rw-r--r--javax/imageio/ImageReadParam.java46
-rw-r--r--javax/imageio/metadata/IIOMetadataController.java47
-rw-r--r--javax/imageio/metadata/IIOMetadataFormat.java68
-rw-r--r--javax/imageio/stream/ImageOutputStream.java217
5 files changed, 513 insertions, 3 deletions
diff --git a/javax/imageio/IIOImage.java b/javax/imageio/IIOImage.java
new file mode 100644
index 000000000..587a3d4b2
--- /dev/null
+++ b/javax/imageio/IIOImage.java
@@ -0,0 +1,138 @@
+/* IIOImage.java --
+ Copyright (C) 2003 Free Software Foundation, Inc.
+
+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., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 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 javax.imageio;
+
+import java.awt.image.BufferedImage;
+import java.awt.image.Raster;
+import java.awt.image.RenderedImage;
+import java.util.List;
+
+import javax.imageio.metadata.IIOMetadata;
+
+public class IIOImage
+{
+ protected RenderedImage image;
+ protected IIOMetadata metadata;
+ protected Raster raster;
+ protected List thumbnails;
+
+ public IIOImage (Raster raster, List thumbnails, IIOMetadata metadata)
+ {
+ if (raster == null)
+ throw new IllegalArgumentException ("raster may not be null");
+
+ this.raster = raster;
+ this.thumbnails = thumbnails;
+ this.metadata = metadata;
+ }
+
+ public IIOImage (RenderedImage image, List thumbnails, IIOMetadata metadata)
+ {
+ if (image == null)
+ throw new IllegalArgumentException ("image may not be null");
+
+ this.image = image;
+ this.thumbnails = thumbnails;
+ this.metadata = metadata;
+ }
+
+ public IIOMetadata getMetadata()
+ {
+ return metadata;
+ }
+
+ public int getNumThumbnails()
+ {
+ return thumbnails.size();
+ }
+
+ public Raster getRaster()
+ {
+ return raster;
+ }
+
+ public RenderedImage getRenderedImage()
+ {
+ return image;
+ }
+
+ public BufferedImage getThumbnail (int index)
+ {
+ return (BufferedImage) thumbnails.get (index);
+ }
+
+ public List getThumbnails()
+ {
+ return thumbnails;
+ }
+
+ public boolean hasRaster()
+ {
+ return raster != null;
+ }
+
+ public void setMetadata (IIOMetadata metadata)
+ {
+ this.metadata = metadata;
+ }
+
+ public void setRaster (Raster raster)
+ {
+ if (raster == null)
+ throw new IllegalArgumentException ("raster may not be null");
+
+ this.image = null;
+ this.raster = raster;
+ }
+
+ public void setRenderedImage (RenderedImage image)
+ {
+ if (image == null)
+ throw new IllegalArgumentException ("image may not be null");
+
+ this.image = image;
+ this.raster = null;
+ }
+
+ public void setThumbnails (List thumbnails)
+ {
+ this.thumbnails = thumbnails;
+ }
+
+} // class IIOParam
diff --git a/javax/imageio/ImageReadParam.java b/javax/imageio/ImageReadParam.java
new file mode 100644
index 000000000..a66c2cbda
--- /dev/null
+++ b/javax/imageio/ImageReadParam.java
@@ -0,0 +1,46 @@
+/* ImageReadParam.java --
+ Copyright (C) 2004 Free Software Foundation, Inc.
+
+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., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 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 javax.imageio;
+
+/**
+ * @author Michel Koch (konqueror@gmx.de)
+ */
+public class ImageReadParam extends IIOParam
+{
+}
diff --git a/javax/imageio/metadata/IIOMetadataController.java b/javax/imageio/metadata/IIOMetadataController.java
new file mode 100644
index 000000000..db899d8cc
--- /dev/null
+++ b/javax/imageio/metadata/IIOMetadataController.java
@@ -0,0 +1,47 @@
+/* IIOMetadataController.java --
+ Copyright (C) 2004 Free Software Foundation, Inc.
+
+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., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 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 javax.imageio.metadata;
+
+/**
+ * @author Michael Koch (konqueror@gmx.de)
+ */
+public interface IIOMetadataController
+{
+ boolean activate(IIOMetadata metadata);
+}
diff --git a/javax/imageio/metadata/IIOMetadataFormat.java b/javax/imageio/metadata/IIOMetadataFormat.java
new file mode 100644
index 000000000..aa5235483
--- /dev/null
+++ b/javax/imageio/metadata/IIOMetadataFormat.java
@@ -0,0 +1,68 @@
+/* IIOMetadataFormat.java --
+ Copyright (C) 2004 Free Software Foundation, Inc.
+
+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., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 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 javax.imageio.metadata;
+
+/**
+ * @author Michael Koch (konqueror@gmx.de)
+ */
+public interface IIOMetadataFormat
+{
+ int CHILD_POLICY_ALL = 1;
+ int CHILD_POLICY_CHOICE = 3;
+ int CHILD_POLICY_EMPTY = 0;
+ int CHILD_POLICY_MAX = 5;
+ int CHILD_POLICY_REPEAT = 5;
+ int CHILD_POLICY_SEQUENCE = 4;
+ int CHILD_POLICY_SOME = 2;
+ int DATATYPE_BOOLEAN = 1;
+ int DATATYPE_DOUBLE = 4;
+ int DATATYPE_FLOAT = 3;
+ int DATATYPE_INTEGER = 2;
+ int DATATYPE_STRING = 0;
+ int VALUE_ARBITRARY = 1;
+ int VALUE_ENUMERATION = 16;
+ int VALUE_LIST = 32;
+ int VALUE_NONE = 0;
+ int VALUE_RANGE = 2;
+ int VALUE_RANGE_MAX_INCLUSIVE = 10;
+ int VALUE_RANGE_MAX_INCLUSIVE_MASK = 8;
+ int VALUE_RANGE_MIN_INCLUSIVE = 6;
+ int VALUE_RANGE_MIN_INCLUSIVE_MASK = 4;
+ int VALUE_RANGE_MIN_MAX_INCLUSIVE = 14;
+}
diff --git a/javax/imageio/stream/ImageOutputStream.java b/javax/imageio/stream/ImageOutputStream.java
index 58a65944a..f53feab71 100644
--- a/javax/imageio/stream/ImageOutputStream.java
+++ b/javax/imageio/stream/ImageOutputStream.java
@@ -39,6 +39,7 @@ exception statement from your version. */
package javax.imageio.stream;
import java.io.DataOutput;
+import java.io.IOException;
/**
@@ -52,7 +53,217 @@ import java.io.DataOutput;
public interface ImageOutputStream
extends ImageInputStream, DataOutput
{
- // FIXME: Incomplete. This interface is merely present in order to
- // allow compilation of the javax.imageio.spi package, for which GNU
- // Classpath does provide an implementation.
+ /**
+ * @param postion
+ *
+ * @throws IOException if an errror occurs
+ */
+ void flushBefore(long position) throws IOException;
+
+ /**
+ * Writes an array into the stream.
+ *
+ * @param data the data to be written
+ *
+ * @throws IOException if an errror occurs
+ */
+ void write(byte[] data) throws IOException;
+
+ /**
+ * Writes a region of data from an array into the stream.
+ *
+ * @param data the data to be written
+ * @param offset the offset in the array
+ * @param len the length in the array
+ *
+ * @throws IOException if an errror occurs
+ */
+ void write(byte[] data, int offset, int len) throws IOException;
+
+ /**
+ * Writes an <code>int</code> into the stream.
+ *
+ * @param data the data to be written
+ *
+ * @throws IOException if an errror occurs
+ */
+ void write(int data) throws IOException;
+
+ /**
+ * Writes a bit value to the stream.
+ *
+ * @throws IOException if an error occurs
+ */
+ void writeBit(int bit) throws IOException;
+
+ /**
+ * Writes a number of bit values to the stream.
+ *
+ * @throws IOException if an errror occurs
+ */
+ void writeBits(long bits, int numBits) throws IOException;
+
+ /**
+ * Writes a <code>boolean</code> value into the stream.
+ *
+ * @param data the data to be written
+ *
+ * @throws IOException if an errror occurs
+ */
+ void writeBoolean(boolean data) throws IOException;
+
+ /**
+ * Writes a <code>byte</code> value into the stream.
+ *
+ * @param data the data to be written
+ *
+ * @throws IOException if an errror occurs
+ */
+ void writeByte(int data) throws IOException;
+
+ /**
+ * @param data the data to be written
+ *
+ * @throws IOException if an errror occurs
+ */
+ void writeBytes(String data) throws IOException;
+
+ /**
+ * Writes a character into the stream.
+ *
+ * @param data the data to be written
+ *
+ * @throws IOException if an errror occurs
+ */
+ void writeChar(int data) throws IOException;
+
+ /**
+ * Writes characters to the stream.
+ *
+ * @param data the data to be written
+ * @param offset the offset in the array
+ * @param len the lenth in the array
+ *
+ * @throws IOException if an errror occurs
+ */
+ void writeChars(char[] data, int offset, int len) throws IOException;
+
+ /**
+ * Writes characters from a given <code>String</code> into the stream.
+ *
+ * @param data the data to be written
+ *
+ * @throws IOException if an errror occurs
+ */
+ void writeChars(String data) throws IOException;
+
+ /**
+ * Writes a <code>double</code> into the stream.
+ *
+ * @param data the data to be written
+ *
+ * @throws IOException if an errror occurs
+ */
+ void writeDouble(double data) throws IOException;
+
+ /**
+ * Writes an array of <code>double</code> into the stream.
+ *
+ * @param data the data to be written
+ * @param offset the offset in the array
+ * @param len the lenth in the array
+ *
+ * @throws IOException if an errror occurs
+ */
+ void writeDoubles(double[] data, int offset, int len)
+ throws IOException;
+
+ /**
+ * Writes a <code>float</code> into the stream.
+ *
+ * @param data the data to be written
+ *
+ * @throws IOException if an errror occurs
+ */
+ void writeFloat(float data) throws IOException;
+
+ /**
+ * Writes an array of <code>float</code> into the stream.
+ *
+ * @param data the data to be written
+ * @param offset the offset in the array
+ * @param len the lenth in the array
+ *
+ * @throws IOException if an errror occurs
+ */
+ void writeFloats(float[] data, int offset, int len) throws IOException;
+
+ /**
+ * Writes a <code>int</code> into the stream.
+ *
+ * @param data the data to be written
+ *
+ * @throws IOException if an errror occurs
+ */
+ void writeInt(int data) throws IOException;
+
+ /**
+ * Writes an array of <code>int</code> into the stream.
+ *
+ * @param data the data to be written
+ * @param offset the offset in the array
+ * @param len the lenth in the array
+ *
+ * @throws IOException if an errror occurs
+ */
+ void writeInts(int[] data, int offset, int len) throws IOException;
+
+ /**
+ * Writes a <code>long</code> into the stream.
+ *
+ * @param data the data to be written
+ *
+ * @throws IOException if an errror occurs
+ */
+ void writeLong(long data) throws IOException;
+
+ /**
+ * Writes an array of <code>long</code> into the stream.
+ *
+ * @param data the data to be written
+ * @param offset the offset in the array
+ * @param len the lenth in the array
+ *
+ * @throws IOException if an errror occurs
+ */
+ void writeLongs(long[] data, int offset, int len) throws IOException;
+
+ /**
+ * Writes a <code>short</code> into the stream.
+ *
+ * @param data the data to be written
+ *
+ * @throws IOException if an errror occurs
+ */
+ void writeShort(int data) throws IOException;
+
+ /**
+ * Writes an array of <code>short</code> into the stream.
+ *
+ * @param data the data to be written
+ * @param offset the offset in the array
+ * @param len the lenth in the array
+ *
+ * @throws IOException if an errror occurs
+ */
+ void writeShorts(short[] data, int offset, int len) throws IOException;
+
+ /**
+ * Writes a <code>String</code> into the stream.
+ *
+ * @param data the data to be written
+ *
+ * @throws IOException if an errror occurs
+ */
+ void writeUTF(String data) throws IOException;
}