/** * Pre-process the stream to make sure that the * image width and height are non-zero. Returns an array containing * the image width and height. */ public int[] preprocess(RandomAccessInputStream in) { return this.decoder.preprocess(in); }
/** * Pre-process the stream to make sure that the * image width and height are non-zero. Returns an array containing * the image width and height. */ public int[] preprocess(RandomAccessInputStream in) { return this.decoder.preprocess(in); }
public void initialize(RandomAccessInputStream in, int y, int h, int imageWidth) { this.in = in; tiles = new TileCache(y, h); preprocess(this.in); try { Toolkit toolkit = Toolkit.getDefaultToolkit(); byte[] data = new byte[this.in.available()]; this.in.readFully(data); Image image = toolkit.createImage(data); ImageProducer producer = image.getSource(); consumer = new TileConsumer(producer, y, h); producer.startProduction(consumer); while (producer.isConsumer(consumer)); } catch (IOException e) { } }