harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apetre...@apache.org
Subject svn commit: r475729 - in /incubator/harmony/enhanced/classlib/trunk/modules/imageio/src/main/java: javax/imageio/ org/apache/harmony/x/imageio/plugins/jpeg/
Date Thu, 16 Nov 2006 13:38:28 GMT
Author: apetrenko
Date: Thu Nov 16 05:38:27 2006
New Revision: 475729

URL: http://svn.apache.org/viewvc?view=rev&rev=475729
Log:
Patch for HARMONY-2104 "[classlib][imageio] Implementation of the missing javax.imageio.plugins.jpeg.*
classes."

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/imageio/src/main/java/javax/imageio/ImageWriteParam.java
    incubator/harmony/enhanced/classlib/trunk/modules/imageio/src/main/java/org/apache/harmony/x/imageio/plugins/jpeg/JPEGConsts.java
    incubator/harmony/enhanced/classlib/trunk/modules/imageio/src/main/java/org/apache/harmony/x/imageio/plugins/jpeg/JPEGImageReader.java
    incubator/harmony/enhanced/classlib/trunk/modules/imageio/src/main/java/org/apache/harmony/x/imageio/plugins/jpeg/JPEGImageWriter.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/imageio/src/main/java/javax/imageio/ImageWriteParam.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/imageio/src/main/java/javax/imageio/ImageWriteParam.java?view=diff&rev=475729&r1=475728&r2=475729
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/imageio/src/main/java/javax/imageio/ImageWriteParam.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/imageio/src/main/java/javax/imageio/ImageWriteParam.java
Thu Nov 16 05:38:27 2006
@@ -252,13 +252,17 @@
     public void setCompressionMode(int mode) {
         checkWriteCompressed();
         switch (mode) {
-            case MODE_EXPLICIT:
+            case MODE_EXPLICIT: {
+                compressionMode = mode;
                 unsetCompression();
+                break;
+            }
             case MODE_COPY_FROM_METADATA:
             case MODE_DISABLED:
-            case MODE_DEFAULT:
+            case MODE_DEFAULT: {
                 compressionMode = mode;
                 break;
+            }
             default: {
                 throw new IllegalArgumentException("Illegal value for mode!");
             }
@@ -347,13 +351,17 @@
         checkTiling();
 
         switch (mode) {
-            case MODE_EXPLICIT:
+            case MODE_EXPLICIT: {
+                tilingMode = mode;
                 unsetTiling();
+                break;
+            }
             case MODE_COPY_FROM_METADATA:
             case MODE_DISABLED:
-            case MODE_DEFAULT:
+            case MODE_DEFAULT: {
                 tilingMode = mode;
                 break;
+            }
             default: {
                 throw new IllegalArgumentException("Illegal value for mode!");
             }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/imageio/src/main/java/org/apache/harmony/x/imageio/plugins/jpeg/JPEGConsts.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/imageio/src/main/java/org/apache/harmony/x/imageio/plugins/jpeg/JPEGConsts.java?view=diff&rev=475729&r1=475728&r2=475729
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/imageio/src/main/java/org/apache/harmony/x/imageio/plugins/jpeg/JPEGConsts.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/imageio/src/main/java/org/apache/harmony/x/imageio/plugins/jpeg/JPEGConsts.java
Thu Nov 16 05:38:27 2006
@@ -39,4 +39,6 @@
     public static final int JCS_YCCK = 11;
 
     public static int[][] BAND_OFFSETS = {{}, {0}, {0, 1}, {0, 1, 2}, {0, 1, 2, 3}};
+
+    public static final float DEFAULT_JPEG_COMPRESSION_QUALITY = 0.75f;
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/imageio/src/main/java/org/apache/harmony/x/imageio/plugins/jpeg/JPEGImageReader.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/imageio/src/main/java/org/apache/harmony/x/imageio/plugins/jpeg/JPEGImageReader.java?view=diff&rev=475729&r1=475728&r2=475729
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/imageio/src/main/java/org/apache/harmony/x/imageio/plugins/jpeg/JPEGImageReader.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/imageio/src/main/java/org/apache/harmony/x/imageio/plugins/jpeg/JPEGImageReader.java
Thu Nov 16 05:38:27 2006
@@ -24,6 +24,7 @@
 import javax.imageio.ImageReader;
 import javax.imageio.ImageReadParam;
 import javax.imageio.ImageTypeSpecifier;
+import javax.imageio.plugins.jpeg.JPEGImageReadParam;
 import javax.imageio.stream.ImageInputStream;
 import javax.imageio.metadata.IIOMetadata;
 import javax.imageio.spi.ImageReaderSpi;
@@ -110,5 +111,10 @@
     public void setInput(Object input, boolean seekForwardOnly, boolean ignoreMetadata) {
         super.setInput(input, seekForwardOnly, ignoreMetadata);
         iis = (ImageInputStream) input;
+    }
+
+    @Override
+    public ImageReadParam getDefaultReadParam() {
+        return new JPEGImageReadParam();
     }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/imageio/src/main/java/org/apache/harmony/x/imageio/plugins/jpeg/JPEGImageWriter.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/imageio/src/main/java/org/apache/harmony/x/imageio/plugins/jpeg/JPEGImageWriter.java?view=diff&rev=475729&r1=475728&r2=475729
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/imageio/src/main/java/org/apache/harmony/x/imageio/plugins/jpeg/JPEGImageWriter.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/imageio/src/main/java/org/apache/harmony/x/imageio/plugins/jpeg/JPEGImageWriter.java
Thu Nov 16 05:38:27 2006
@@ -24,6 +24,7 @@
 import javax.imageio.IIOImage;
 import javax.imageio.ImageTypeSpecifier;
 import javax.imageio.ImageWriteParam;
+import javax.imageio.plugins.jpeg.JPEGImageWriteParam;
 import javax.imageio.stream.ImageOutputStream;
 import javax.imageio.spi.ImageWriterSpi;
 import javax.imageio.metadata.IIOMetadata;
@@ -327,5 +328,9 @@
             }
         }
         return type;
+    }
+
+    public ImageWriteParam getDefaultWriteParam() {
+        return new JPEGImageWriteParam(getLocale());
     }
 }



Mime
View raw message