You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xmlgraphics.apache.org by je...@apache.org on 2007/12/14 13:47:48 UTC

svn commit: r604181 - /xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/ImageEncodingHelper.java

Author: jeremias
Date: Fri Dec 14 04:47:47 2007
New Revision: 604181

URL: http://svn.apache.org/viewvc?rev=604181&view=rev
Log:
Expose more universally usable RGB image encoding method.

Modified:
    xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/ImageEncodingHelper.java

Modified: xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/ImageEncodingHelper.java
URL: http://svn.apache.org/viewvc/xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/ImageEncodingHelper.java?rev=604181&r1=604180&r2=604181&view=diff
==============================================================================
--- xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/ImageEncodingHelper.java (original)
+++ xmlgraphics/commons/trunk/src/java/org/apache/xmlgraphics/ps/ImageEncodingHelper.java Fri Dec 14 04:47:47 2007
@@ -97,6 +97,17 @@
     }
     
     private void writeRGBTo(OutputStream out) throws IOException {
+        encodeRenderedImageAsRGB(image, out);
+    }
+    
+    /**
+     * Writes a RenderedImage to an OutputStream by converting it to RGB.
+     * @param image the image
+     * @param out the OutputStream to write the pixels to
+     * @throws IOException if an I/O error occurs
+     */
+    public static void encodeRenderedImageAsRGB(RenderedImage image, OutputStream out)
+                throws IOException {
         Raster raster = image.getData();
         Object data;
         int nbands = raster.getNumBands();



---------------------------------------------------------------------
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