public void decode(LEDataInputStream inputStream, ImageLoader loader, ImageData image, boolean interlaced, int depth) { this.inputStream = inputStream; this.loader = loader; this.image = image; this.interlaced = interlaced; this.bitsPerPixel = depth; initializeForDecoding(); decode();
void decode() { int code; int oc = 0; int fc = 0; byte[] buf = new byte[imageWidth]; int stackIndex = 0; int bufIndex = 0; int c; while ((c = nextCode()) != endCode) { if (c == clearCode) { codeSize = bitsPerPixel + 1; codeMask = MASK_TABLE[bitsPerPixel]; currentSlot = newCodes; topSlot = 1 << codeSize; while ((c = nextCode()) == clearCode) {} if (c != endCode) { oc = fc = c; buf[bufIndex] = (byte)c; bufIndex++; if (bufIndex == imageWidth) { nextPutPixels(buf); bufIndex = 0; } } } else { code = c; if (code >= currentSlot) { if (code > currentSlot) SWT.error(SWT.ERROR_INVALID_IMAGE); code = oc; stack[stackIndex] = fc; stackIndex++; } while (code >= newCodes) { stack[stackIndex] = suffix[code]; stackIndex++; code = prefix[code]; } stack[stackIndex] = code; stackIndex++; if (currentSlot < topSlot) { fc = code; suffix[currentSlot] = fc; prefix[currentSlot] = oc; currentSlot++; oc = c; } if (currentSlot >= topSlot) { if (codeSize < 12) { codeMask = MASK_TABLE[codeSize]; codeSize++; topSlot = topSlot + topSlot; } } while (stackIndex > 0) { stackIndex--; buf[bufIndex] = (byte)stack[stackIndex]; bufIndex++; if (bufIndex == imageWidth) { nextPutPixels(buf); bufIndex = 0; } } } } if (bufIndex != 0 && line < imageHeight) { nextPutPixels(buf); }
public void decode(LEDataInputStream inputStream, ImageLoader loader, ImageData image, boolean interlaced, int depth) {	this.inputStream = inputStream;	this.loader = loader;	this.image = image;	this.interlaced = interlaced;	this.bitsPerPixel = depth;	initializeForDecoding();	decode();}