xmlgraphics-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject svn commit: r496576 - /xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/rendered/RenderedImageCachableRed.java
Date Tue, 16 Jan 2007 02:36:00 GMT
Author: cam
Date: Mon Jan 15 18:35:59 2007
New Revision: 496576

URL: http://svn.apache.org/viewvc?view=rev&rev=496576
Log:
Added method missing from RenderedImageCachableRed that Batik needs.

Modified:
    xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/rendered/RenderedImageCachableRed.java

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/rendered/RenderedImageCachableRed.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/rendered/RenderedImageCachableRed.java?view=diff&rev=496576&r1=496575&r2=496576
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/rendered/RenderedImageCachableRed.java
(original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/image/rendered/RenderedImageCachableRed.java
Mon Jan 15 18:35:59 2007
@@ -21,6 +21,7 @@
 
 import java.awt.Rectangle;
 import java.awt.Shape;
+import java.awt.image.BufferedImage;
 import java.awt.image.ColorModel;
 import java.awt.image.Raster;
 import java.awt.image.RenderedImage;
@@ -38,6 +39,14 @@
  * @version $Id$
  */
 public class RenderedImageCachableRed implements CachableRed {
+
+    public static CachableRed wrap(RenderedImage ri) {
+        if (ri instanceof CachableRed)
+            return (CachableRed) ri;
+        if (ri instanceof BufferedImage)
+            return new BufferedImageCachableRed((BufferedImage)ri);
+        return new RenderedImageCachableRed(ri);
+    }
 
     private RenderedImage src;
     private Vector srcs = new Vector(0);



---------------------------------------------------------------------
Apache XML Graphics Project URL: http://xmlgraphics.apache.org/
To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: commits-help@xmlgraphics.apache.org


Mime
View raw message