pub struct WhiteLevel(/* private fields */);Expand description
Sensor white level (saturation point)
Implementations§
Source§impl WhiteLevel
impl WhiteLevel
Sourcepub fn new(level: f32) -> Result<Self, String>
pub fn new(level: f32) -> Result<Self, String>
Examples found in repository?
examples/create_test_vsf.rs (line 18)
9fn main() {
10 // Create a simple 8x8 test image
11 let samples: Vec<u64> = (0..64).map(|i| i * 4).collect(); // 0, 4, 8, 12, ..., 252
12 let image = BitPackedTensor::pack(8, vec![8, 8], &samples);
13
14 // Create metadata
15 let metadata = RawMetadata {
16 cfa_pattern: Some(CfaPattern::new(vec![b'R', b'G', b'G', b'B']).unwrap()), // RGGB Bayer pattern
17 black_level: Some(BlackLevel::new(64.0).unwrap()),
18 white_level: Some(WhiteLevel::new(255.0).unwrap()),
19 dark_frame_hash: None,
20 flat_field_hash: None,
21 bias_frame_hash: None,
22 vignette_correction_hash: None,
23 distortion_correction_hash: None,
24 magic_9: None,
25 };
26
27 // Create camera settings
28 let camera = CameraSettings {
29 make: None,
30 model: None,
31 serial_number: None,
32 iso_speed: Some(IsoSpeed::new(800.0).unwrap()),
33 shutter_time_s: Some(ShutterTime::new(1.0 / 60.0).unwrap()), // 1/60 second
34 aperture_f_number: Some(Aperture::new(2.8).unwrap()),
35 focal_length_m: Some(FocalLength::new(0.050).unwrap()), // 50mm
36 exposure_compensation: None,
37 focus_distance_m: Some(FocusDistance::new(3.5).unwrap()),
38 flash_fired: Some(FlashFired::new(false).unwrap()),
39 metering_mode: Some(MeteringMode::new("matrix".to_string()).unwrap()),
40 };
41
42 // Build the VSF file
43 let bytes = build_raw_image(image, Some(metadata), Some(camera), None)
44 .expect("Failed to build VSF file");
45
46 // Write to file
47 std::fs::write("test_sample.vsf", &bytes).expect("Failed to write file");
48
49 println!("Created test_sample.vsf ({} bytes)", bytes.len());
50}pub fn to_vsf_type(self) -> VsfType
pub fn from_vsf_type(vsf: VsfType) -> Result<Self, String>
Trait Implementations§
Source§impl Clone for WhiteLevel
impl Clone for WhiteLevel
Source§fn clone(&self) -> WhiteLevel
fn clone(&self) -> WhiteLevel
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for WhiteLevel
impl RefUnwindSafe for WhiteLevel
impl Send for WhiteLevel
impl Sync for WhiteLevel
impl Unpin for WhiteLevel
impl UnsafeUnpin for WhiteLevel
impl UnwindSafe for WhiteLevel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more