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