P.cleanOutput = function () {
this.dirtyOutput = false;
const {sourceImageData, columns, rows, struts, boundingBox} = this;
const sourceDimension = _ceil(this.sourceDimension);
if (sourceImageData && rows - 1 > 0) {
let [startX, startY, outputWidth, outputHeight] = boundingBox;
outputWidth = ~~(startX + outputWidth);
outputHeight = ~~(startY + outputHeight);
const inputCell = requestCell(),
inputEngine = inputCell.engine,
inputCanvas = inputCell.element;
inputCanvas.width = sourceDimension;
inputCanvas.height = sourceDimension;
inputEngine.resetTransform();
inputEngine.putImageData(sourceImageData, 0, 0);
const outputCell = requestCell(),
outputEngine = outputCell.engine,
outputCanvas = outputCell.element;
outputCanvas.width = outputWidth;
outputCanvas.height = outputHeight;
outputEngine.globalAlpha = this.state.globalAlpha;
outputEngine.resetTransform();
const inputStrutHeight = parseFloat((sourceDimension / (rows - 1)).toFixed(4)),
inputStrutWidth = parseFloat((sourceDimension / (columns - 1)).toFixed(4));
let topStruts, baseStruts,
maxLen, iStep, xtStep, ytStep, xbStep, ybStep, tx, ty, bx, by, sx, sy,
xLen, yLen, stripLength, stripAngle,
c, cz, r, rz, i;
for (r = 0, rz = rows - 1; r < rz; r++) {
topStruts = struts[r];
baseStruts = struts[r + 1];
for (c = 0, cz = columns - 1; c < cz; c++) {
let [ltx, lty, rtx, rty, tLen] = topStruts[c];
let [lbx, lby, rbx, rby, bLen] = baseStruts[c];
tLen *= sourceDimension;
bLen *= sourceDimension;
maxLen = _max(tLen, bLen, inputStrutWidth);
iStep = inputStrutWidth / maxLen;
xtStep = (rtx - ltx) / maxLen;
ytStep = (rty - lty) / maxLen;
xbStep = (rbx - lbx) / maxLen;
ybStep = (rby - lby) / maxLen;
for (i = 0; i < maxLen; i++) {
tx = ltx + (xtStep * i);
ty = lty + (ytStep * i);
bx = lbx + (xbStep * i);
by = lby + (ybStep * i);
sy = r * inputStrutHeight;
sx = (c * inputStrutWidth) + (iStep * i);
xLen = tx - bx;
yLen = ty - by;
stripLength = _sqrt((xLen * xLen) + (yLen * yLen));
stripAngle = _atan2(yLen, xLen) + _piHalf;
outputEngine.setTransform(1, 0, 0, 1, tx, ty);
outputEngine.rotate(stripAngle);