use vsf::builders::RawImageBuilder;
use vsf::types::BitPackedTensor;
fn main() {
let samples: Vec<u64> = (0..64).map(|i| i * 4).collect(); let image = BitPackedTensor::pack(8, vec![8, 8], &samples);
let mut raw = RawImageBuilder::new(image);
raw.raw.cfa_pattern = Some(vec![b'R', b'G', b'G', b'B']); raw.raw.black_level = Some(64.0);
raw.raw.white_level = Some(255.0);
raw.camera.iso_speed = Some(800.0);
raw.camera.shutter_time_s = Some(1.0 / 60.0); raw.camera.aperture_f_number = Some(2.8);
raw.camera.focal_length_m = Some(0.050); raw.camera.focus_distance_m = Some(3.5);
raw.camera.flash_fired = Some(false);
raw.camera.metering_mode = Some("matrix".to_string());
raw.lens.make = Some("Sony".to_string());
raw.lens.model = Some("FE 50mm F1.2 GM".to_string());
raw.lens.min_focal_length_m = Some(0.050); raw.lens.max_focal_length_m = Some(0.050);
raw.lens.max_aperture_f = Some(1.2);
let bytes = raw.build().expect("Failed to build VSF file");
std::fs::write("builder_example.vsf", &bytes).expect("Failed to write file");
println!("Created builder_example.vsf ({} bytes)", bytes.len());
println!("\nThe builder pattern allows you to:");
println!(" - Use intuitive dot notation: raw.camera.iso_speed = Some(800.0)");
println!(" - Incrementally set fields based on conditions");
println!(" - Skip optional fields easily (they default to None)");
}