Mercurial > dive4elements > gnv-client
diff gnv-artifacts/src/main/java/de/intevation/gnv/raster/RasterToPPM.java @ 801:d766fe2d917a
More javadoc.
gnv-artifacts/trunk@883 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Tue, 06 Apr 2010 16:53:43 +0000 |
parents | c4156275c1e1 |
children | f953c9a559d8 |
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/raster/RasterToPPM.java Tue Apr 06 13:07:11 2010 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/raster/RasterToPPM.java Tue Apr 06 16:53:43 2010 +0000 @@ -6,6 +6,8 @@ import java.io.OutputStream; /** + * Little helper class to write a Raster into an output stream + * as a Netpbm PPM file. * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a> */ public class RasterToPPM @@ -13,7 +15,19 @@ private RasterToPPM() { } - public static void writeToPPM(Raster raster, Palette palette, OutputStream out) + /** + * Writes a Raster to a given stream as PPM. + * @param raster The raster to be written. + * @param palette The palette used to figure out the rgb values. + * @param out The stream to write into. + * @throws IOException Thrown if some error occurred during writing + * data to the output stream. + */ + public static void writeToPPM( + Raster raster, + Palette palette, + OutputStream out + ) throws IOException { int W = raster.getWidth();