1 17 18 19 20 package org.apache.fop.pdf; 21 22 import java.io.IOException ; 23 import java.io.OutputStream ; 24 26 31 public class BitmapImage implements PDFImage { 32 private int height; 33 private int width; 34 private int bitsPerPixel; 35 private PDFDeviceColorSpace colorSpace; 36 private byte[] bitmaps; 37 private String maskRef; 38 private PDFColor transparent = null; 39 private String key; 40 private PDFDocument pdfDoc; 41 42 52 public BitmapImage(String k, int width, int height, byte[] data, 53 String mask) { 54 this.key = k; 55 this.height = height; 56 this.width = width; 57 this.bitsPerPixel = 8; 58 this.colorSpace = new PDFDeviceColorSpace(PDFDeviceColorSpace.DEVICE_RGB); 59 this.bitmaps = data; 60 maskRef = mask; 61 } 62 63 68 public void setup(PDFDocument doc) { 69 this.pdfDoc = doc; 70 } 71 72 80 public String getKey() { 81 return key; 82 } 83 84 89 public int getWidth() { 90 return width; 91 } 92 93 98 public int getHeight() { 99 return height; 100 } 101 102 107 public void setColorSpace(PDFDeviceColorSpace cs) { 108 colorSpace = cs; 109 } 110 111 117 public PDFDeviceColorSpace getColorSpace() { 118 return colorSpace; 119 } 120 121 126 public int getBitsPerPixel() { 127 return bitsPerPixel; 128 } 129 130 135 public void setTransparent(PDFColor t) { 136 transparent = t; 137 } 138 139 144 public boolean isTransparent() { 145 return transparent != null; 146 } 147 148 153 public PDFColor getTransparentColor() { 154 return transparent; 155 } 156 157 163 public String getMask() { 164 return null; 165 } 166 167 172 public String getSoftMask() { 173 return maskRef; 174 } 175 176 177 public boolean isInverted() { 178 return false; 179 } 180 181 184 public void outputContents(OutputStream out) throws IOException { 185 out.write(bitmaps); 186 } 187 188 192 public PDFICCStream getICCStream() { 193 return null; 194 } 195 196 200 public boolean isPS() { 201 return false; 202 } 203 204 207 public String getFilterHint() { 208 return PDFFilterList.IMAGE_FILTER; 209 } 210 211 214 public PDFFilter getPDFFilter() { 215 return null; 216 } 217 218 } 219 220 221 | Popular Tags |