harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apavle...@apache.org
Subject svn commit: r648526 - /harmony/enhanced/classlib/trunk/modules/imageio/src/main/java/javax/imageio/ImageTypeSpecifier.java
Date Wed, 16 Apr 2008 05:31:39 GMT
Author: apavlenko
Date: Tue Apr 15 22:31:39 2008
New Revision: 648526

URL: http://svn.apache.org/viewvc?rev=648526&view=rev
Log:
Implemented 1 not implemented method

Modified:
    harmony/enhanced/classlib/trunk/modules/imageio/src/main/java/javax/imageio/ImageTypeSpecifier.java

Modified: harmony/enhanced/classlib/trunk/modules/imageio/src/main/java/javax/imageio/ImageTypeSpecifier.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/imageio/src/main/java/javax/imageio/ImageTypeSpecifier.java?rev=648526&r1=648525&r2=648526&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/imageio/src/main/java/javax/imageio/ImageTypeSpecifier.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/imageio/src/main/java/javax/imageio/ImageTypeSpecifier.java
Tue Apr 15 22:31:39 2008
@@ -21,6 +21,7 @@
 package javax.imageio;
 
 import java.awt.image.ColorModel;
+import java.awt.image.DirectColorModel;
 import java.awt.image.SampleModel;
 import java.awt.image.BufferedImage;
 import java.awt.image.RenderedImage;
@@ -28,9 +29,6 @@
 
 import org.apache.harmony.luni.util.NotImplementedException;
 
-/**
- * TODO implement all the methods
- */
 public class ImageTypeSpecifier {
     
     protected ColorModel colorModel;
@@ -59,15 +57,15 @@
         this.sampleModel = renderedImage.getSampleModel();
     }
 
-    public static ImageTypeSpecifier createPacked(ColorSpace colorSpace,
-                                                  int redMask,
-                                                  int greenMask,
-                                                  int blueMask,
-                                                  int alphaMask,
-                                                  int transferType,
-                                                  boolean isAlphaPremultiplied) throws NotImplementedException
{
-        // TODO: implement
-        throw new NotImplementedException();
+    public static ImageTypeSpecifier createPacked(final ColorSpace colorSpace,
+                    final int redMask, final int greenMask, final int blueMask,
+                    final int alphaMask, final int transferType,
+                    final boolean isAlphaPremultiplied) {
+        final ColorModel model = new DirectColorModel(colorSpace, 32, redMask,
+                        greenMask, blueMask, alphaMask, isAlphaPremultiplied,
+                        transferType);
+        return new ImageTypeSpecifier(model, model.createCompatibleSampleModel(
+            1, 1));
     }
 
     public static ImageTypeSpecifier createInterleaved(ColorSpace colorSpace,



Mime
View raw message