Added the gallery

This commit is contained in:
connor committed 2026-10-15 12:33:40 -04:00
1 parent d44f159c98
commit 8861858f0d
8 files changed
+482 -11

No files matched your search

+28
View File
@@ -120,6 +120,34 @@ fn example_scene_on_gpu_and_cpu() {
);
}
#[test]
fn pretty_previews_lift_the_darks_and_leave_space_black() {
let preview = |pretty: bool| {
let path = out_dir().join(format!("preview-pretty-{pretty}.png"));
let path_str = path.to_str().unwrap();
let mut args = vec![
"render",
"--scene",
"examples/scenes/boxwing.toml",
"--preview",
path_str,
];
if pretty {
args.push("--pretty");
}
let result = resolved(&args);
assert!(result.status.success(), "{result:?}");
image::open(&path).unwrap().into_rgb8()
};
let (raw, pretty) = (preview(false), preview(true));
// Space is the bias, black either way.
assert_eq!(raw.get_pixel(0, 0).0, [0; 3]);
assert_eq!(pretty.get_pixel(0, 0).0, [0; 3]);
// Earth's dayside below the limb, well short of saturation: brighter when pretty.
let (r, p) = (raw.get_pixel(0, 1079).0, pretty.get_pixel(0, 1079).0);
assert!((0..3).all(|k| p[k] > r[k]), "raw {r:?}, pretty {p:?}");
}
#[cfg(feature = "astrokit")]
#[test]
fn lunar_eclipse_darkens_the_moon() {