public int decode(RandomAccessInputStream bb) throws IOException { Decoder d = this; while (d.branch[0] != null) { int v = bb.readBits(1); if (v < 0) break; // eof d = d.branch[v]; } return d.leafValue; }
int v = bb.readBits(bitCount) & ((int) Math.pow(2, bitCount) - 1); if ((v & (1 << (bitCount - 1))) == 0) { v -= (1 << bitCount) - 1;
int pt = 0; while (pt < fourBits.length) { fourBits[pt++] = (byte) bb.readBits(4);
int pt = 0; while (pt < fourBits.length) { fourBits[pt++] = (byte) bb.readBits(4);
for (int i=0; i<w*effectiveC; i++) { if (bpp <= 8) { buf[rowIndex * w * effectiveC + i] = (byte) (in.readBits(bpp) & 0xff); (byte) (in.readBits(8) & 0xff); byte[] plane = new byte[getSizeX() * getSizeY() * getRGBChannelCount()]; while(!endOfFile) { byte firstByte = (byte) (in.readBits(bpp) & 0xff); byte secondByte = (byte) (in.readBits(bpp) & 0xff); if (firstByte == 0) { if (secondByte == 1) { byte xDelta = (byte) (in.readBits(bpp) & 0xff); byte yDelta = (byte) (in.readBits(bpp) & 0xff); index += (yDelta * rowLength) + xDelta; byte absoluteByte = (byte) (in.readBits(bpp) & 0xff); plane[index] = absoluteByte; index++; byte absoluteByte = (byte) (in.readBits(bpp) & 0xff); byte firstNibble = (byte)(absoluteByte & 0xf); byte secondNibble = (byte)((byte)(absoluteByte >> 4) & 0xf);
for (int i=0; i<w*effectiveC; i++) { if (bpp <= 8) { buf[rowIndex * w * effectiveC + i] = (byte) (in.readBits(bpp) & 0xff); (byte) (in.readBits(8) & 0xff); byte[] plane = new byte[getSizeX() * getSizeY() * getRGBChannelCount()]; while(!endOfFile) { byte firstByte = (byte) (in.readBits(bpp) & 0xff); byte secondByte = (byte) (in.readBits(bpp) & 0xff); if (firstByte == 0) { if (secondByte == 1) { byte xDelta = (byte) (in.readBits(bpp) & 0xff); byte yDelta = (byte) (in.readBits(bpp) & 0xff); index += (yDelta * rowLength) + xDelta; byte absoluteByte = (byte) (in.readBits(bpp) & 0xff); plane[index] = absoluteByte; index++; byte absoluteByte = (byte) (in.readBits(bpp) & 0xff); byte firstNibble = (byte)(absoluteByte & 0xf); byte secondNibble = (byte)((byte)(absoluteByte >> 4) & 0xf);
int realRow = row; for (int col=0; col<getSizeX(); col++) { short val = (short) (bb.readBits(dataSize) & 0xffff); int mapIndex = (realRow % 2) * 2 + (col % 2);
int realRow = row; for (int col=0; col<getSizeX(); col++) { short val = (short) (bb.readBits(dataSize) & 0xffff); int mapIndex = (realRow % 2) * 2 + (col % 2);
value = bb.readBits(bps0) & 0xffff;
value = bb.readBits(bps0) & 0xffff;
in.skipBits(bmpBitsPerPixel * x); for (int col=0; col<len; col++) { buf[(row - y) * len + col] = (byte) in.readBits(bmpBitsPerPixel);
in.skipBits(bmpBitsPerPixel * x); for (int col=0; col<len; col++) { buf[(row - y) * len + col] = (byte) in.readBits(bmpBitsPerPixel);
row * 2 : (row - (getSizeY() / 2)) * 2 + 1) : row; for (int col=0; col<getSizeX(); col++) { short val = (short) (bb.readBits(dataSize) & 0xffff); int mapIndex = (realRow % 2) * 2 + (col % 2);
row * 2 : (row - (getSizeY() / 2)) * 2 + 1) : row; for (int col=0; col<getSizeX(); col++) { short val = (short) (bb.readBits(dataSize) & 0xffff); int mapIndex = (realRow % 2) * 2 + (col % 2);
int colOffset = col * getSizeC() * bpp; for (int c=0; c<getSizeC(); c++) { int sample = in.readBits(bits); DataTools.unpackBytes(sample, buf, rowOffset + colOffset + c * bpp, bpp, isLittleEndian());
int colOffset = col * getSizeC() * bpp; for (int c=0; c<getSizeC(); c++) { int sample = in.readBits(bits); DataTools.unpackBytes(sample, buf, rowOffset + colOffset + c * bpp, bpp, isLittleEndian());
for (int col=0; col<getSizeX(); col++) { boolean evenCol = (col % 2) == 0; short val = (short) (in.readBits(dataSize) & 0xffff);
for (int col=0; col<getSizeX(); col++) { boolean evenCol = (col % 2) == 0; short val = (short) (in.readBits(dataSize) & 0xffff);
int index = row * getSizeX() + col; expandedImage[index] = (byte) (bits.readBits(getBitsPerPixel()) & 0xff);
int index = row * getSizeX() + col; expandedImage[index] = (byte) (bits.readBits(getBitsPerPixel()) & 0xff);