Reflow what rustfmt wanted in the raw histogram

The author could not run cargo, so this is the formatter's first pass
over the new module and its presentation half.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-30 00:25:16 +02:00
co-authored by Claude Opus 5
parent 4b6c110816
commit e38b730aa6
2 changed files with 19 additions and 4 deletions
+15 -3
View File
@@ -595,7 +595,11 @@ mod tests {
// the axis were inverted the histogram would still look like a // the axis were inverted the histogram would still look like a
// histogram, and every headroom judgement made from it would be // histogram, and every headroom judgement made from it would be
// exactly backwards. // 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 - BINS_PER_STOP), 1.0);
assert_eq!(RawHistogram::stops(BINS - 1 - 8 * BINS_PER_STOP), 8.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 // 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 // Neutral, so the brightest channel must land on the same bin as
// the three do. // 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 // 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 // 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"); let hist = pass.compute(&source(&ctx, &rgb, 4, 1)).expect("compute");
assert_eq!(hist.pixels(), 4); 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.at_black(), 0);
assert_eq!(hist.red()[BINS - 1], 2); assert_eq!(hist.red()[BINS - 1], 2);
+4 -1
View File
@@ -599,7 +599,10 @@ mod tests {
headroom_label(&brightest(&[(2 * per_stop, 100)]), 100), headroom_label(&brightest(&[(2 * per_stop, 100)]), 100),
"2.0 stops of headroom" "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 // 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 // amount of latitude and must not be rounded away into the sentence
// above it. // above it.