Show the clipping overlay's per-channel colours and follow the sliders.

The overlay had been collapsed to a single highlight bit, so every warning was
white. It now reads the finished frame per channel again: red for one clipped
channel, yellow for two, white for all three, and it updates as Exposure or
Recovery moves, which is what holding Ctrl is for. The render check renders the
overlay and asserts both the colours and that +6 EV turns a clear band white.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
2026-11-28 14:38:48 +00:00
parent fe9d2aff3f
commit a6491f6ef6
3 changed files with 32 additions and 29 deletions
+17 -1
View File
@@ -200,6 +200,12 @@ try {
Math.abs(pixel[2] - target[2]) < 14;
const RED_MARK = [255, 31, 31];
const YELLOW_MARK = [255, 230, 26];
// The preview has to follow the sliders it is shown for: +6 EV blows every
// channel of the unclipped band, so it must turn white, not stay clear.
const brightEdits = defaultEdits();
brightEdits.exposure = 6;
renderer.render(brightEdits, { width: w, height: h, clipPreview: true });
const brightPixel = sampleBand(2);
pre.textContent = 'RESULT ' + JSON.stringify({
clipPixels,
@@ -209,6 +215,8 @@ try {
!near(clipPixels[2], RED_MARK) &&
!near(clipPixels[2], YELLOW_MARK) &&
!near(clipPixels[2], [255, 255, 255]),
clipFollowsExposure: near(brightPixel, [255, 255, 255]),
brightPixel,
flagHonouredForBitmap: !same(proxyTop, proxyNoFlipTop),
proxyTop: +proxyTop.toFixed(4),
sidecarTop: +sideTop.toFixed(4),
@@ -353,7 +361,8 @@ async function main() {
console.log(
`render check: clipping overlay red=${JSON.stringify(result.clipPixels[0])}` +
` yellow=${JSON.stringify(result.clipPixels[1])}` +
` clear=${JSON.stringify(result.clipPixels[2])}`,
` clear=${JSON.stringify(result.clipPixels[2])}` +
` | at +6EV the clear band is ${JSON.stringify(result.brightPixel)}`,
);
if (!result.matchTop || !result.matchBottom) {
console.error(
@@ -370,6 +379,13 @@ async function main() {
);
return 1;
}
if (!result.clipFollowsExposure) {
console.error(
'render check FAILED: the clipping overlay does not follow Exposure; ' +
`the unclipped band stayed ${JSON.stringify(result.brightPixel)} at +6 EV.`,
);
return 1;
}
console.log(
'render check PASSED: proxy and sidecar share a row order and the clipping overlay names the channels.',
);