this.codeSize = 0;
this.codeBuf = 0;
- this.bufferPos = 0;
+ this.pos = 0;
this.bufferLength = 0;
}
},
getByte: function() {
var bufferLength = this.bufferLength;
- var bufferPos = this.bufferPos;
- if (bufferLength == bufferPos) {
+ var pos = this.pos;
+ if (bufferLength == pos) {
if (this.eof)
return;
this.readBlock();
}
- return this.buffer[this.bufferPos++];
+ return this.buffer[this.pos++];
},
getBytes: function(length) {
- var pos = this.bufferPos;
+ var pos = this.pos;
while (!this.eof && this.bufferLength < pos + length)
this.readBlock();
if (end > bufEnd)
end = bufEnd;
- this.bufferPos = end;
+ this.pos = end;
return this.buffer.subarray(pos, end)
},
lookChar: function() {
var bufferLength = this.bufferLength;
- var bufferPos = this.bufferPos;
- if (bufferLength == bufferPos) {
+ var pos = this.pos;
+ if (bufferLength == pos) {
if (this.eof)
return;
this.readBlock();
}
- return String.fromCharCode(this.buffer[bufferPos]);
+ return String.fromCharCode(this.buffer[pos]);
},
getChar: function() {
var ch = this.lookChar();
if (!ch)
return;
- this.bufferPos++;
+ this.pos++;
return ch;
},
skip: function(n) {
var length = 4 * w * h;
switch (numComps) {
case 1:
- for (var i = 0; i < length; i+=4) {
+ for (var i = 0; i < length; i += 4) {
var p = imgArray[imageIdx++];
pixels[i] = p;
pixels[i+1] = p;
}
break;
case 3:
- for (var i = 0; i < length; i+=4) {
+ for (var i = 0; i < length; i += 4) {
pixels[i] = imgArray[imgIdx++];
pixels[i+1] = imgArray[imgIdx++];
pixels[i+2] = imgArray[imgIdx++];
var length = 4 * w * h;
switch (numComps) {
case 1:
- for (var i = 0; i < length; i+=4) {
+ for (var i = 0; i < length; i += 4) {
var p = imgArray[imageIdx++];
pixels[i] = p;
pixels[i+1] = p;
}
break;
case 3:
- for (var i = 0; i < length; i+=4) {
+ for (var i = 0; i < length; i += 4) {
pixels[i] = imgArray[imgIdx++];
pixels[i+1] = imgArray[imgIdx++];
pixels[i+2] = imgArray[imgIdx++];