1 18 package org.apache.batik.ext.awt.image.codec; 19 20 import java.awt.image.ColorModel ; 21 import java.awt.image.Raster ; 22 import java.awt.image.RenderedImage ; 23 import java.io.IOException ; 24 import java.io.OutputStream ; 25 26 33 public abstract class ImageEncoderImpl implements ImageEncoder { 34 35 36 protected OutputStream output; 37 38 39 protected ImageEncodeParam param; 40 41 45 public ImageEncoderImpl(OutputStream output, 46 ImageEncodeParam param) { 47 this.output = output; 48 this.param = param; 49 } 50 51 58 public ImageEncodeParam getParam() { 59 return param; 60 } 61 62 70 public void setParam(ImageEncodeParam param) { 71 this.param = param; 72 } 73 74 75 public OutputStream getOutputStream() { 76 return output; 77 } 78 79 83 public void encode(Raster ras, ColorModel cm) throws IOException { 84 RenderedImage im = new SingleTileRenderedImage(ras, cm); 85 encode(im); 86 } 87 88 92 public abstract void encode(RenderedImage im) throws IOException ; 93 } 94 | Popular Tags |