Add a before/after split with a draggable handle
The Develop preview can put the untouched source left of a drag line and the edited frame right of it. Both halves come from one render on one view, so they line up exactly, and the split shares its handle behaviour with the lens correction split. The headless render check now asserts that each half shows its own edit.
This commit is contained in:
@@ -379,6 +379,26 @@ try {
|
||||
const lensTintOn = pixelAt(0.625, 0.469);
|
||||
const lensTintOff = pixelAt(0.7, 0.469);
|
||||
|
||||
// Before / after split: the edit is drawn full-frame, then the untouched
|
||||
// source is painted over the left slice. Reading the same band either side of
|
||||
// the line must give the moved slider on the right and the default on the
|
||||
// left, which is what proves the scissor lands where the drag line sits.
|
||||
const splitAfter = defaultEdits();
|
||||
splitAfter.exposure = 2;
|
||||
renderer.render(splitAfter, { width: w, height: h });
|
||||
const splitAfterFull = pixelAt(0.75, 0.5);
|
||||
renderer.render(defaultEdits(), { width: w, height: h });
|
||||
const splitBeforeFull = pixelAt(0.75, 0.5);
|
||||
renderer.render(splitAfter, { width: w, height: h });
|
||||
renderer.render(defaultEdits(), {
|
||||
width: w,
|
||||
height: h,
|
||||
scissor: { x: 0, w: Math.round(w / 2) },
|
||||
});
|
||||
const splitLeft = pixelAt(0.25, 0.5);
|
||||
const splitRight = pixelAt(0.75, 0.5);
|
||||
const sameRgb = (a, b) => a.every((v, i) => Math.abs(v - b[i]) <= 1);
|
||||
|
||||
pre.textContent = 'RESULT ' + JSON.stringify({
|
||||
clipPixels,
|
||||
clipRed: near(clipPixels[0], RED_MARK),
|
||||
@@ -437,6 +457,14 @@ try {
|
||||
cropDetailBounded: Math.abs(cropDetailOff[2] - cropRefOff[2]) <= 3,
|
||||
lensTintAligned: lensTintOn[0] > lensRef[0] + 40,
|
||||
lensTintBounded: Math.abs(lensTintOff[0] - lensRefOff[0]) <= 2,
|
||||
splitLeft,
|
||||
splitRight,
|
||||
splitBeforeFull,
|
||||
splitAfterFull,
|
||||
splitShowsBoth:
|
||||
sameRgb(splitLeft, splitBeforeFull) &&
|
||||
sameRgb(splitRight, splitAfterFull) &&
|
||||
!sameRgb(splitAfterFull, splitBeforeFull),
|
||||
tintStrengthWorks: tintFull[2] > tintCore[2] + 8,
|
||||
tintOffMatches: Math.abs(tintOffPixel[2] - dabSoft[2]) <= 1,
|
||||
// A hard dab covers the core, and even an 80 % feather stops at the rim.
|
||||
@@ -702,6 +730,14 @@ async function main() {
|
||||
);
|
||||
return 1;
|
||||
}
|
||||
if (!result.splitShowsBoth) {
|
||||
console.error(
|
||||
'render check FAILED: the before / after split does not follow its drag line ' +
|
||||
`(left=${JSON.stringify(result.splitLeft)} vs ${JSON.stringify(result.splitBeforeFull)}, ` +
|
||||
`right=${JSON.stringify(result.splitRight)} vs ${JSON.stringify(result.splitAfterFull)}).`,
|
||||
);
|
||||
return 1;
|
||||
}
|
||||
if (
|
||||
!result.dabCoreDarkened ||
|
||||
!result.dabSoftCoreDarkened ||
|
||||
@@ -722,7 +758,11 @@ async function main() {
|
||||
return 1;
|
||||
}
|
||||
console.log(
|
||||
'render check PASSED: proxy and sidecar share a row order and the clipping overlay names the channels.',
|
||||
`render check: before / after split left=${JSON.stringify(result.splitLeft)}` +
|
||||
` right=${JSON.stringify(result.splitRight)}`,
|
||||
);
|
||||
console.log(
|
||||
'render check PASSED: proxy and sidecar share a row order, the clipping overlay names the channels, and the split keeps each side to its own edit.',
|
||||
);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user