Remove unneeded srcOffset arguments from createRgbBuffer.

This commit is contained in:
Nicholas Nethercote 2014-01-16 18:03:17 -08:00
parent 3de5d6ad0c
commit c044652320
2 changed files with 5 additions and 6 deletions

View File

@ -439,7 +439,7 @@ var PDFImage = (function PDFImageClosure() {
if (this.needsDecode) { if (this.needsDecode) {
this.decodeBuffer(comps); this.decodeBuffer(comps);
} }
var rgbBuf = this.colorSpace.createRgbBuffer(comps, 0, var rgbBuf = this.colorSpace.createRgbBuffer(comps,
originalWidth * originalHeight, bpc); originalWidth * originalHeight, bpc);
if (originalWidth != width || originalHeight != height) if (originalWidth != width || originalHeight != height)
rgbBuf = PDFImage.resize(rgbBuf, this.bpc, 3, originalWidth, rgbBuf = PDFImage.resize(rgbBuf, this.bpc, 3, originalWidth,

View File

@ -69,10 +69,9 @@ var ColorSpace = (function ColorSpaceClosure() {
* Creates the output buffer and converts the specified number of the color * Creates the output buffer and converts the specified number of the color
* values to the RGB colors, similar to the getRgbBuffer. * values to the RGB colors, similar to the getRgbBuffer.
*/ */
createRgbBuffer: function ColorSpace_createRgbBuffer(src, srcOffset, createRgbBuffer: function ColorSpace_createRgbBuffer(src, count, bits) {
count, bits) {
if (this.isPassthrough(bits)) { if (this.isPassthrough(bits)) {
return src.subarray(srcOffset); return src;
} }
var dest = new Uint8Array(count * 3); var dest = new Uint8Array(count * 3);
var numComponentColors = 1 << bits; var numComponentColors = 1 << bits;
@ -96,14 +95,14 @@ var ColorSpace = (function ColorSpaceClosure() {
var destOffset = 0; var destOffset = 0;
for (var i = 0; i < count; ++i) { for (var i = 0; i < count; ++i) {
var key = src[srcOffset++] * 3; var key = src[i] * 3;
dest[destOffset++] = colorMap[key]; dest[destOffset++] = colorMap[key];
dest[destOffset++] = colorMap[key + 1]; dest[destOffset++] = colorMap[key + 1];
dest[destOffset++] = colorMap[key + 2]; dest[destOffset++] = colorMap[key + 2];
} }
return dest; return dest;
} }
this.getRgbBuffer(src, srcOffset, count, dest, 0, bits); this.getRgbBuffer(src, 0, count, dest, 0, bits);
return dest; return dest;
}, },
/** /**