feat(v0.2): shturman-splash — Stage-0 splash (software-render → PNG)
P6.2: статичный брендовый splash-кадр (wordmark «Штурман» на тёмном), render_splash через shturman-render; bin с --screenshot. Без чтения шины (стартует до Power/Settings → «мгновенно»). Визуальные токены — каркас (язык v0.5). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Alexander <akotenev2003@gmail.com>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
//! Splash-кадр Stage 0: непустой брендовый PNG, тёмный фон (План 6 P6.2 / спека v0.2 §6).
|
||||
|
||||
use shturman_splash::render_splash;
|
||||
|
||||
#[test]
|
||||
fn renders_dark_branded_splash() {
|
||||
let dir = tempfile::tempdir().unwrap();
|
||||
let path = dir.path().join("splash.png");
|
||||
render_splash(&path).expect("render_splash");
|
||||
|
||||
let dec = png::Decoder::new(std::fs::File::open(&path).unwrap());
|
||||
let mut r = dec.read_info().unwrap();
|
||||
assert_eq!((r.info().width, r.info().height), (1024, 600));
|
||||
let mut buf = vec![0u8; r.output_buffer_size()];
|
||||
let info = r.next_frame(&mut buf).unwrap();
|
||||
let px = &buf[..info.buffer_size()];
|
||||
// фон тёмный (угол) + не одноцветный (wordmark отрисован)
|
||||
assert!(
|
||||
px[0] < 64 && px[1] < 64 && px[2] < 64,
|
||||
"splash фон не тёмный: {},{},{}",
|
||||
px[0],
|
||||
px[1],
|
||||
px[2]
|
||||
);
|
||||
assert!(
|
||||
px.iter().any(|&b| b != px[0]),
|
||||
"splash одноцветный — wordmark не отрисован"
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user