Second stage, smasks now working. Still needs optimization.

This commit is contained in:
Brendan Dahl 2011-12-08 12:50:34 -08:00
parent 2a632d4ab2
commit 146cd8c861
4 changed files with 88 additions and 101 deletions

View file

@ -1036,28 +1036,6 @@ var CanvasGraphics = (function canvasGraphics() {
this.restore();
},
paintJpegXObject: function canvasGraphicsPaintJpegXObject(objId, w, h) {
var image = this.objs.get(objId);
debugger;
if (!image) {
error('Dependent image isn\'t ready yet');
}
this.paintNormalImageXObject(image);
/*
this.save();
var ctx = this.ctx;
// scale the image to the unit square
ctx.scale(1 / w, -1 / h);
ctx.drawImage(image.data, 0, 0, image.width, image.height,
0, -h, w, h);
this.restore(); */
},
paintImageMaskXObject: function canvasGraphicsPaintImageMaskXObject(
imgArray, inverseDecode, width, height) {
function applyStencilMask(buffer, inverseDecode) {
@ -1107,7 +1085,11 @@ var CanvasGraphics = (function canvasGraphics() {
this.restore();
},
paintNormalImageXObject: function canvasGraphicsPaintImageXObject(imgData) {
paintImageXObject: function canvasGraphicsPaintImageXObject(objId) {
var imgData = this.objs.get(objId);
if (!imgData) {
error('Dependent image isn\'t ready yet');
}
this.save();
var ctx = this.ctx;
var w = imgData.width;
@ -1137,21 +1119,6 @@ var CanvasGraphics = (function canvasGraphics() {
this.restore();
},
paintImageXObject: function canvasGraphicsPaintImageXObject(type, data) {
debugger;
switch(type) {
case 'jpeg':
this.paintJpegXObject.apply(this, data);
break;
case 'imageMask':
this.paintImageMaskXObject.apply(this, data);
break;
default:
this.paintNormalImageXObject.apply(this, data);
break;
}
},
// Marked content
markPoint: function canvasGraphicsMarkPoint(tag) {