You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by nd...@apache.org on 2008/07/29 04:43:27 UTC

svn commit: r680605 - in /harmony/enhanced/classlib/trunk/modules/suncompat: META-INF/ src/main/java/com/sun/image/codec/jpeg/

Author: ndbeyer
Date: Mon Jul 28 19:43:26 2008
New Revision: 680605

URL: http://svn.apache.org/viewvc?rev=680605&view=rev
Log:
Stub out and implement enough of the com.sun.image.codec.jpeg API (via ImageIO) to get the crusty xml-stylebook code to execute

Added:
    harmony/enhanced/classlib/trunk/modules/suncompat/src/main/java/com/sun/image/codec/jpeg/JPEGCodec.java
    harmony/enhanced/classlib/trunk/modules/suncompat/src/main/java/com/sun/image/codec/jpeg/JPEGDecodeParam.java
    harmony/enhanced/classlib/trunk/modules/suncompat/src/main/java/com/sun/image/codec/jpeg/JPEGEncodeParam.java
    harmony/enhanced/classlib/trunk/modules/suncompat/src/main/java/com/sun/image/codec/jpeg/JPEGEncodeParamImpl.java
    harmony/enhanced/classlib/trunk/modules/suncompat/src/main/java/com/sun/image/codec/jpeg/JPEGImageEncoder.java
    harmony/enhanced/classlib/trunk/modules/suncompat/src/main/java/com/sun/image/codec/jpeg/JPEGImageEncoderImpl.java   (with props)
Modified:
    harmony/enhanced/classlib/trunk/modules/suncompat/META-INF/MANIFEST.MF

Modified: harmony/enhanced/classlib/trunk/modules/suncompat/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/suncompat/META-INF/MANIFEST.MF?rev=680605&r1=680604&r2=680605&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/suncompat/META-INF/MANIFEST.MF (original)
+++ harmony/enhanced/classlib/trunk/modules/suncompat/META-INF/MANIFEST.MF Mon Jul 28 19:43:26 2008
@@ -11,13 +11,15 @@
 Bundle-Version: 1.0.0
 Bundle-ClassPath: .
 Eclipse-JREBundle: true
-Import-Package: java.io,
+Import-Package: java.awt.image,
+ java.io,
  java.lang,
  java.lang.reflect,
  java.security,
+ javax.imageio,
  org.apache.harmony.kernel.vm,
  org.apache.harmony.luni.util,
- org.apache.harmony.rmi.transport;hy_usage="suncompat",
- org.apache.harmony.xnet.provider.jsse;hy_usage="suncompat"
+ org.apache.harmony.rmi.transport;hy_usage=suncompat,
+ org.apache.harmony.xnet.provider.jsse;hy_usage=suncompat
 Export-Package: com.sun.net.ssl.internal.ssl,
  sun.misc

Added: harmony/enhanced/classlib/trunk/modules/suncompat/src/main/java/com/sun/image/codec/jpeg/JPEGCodec.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/suncompat/src/main/java/com/sun/image/codec/jpeg/JPEGCodec.java?rev=680605&view=auto
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/suncompat/src/main/java/com/sun/image/codec/jpeg/JPEGCodec.java (added)
+++ harmony/enhanced/classlib/trunk/modules/suncompat/src/main/java/com/sun/image/codec/jpeg/JPEGCodec.java Mon Jul 28 19:43:26 2008
@@ -0,0 +1,30 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package com.sun.image.codec.jpeg;
+
+import java.awt.image.BufferedImage;
+import java.io.OutputStream;
+
+public class JPEGCodec {
+    public static JPEGImageEncoder createJPEGEncoder(OutputStream out, JPEGEncodeParam jep) {
+        return new JPEGImageEncoderImpl(out);
+    }
+
+    public static JPEGEncodeParam getDefaultJPEGEncodeParam(BufferedImage bi) {
+        return new JPEGEncodeParamImpl();
+    }
+}

Added: harmony/enhanced/classlib/trunk/modules/suncompat/src/main/java/com/sun/image/codec/jpeg/JPEGDecodeParam.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/suncompat/src/main/java/com/sun/image/codec/jpeg/JPEGDecodeParam.java?rev=680605&view=auto
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/suncompat/src/main/java/com/sun/image/codec/jpeg/JPEGDecodeParam.java (added)
+++ harmony/enhanced/classlib/trunk/modules/suncompat/src/main/java/com/sun/image/codec/jpeg/JPEGDecodeParam.java Mon Jul 28 19:43:26 2008
@@ -0,0 +1,21 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package com.sun.image.codec.jpeg;
+
+public interface JPEGDecodeParam extends Cloneable {
+
+}

Added: harmony/enhanced/classlib/trunk/modules/suncompat/src/main/java/com/sun/image/codec/jpeg/JPEGEncodeParam.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/suncompat/src/main/java/com/sun/image/codec/jpeg/JPEGEncodeParam.java?rev=680605&view=auto
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/suncompat/src/main/java/com/sun/image/codec/jpeg/JPEGEncodeParam.java (added)
+++ harmony/enhanced/classlib/trunk/modules/suncompat/src/main/java/com/sun/image/codec/jpeg/JPEGEncodeParam.java Mon Jul 28 19:43:26 2008
@@ -0,0 +1,21 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package com.sun.image.codec.jpeg;
+
+public interface JPEGEncodeParam {
+    void setQuality(float arg0, boolean arg1);
+}

Added: harmony/enhanced/classlib/trunk/modules/suncompat/src/main/java/com/sun/image/codec/jpeg/JPEGEncodeParamImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/suncompat/src/main/java/com/sun/image/codec/jpeg/JPEGEncodeParamImpl.java?rev=680605&view=auto
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/suncompat/src/main/java/com/sun/image/codec/jpeg/JPEGEncodeParamImpl.java (added)
+++ harmony/enhanced/classlib/trunk/modules/suncompat/src/main/java/com/sun/image/codec/jpeg/JPEGEncodeParamImpl.java Mon Jul 28 19:43:26 2008
@@ -0,0 +1,27 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package com.sun.image.codec.jpeg;
+
+class JPEGEncodeParamImpl implements JPEGEncodeParam {
+
+    JPEGEncodeParamImpl() {
+    }
+
+    public void setQuality(float arg0, boolean arg1) {
+    }
+
+}

Added: harmony/enhanced/classlib/trunk/modules/suncompat/src/main/java/com/sun/image/codec/jpeg/JPEGImageEncoder.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/suncompat/src/main/java/com/sun/image/codec/jpeg/JPEGImageEncoder.java?rev=680605&view=auto
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/suncompat/src/main/java/com/sun/image/codec/jpeg/JPEGImageEncoder.java (added)
+++ harmony/enhanced/classlib/trunk/modules/suncompat/src/main/java/com/sun/image/codec/jpeg/JPEGImageEncoder.java Mon Jul 28 19:43:26 2008
@@ -0,0 +1,31 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package com.sun.image.codec.jpeg;
+
+import java.awt.image.BufferedImage;
+import java.awt.image.Raster;
+import java.io.IOException;
+
+public interface JPEGImageEncoder {
+    void encode(BufferedImage bi) throws IOException, ImageFormatException;
+
+    void encode(BufferedImage bi, JPEGEncodeParam jep) throws IOException, ImageFormatException;
+
+    void encode(Raster r) throws IOException, ImageFormatException;
+
+    void encode(Raster r, JPEGEncodeParam jep) throws IOException, ImageFormatException;
+}

Added: harmony/enhanced/classlib/trunk/modules/suncompat/src/main/java/com/sun/image/codec/jpeg/JPEGImageEncoderImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/suncompat/src/main/java/com/sun/image/codec/jpeg/JPEGImageEncoderImpl.java?rev=680605&view=auto
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/suncompat/src/main/java/com/sun/image/codec/jpeg/JPEGImageEncoderImpl.java (added)
+++ harmony/enhanced/classlib/trunk/modules/suncompat/src/main/java/com/sun/image/codec/jpeg/JPEGImageEncoderImpl.java Mon Jul 28 19:43:26 2008
@@ -0,0 +1,49 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package com.sun.image.codec.jpeg;
+
+import java.awt.image.BufferedImage;
+import java.awt.image.Raster;
+import java.io.IOException;
+import java.io.OutputStream;
+
+import javax.imageio.ImageIO;
+
+class JPEGImageEncoderImpl implements JPEGImageEncoder {
+    private final OutputStream out;
+
+    JPEGImageEncoderImpl(OutputStream out) {
+        super();
+        this.out = out;
+    }
+
+    public void encode(BufferedImage bi) throws IOException, ImageFormatException {
+        ImageIO.write(bi, "jpg", out);
+    }
+
+    public void encode(BufferedImage bi, JPEGEncodeParam jep) throws IOException,
+            ImageFormatException {
+    }
+
+    public void encode(Raster r) throws IOException, ImageFormatException {
+
+    }
+
+    public void encode(Raster r, JPEGEncodeParam jep) throws IOException, ImageFormatException {
+
+    }
+}

Propchange: harmony/enhanced/classlib/trunk/modules/suncompat/src/main/java/com/sun/image/codec/jpeg/JPEGImageEncoderImpl.java
------------------------------------------------------------------------------
    svn:mergeinfo =