Merge: the formatter's pass over the raw histogram
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -595,7 +595,11 @@ mod tests {
|
||||
// the axis were inverted the histogram would still look like a
|
||||
// histogram, and every headroom judgement made from it would be
|
||||
// exactly backwards.
|
||||
assert_eq!(RawHistogram::stops(BINS - 1), 0.0, "the top bin is saturation");
|
||||
assert_eq!(
|
||||
RawHistogram::stops(BINS - 1),
|
||||
0.0,
|
||||
"the top bin is saturation"
|
||||
);
|
||||
assert_eq!(RawHistogram::stops(BINS - 1 - BINS_PER_STOP), 1.0);
|
||||
assert_eq!(RawHistogram::stops(BINS - 1 - 8 * BINS_PER_STOP), 8.0);
|
||||
// The floor is one bin short of `STOPS`, because bin 0 is the end of
|
||||
@@ -704,7 +708,11 @@ mod tests {
|
||||
);
|
||||
// Neutral, so the brightest channel must land on the same bin as
|
||||
// the three do.
|
||||
assert_eq!(hist.brightest()[bin], h, "the envelope drifted at bin {bin}");
|
||||
assert_eq!(
|
||||
hist.brightest()[bin],
|
||||
h,
|
||||
"the envelope drifted at bin {bin}"
|
||||
);
|
||||
}
|
||||
// Nothing below the ramp, so an off-by-one that spilled a pixel past
|
||||
// the end of it would show here rather than hiding in a bin the loop
|
||||
@@ -742,7 +750,11 @@ mod tests {
|
||||
let hist = pass.compute(&source(&ctx, &rgb, 4, 1)).expect("compute");
|
||||
|
||||
assert_eq!(hist.pixels(), 4);
|
||||
assert_eq!(hist.saturated(), 2, "two pixels have a channel at the ceiling");
|
||||
assert_eq!(
|
||||
hist.saturated(),
|
||||
2,
|
||||
"two pixels have a channel at the ceiling"
|
||||
);
|
||||
assert_eq!(hist.at_black(), 0);
|
||||
assert_eq!(hist.red()[BINS - 1], 2);
|
||||
|
||||
|
||||
@@ -599,7 +599,10 @@ mod tests {
|
||||
headroom_label(&brightest(&[(2 * per_stop, 100)]), 100),
|
||||
"2.0 stops of headroom"
|
||||
);
|
||||
assert_eq!(headroom_label(&brightest(&[(0, 100)]), 100), "no headroom left");
|
||||
assert_eq!(
|
||||
headroom_label(&brightest(&[(0, 100)]), 100),
|
||||
"no headroom left"
|
||||
);
|
||||
// One bin down is a sixteenth of a stop, which is a real if small
|
||||
// amount of latitude and must not be rounded away into the sentence
|
||||
// above it.
|
||||
|
||||
Reference in New Issue
Block a user