public GIFColorTable(LEDataInputStream in, int numBitsColorTable) throws IOException {
    int i;

    int numColors = 1 << numBitsColorTable;

    red = new byte[numColors];
    green = new byte[numColors];
    blue = new byte[numColors];

    for (i = 0; i < numColors; ++i) {
      red[i] = in.readByte();
      green[i] = in.readByte();
      blue[i] = in.readByte();
    }
  }
Exemplo n.º 2
0
 /*    */ public GIFFileHeader(LEDataInputStream paramLEDataInputStream)
     /*    */ throws JimiException, IOException
       /*    */ {
   /* 54 */ this.sig[0] = paramLEDataInputStream.readByte();
   /* 55 */ this.sig[1] = paramLEDataInputStream.readByte();
   /* 56 */ this.sig[2] = paramLEDataInputStream.readByte();
   /*    */
   /* 58 */ if ((this.sig[0] != 71) || (this.sig[1] != 73) || (this.sig[2] != 70)) {
     /* 59 */ throw new JimiException("Not a GIF");
     /*    */ }
   /* 61 */ this.ver[0] = paramLEDataInputStream.readByte();
   /* 62 */ this.ver[1] = paramLEDataInputStream.readByte();
   /* 63 */ this.ver[2] = paramLEDataInputStream.readByte();
   /*    */
   /* 65 */ if ((this.ver[0] != 56)
       || ((this.ver[1] != 55) && (this.ver[1] != 57))
       || (this.ver[2] != 97)) {
     /* 66 */ throw new JimiException("Unknown GIF version");
     /*    */ }
   /* 68 */ this.screenWidth = paramLEDataInputStream.readUnsignedShort();
   /* 69 */ this.screenHeight = paramLEDataInputStream.readUnsignedShort();
   /* 70 */ this.packed = paramLEDataInputStream.readByte();
   /*    */
   /* 72 */ this.backgroundColor = paramLEDataInputStream.readByte();
   /* 73 */ this.aspectRatio = paramLEDataInputStream.readByte();
   /*    */
   /* 76 */ this.colorTableNumBits = ((this.packed & 0x7) + 1);
   /*    */
   /* 78 */ if ((this.packed & 0x80) != 0)
     /* 79 */ this.colorTable = new GIFColorTable(paramLEDataInputStream, this.colorTableNumBits);
   /*    */ else /* 81 */ this.colorTable = new GIFColorTable(this.colorTableNumBits);
   /*    */ }