Make ColorSpace Separation work as long as no IR form is needed for now
This commit is contained in:
parent
fea3388c41
commit
4e3f87b60c
21
pdf.js
21
pdf.js
@ -5596,8 +5596,12 @@ var ColorSpace = (function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
constructor.parse = function colorspace_parse(cs, xref, res) {
|
constructor.parse = function colorspace_parse(cs, xref, res) {
|
||||||
var IR = constructor.parseToIR(cs, xref, res);
|
var IR = constructor.parseToIR(cs, xref, res, true);
|
||||||
|
if (!(IR instanceof SeparationCS)) {
|
||||||
return constructor.fromIR(IR);
|
return constructor.fromIR(IR);
|
||||||
|
} else {
|
||||||
|
return IR
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
constructor.fromIR = function(raw) {
|
constructor.fromIR = function(raw) {
|
||||||
@ -5633,7 +5637,7 @@ var ColorSpace = (function() {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor.parseToIR = function colorspace_parse(cs, xref, res) {
|
constructor.parseToIR = function colorspace_parse(cs, xref, res, parseOnly) {
|
||||||
if (IsName(cs)) {
|
if (IsName(cs)) {
|
||||||
var colorSpaces = res.get('ColorSpace');
|
var colorSpaces = res.get('ColorSpace');
|
||||||
if (IsDict(colorSpaces)) {
|
if (IsDict(colorSpaces)) {
|
||||||
@ -5704,12 +5708,14 @@ var ColorSpace = (function() {
|
|||||||
var lookup = xref.fetchIfRef(cs[3]);
|
var lookup = xref.fetchIfRef(cs[3]);
|
||||||
return ["IndexedCS", baseCS, hiVal, lookup];
|
return ["IndexedCS", baseCS, hiVal, lookup];
|
||||||
case 'Separation':
|
case 'Separation':
|
||||||
|
if (!parseOnly) {
|
||||||
error("Need to implement IR form for SeparationCS");
|
error("Need to implement IR form for SeparationCS");
|
||||||
|
} else {
|
||||||
// var name = cs[1];
|
var name = cs[1];
|
||||||
// var alt = ColorSpace.parse(cs[2], xref, res);
|
var alt = ColorSpace.parse(cs[2], xref, res);
|
||||||
// var tintFn = new PDFFunction(xref, xref.fetchIfRef(cs[3]));
|
var tintFn = new PDFFunction(xref, xref.fetchIfRef(cs[3]));
|
||||||
// return new SeparationCS(alt, tintFn);
|
return new SeparationCS(alt, tintFn);
|
||||||
|
}
|
||||||
case 'Lab':
|
case 'Lab':
|
||||||
case 'DeviceN':
|
case 'DeviceN':
|
||||||
default:
|
default:
|
||||||
@ -5756,7 +5762,6 @@ var SeparationCS = (function() {
|
|||||||
baseBuf[pos++] = 255 * tinted[j];
|
baseBuf[pos++] = 255 * tinted[j];
|
||||||
}
|
}
|
||||||
return base.getRgbBuffer(baseBuf, 8);
|
return base.getRgbBuffer(baseBuf, 8);
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user