interpolated functions

This commit is contained in:
sbarman 2011-07-11 14:09:16 -07:00
parent e95512e7cf
commit dc913b989d

22
pdf.js
View File

@ -5365,9 +5365,25 @@ var PDFFunction = (function() {
} }
return array; return array;
}, },
constructInterpolated: function() { constructInterpolated: function(str, dict) {
TODO('unhandled type of function'); var c0 = dict.get('C0') || [0];
this.func = function () { return [ 255, 105, 180 ]; } var c1 = dict.get('C1') || [1];
var n = dict.get('N');
var length = c0.length;
var diff = [];
for (var i = 0; i < length; ++i)
diff.push(c1[i] - c0[i]);
this.func = function (args) {
var x = args[0];
var out = [];
for (var j = 0; j < length; ++j)
out.push(c0[j] + (x^n * diff[i]));
return out;
}
}, },
constructStiched: function() { constructStiched: function() {
TODO('unhandled type of function'); TODO('unhandled type of function');