mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 01:58:06 +02:00
Reduce unnecessary duplication of the isDefaultDecode
methods on ColorSpace
instances
The recent PR 10482 made me realize that I missed an opportunity for simplification when doing the class conversion of this code in PR 10007.
This commit is contained in:
parent
e2701d5422
commit
29f36d7a1b
2 changed files with 18 additions and 31 deletions
|
@ -171,7 +171,8 @@ var PDFImage = (function PDFImageClosure() {
|
|||
if (this.decode &&
|
||||
((this.colorSpace &&
|
||||
!this.colorSpace.isDefaultDecode(this.decode, bitsPerComponent)) ||
|
||||
(isMask && !ColorSpace.isDefaultDecode(this.decode, 1)))) {
|
||||
(isMask &&
|
||||
!ColorSpace.isDefaultDecode(this.decode, /* numComps = */ 1)))) {
|
||||
this.needsDecode = true;
|
||||
// Do some preprocessing to avoid more math.
|
||||
var max = (1 << bitsPerComponent) - 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue