mirror of
https://github.com/storytold/lightcraft.git
synced 2026-10-25 10:37:11 -06:00
Black-box derived layout: 0x4000-byte chunks stored rotated by 0x1ff8, 16-byte LE blocks read LSB-first (10x12-bit or 9x14-bit samples). Sensor borders, CFA code, per-channel black, linearity limit, WB levels, ISO; JpgFromRaw preview via a generic undefined-tag JPEG candidate. The quantised raw format 4 reports Unsupported (documented gap). Adds a rawdump debug example. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
15 lines
754 B
Rust
15 lines
754 B
Rust
//! Debug helper: `rawdump IN OUT` writes the decoded sensor data as `u32 width, u32 height` (little-endian)
|
||
//! followed by `width × height × cpp` little-endian `u16` samples, for analysis in external tools.
|
||
fn main() {
|
||
let a: Vec<String> = std::env::args().skip(1).collect();
|
||
let r = lightcraft_raw::decode(&std::fs::read(&a[0]).expect("read")).expect("decode");
|
||
let lightcraft_raw::RawData::U16(d) = &r.data else { panic!("float data") };
|
||
let mut out = Vec::with_capacity(8 + d.len() * 2);
|
||
out.extend_from_slice(&(r.width as u32).to_le_bytes());
|
||
out.extend_from_slice(&(r.height as u32).to_le_bytes());
|
||
for v in d {
|
||
out.extend_from_slice(&v.to_le_bytes());
|
||
}
|
||
std::fs::write(&a[1], out).expect("write");
|
||
}
|