home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1998 January / PCO0198.ISO / 1&1 / java.z / java_301 / sun / awt / image / PixelStore8.class (.txt) < prev    next >
Encoding:
Java Class File  |  1996-10-20  |  1.4 KB  |  31 lines

  1. package sun.awt.image;
  2.  
  3. import java.awt.image.ColorModel;
  4. import java.awt.image.ImageConsumer;
  5.  
  6. public class PixelStore8 extends PixelStore {
  7.    public PixelStore8() {
  8.    }
  9.  
  10.    public PixelStore8(int w, int h) {
  11.       super(w, h);
  12.    }
  13.  
  14.    public PixelStore8(int w, int h, ColorModel cm) {
  15.       this.setDimensions(w, h);
  16.       ((PixelStore)this).setColorModel(cm);
  17.    }
  18.  
  19.    public void setDimensions(int w, int h) {
  20.       super.setDimensions(w, h);
  21.    }
  22.  
  23.    Object allocateLines(int num) {
  24.       return num * super.width > 1000000 ? null : new byte[num * super.width];
  25.    }
  26.  
  27.    void replayLines(ImageConsumer ic, int i, int cnt, Object line) {
  28.       ic.setPixels(0, i, super.width, cnt, super.colormodel, (byte[])line, super.offsets[i], super.width);
  29.    }
  30. }
  31.