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:
parent
d4270c7fb3
commit
0029b34d45
5 changed files with 281 additions and 196 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue