1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 10:08:06 +02:00

Refactors getRgb and makeCssRgb calls; reduces amount of created objects

This commit is contained in:
Yury Delendik 2012-11-28 19:32:27 -06:00
parent d4270c7fb3
commit 0029b34d45
5 changed files with 281 additions and 196 deletions

View file

@ -396,8 +396,8 @@ var PDFImage = (function PDFImageClosure() {
var actualHeight = 0 | (imgArray.length / rowBytes *
height / originalHeight);
var comps = this.colorSpace.getRgbBuffer(
this.getComponents(imgArray), bpc);
var comps = this.colorSpace.createRgbBuffer(this.getComponents(imgArray),
0, originalWidth * originalHeight, bpc);
if (originalWidth != width || originalHeight != height)
comps = PDFImage.resize(comps, this.bpc, 3, originalWidth,
originalHeight, width, height);