commit
03c779a2e5
@ -541,8 +541,7 @@ var CanvasGraphics = (function canvasGraphics() {
|
||||
},
|
||||
|
||||
// Color
|
||||
setStrokeColorSpace:
|
||||
function canvasGraphicsSetStrokeColorSpacefunction(raw) {
|
||||
setStrokeColorSpace: function canvasGraphicsSetStrokeColorSpace(raw) {
|
||||
this.current.strokeColorSpace = ColorSpace.fromIR(raw);
|
||||
},
|
||||
setFillColorSpace: function canvasGraphicsSetFillColorSpace(raw) {
|
||||
@ -553,7 +552,7 @@ var CanvasGraphics = (function canvasGraphics() {
|
||||
var color = cs.getRgb(arguments);
|
||||
this.setStrokeRGBColor.apply(this, color);
|
||||
},
|
||||
getColorN_IR_Pattern: function(IR, cs) {
|
||||
getColorN_IR_Pattern: function canvasGraphicsGetColorN_IR_Pattern(IR, cs) {
|
||||
if (IR[0] == 'TilingPattern') {
|
||||
var args = IR[1];
|
||||
var base = cs.base;
|
||||
@ -669,8 +668,8 @@ var CanvasGraphics = (function canvasGraphics() {
|
||||
error('Should not call beginImageData');
|
||||
},
|
||||
|
||||
paintFormXObjectBegin:
|
||||
function canvasGraphicsPaintFormXObject(matrix, bbox) {
|
||||
paintFormXObjectBegin: function canvasGraphicsPaintFormXObjectBegin(matrix,
|
||||
bbox) {
|
||||
this.save();
|
||||
|
||||
if (matrix && isArray(matrix) && 6 == matrix.length)
|
||||
@ -685,11 +684,11 @@ var CanvasGraphics = (function canvasGraphics() {
|
||||
}
|
||||
},
|
||||
|
||||
paintFormXObjectEnd: function() {
|
||||
paintFormXObjectEnd: function canvasGraphicsPaintFormXObjectEnd() {
|
||||
this.restore();
|
||||
},
|
||||
|
||||
paintJpegXObject: function(objId, w, h) {
|
||||
paintJpegXObject: function canvasGraphicsPaintJpegXObject(objId, w, h) {
|
||||
var image = this.objs.get(objId);
|
||||
if (!image) {
|
||||
error('Dependent image isn\'t ready yet');
|
||||
@ -708,7 +707,8 @@ var CanvasGraphics = (function canvasGraphics() {
|
||||
this.restore();
|
||||
},
|
||||
|
||||
paintImageMaskXObject: function(imgArray, inverseDecode, width, height) {
|
||||
paintImageMaskXObject: function canvasGraphicsPaintImageMaskXObject(
|
||||
imgArray, inverseDecode, width, height) {
|
||||
function applyStencilMask(buffer, inverseDecode) {
|
||||
var imgArrayPos = 0;
|
||||
var i, j, mask, buf;
|
||||
@ -756,7 +756,7 @@ var CanvasGraphics = (function canvasGraphics() {
|
||||
this.restore();
|
||||
},
|
||||
|
||||
paintImageXObject: function(imgData) {
|
||||
paintImageXObject: function canvasGraphicsPaintImageXObject(imgData) {
|
||||
this.save();
|
||||
var ctx = this.ctx;
|
||||
var w = imgData.width;
|
||||
|
@ -12,17 +12,17 @@ var ColorSpace = (function colorSpaceColorSpace() {
|
||||
constructor.prototype = {
|
||||
// Input: array of size numComps representing color component values
|
||||
// Output: array of rgb values, each value ranging from [0.1]
|
||||
getRgb: function cs_getRgb(color) {
|
||||
getRgb: function colorSpaceGetRgb(color) {
|
||||
error('Should not call ColorSpace.getRgb: ' + color);
|
||||
},
|
||||
// Input: Uint8Array of component values, each value scaled to [0,255]
|
||||
// Output: Uint8Array of rgb values, each value scaled to [0,255]
|
||||
getRgbBuffer: function cs_getRgbBuffer(input) {
|
||||
getRgbBuffer: function colorSpaceGetRgbBuffer(input) {
|
||||
error('Should not call ColorSpace.getRgbBuffer: ' + input);
|
||||
}
|
||||
};
|
||||
|
||||
constructor.parse = function colorspace_parse(cs, xref, res) {
|
||||
constructor.parse = function colorSpaceParse(cs, xref, res) {
|
||||
var IR = constructor.parseToIR(cs, xref, res, true);
|
||||
if (IR instanceof SeparationCS)
|
||||
return IR;
|
||||
@ -30,7 +30,7 @@ var ColorSpace = (function colorSpaceColorSpace() {
|
||||
return constructor.fromIR(IR);
|
||||
};
|
||||
|
||||
constructor.fromIR = function(IR) {
|
||||
constructor.fromIR = function colorSpaceFromIR(IR) {
|
||||
var name;
|
||||
if (isArray(IR)) {
|
||||
name = IR[0];
|
||||
@ -71,7 +71,8 @@ var ColorSpace = (function colorSpaceColorSpace() {
|
||||
return null;
|
||||
}
|
||||
|
||||
constructor.parseToIR = function colorspace_parse(cs, xref, res, parseOnly) {
|
||||
constructor.parseToIR = function colorSpaceParseToIR(cs, xref, res,
|
||||
parseOnly) {
|
||||
if (isName(cs)) {
|
||||
var colorSpaces = xref.fetchIfRef(res.get('ColorSpace'));
|
||||
if (isDict(colorSpaces)) {
|
||||
|
@ -229,12 +229,12 @@ var PDFImage = (function pdfImage() {
|
||||
return constructor;
|
||||
})();
|
||||
|
||||
var JpegImage = (function() {
|
||||
var JpegImage = (function jpegImage() {
|
||||
function JpegImage(objId, imageData, objs) {
|
||||
var src = 'data:image/jpeg;base64,' + window.btoa(imageData);
|
||||
|
||||
var img = new Image();
|
||||
img.onload = (function() {
|
||||
img.onload = (function jpegImageOnload() {
|
||||
this.loaded = true;
|
||||
|
||||
objs.resolve(objId, this);
|
||||
@ -247,7 +247,7 @@ var JpegImage = (function() {
|
||||
}
|
||||
|
||||
JpegImage.prototype = {
|
||||
getImage: function() {
|
||||
getImage: function jpegImageGetImage() {
|
||||
return this.domImage;
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user