1 50 51 package com.lowagie.text; 52 53 import java.net.URL ; 54 55 63 64 public class ImgRaw extends Image { 65 66 ImgRaw(Image image) { 67 super(image); 68 } 69 70 79 80 public ImgRaw(int width, int height, int components, int bpc, byte[] data) throws BadElementException{ 81 super((URL )null); 82 type = IMGRAW; 83 scaledHeight = height; 84 setTop(scaledHeight); 85 scaledWidth = width; 86 setRight(scaledWidth); 87 if (components != 1 && components != 3 && components != 4) 88 throw new BadElementException("Components must be 1, 3, or 4."); 89 if (bpc != 1 && bpc != 2 && bpc != 4 && bpc != 8) 90 throw new BadElementException("Bits-per-component must be 1, 2, 4, or 8."); 91 colorspace = components; 92 this.bpc = bpc; 93 rawData = data; 94 plainWidth = getWidth(); 95 plainHeight = getHeight(); 96 } 97 } | Popular Tags |