MCPcopy Create free account
hub / github.com/devforth/painterro / applyFilter

Method applyFilter

js/filters.js:73–88  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

71 }
72
73 applyFilter() {
74 const w = this.main.size.w;
75 const h = this.main.size.h;
76 const tmpData = this.initCtxImageData;
77 const tmpCan = this.main.doc.createElement('canvas');
78 tmpCan.width = w;
79 tmpCan.height = h;
80 tmpCan.getContext('2d').putImageData(tmpData, 0, 0);
81 this.main.ctx.save();
82 this.main.ctx.filter = this.createFilterString();
83 this.main.ctx.drawImage(tmpCan, 0, 0);
84 // this.adjustSizeFull();
85 // this.ctx.restore();
86 this.main.worklog.captureState();
87 // this.main.closeActiveTool();
88 }
89
90 saveInitImg() {
91 this.initCtxImageData = this.main.ctx.getImageData(0, 0, this.main.size.w, this.main.size.h);

Callers 1

constructorMethod · 0.80

Calls 3

createFilterStringMethod · 0.95
saveMethod · 0.80
captureStateMethod · 0.80

Tested by

no test coverage detected