diff options
-rw-r--r-- | src/main.rs | 12 | ||||
-rw-r--r-- | src/qhyccd/mod.rs | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs index 7edf300..c892d97 100644 --- a/src/main.rs +++ b/src/main.rs @@ -113,6 +113,18 @@ fn main() { } return result; } + // make a 16bpp image into an 8bpp image + fn monoize(data: &[u8], width: u32, height: u32) -> Vec<u8> { + let mut result = vec![0; (width * height) as usize]; + for h in 0..height { + for w in 0..width { + result[(h * width + w) as usize] = data[(h * width + w) as usize * 2]; + } + } + return result; + } + // for 16bpp aka qhy600m +// let monoed = monoize(data.as_slice(), dimensions.width, dimensions.height); let scale_factor = 2; if scale_factor != 1 { let downscaled = downscale(data.as_slice(), dimensions.width, dimensions.height, scale_factor); diff --git a/src/qhyccd/mod.rs b/src/qhyccd/mod.rs index 618d151..ac590af 100644 --- a/src/qhyccd/mod.rs +++ b/src/qhyccd/mod.rs @@ -473,6 +473,7 @@ impl Camera { println!("roi set to {} x {} ???", imagew, imageh); println!("gain limits: {:?}", self.get_control_limits(Control::Gain)?); println!("exposure limits: {:?}", self.get_control_limits(Control::Exposure)?); + println!("offset: {:?}", self.get_control_limits(Control::Offset)?); println!("brightness: {:?}", self.get_control_limits(Control::Brightness)?); println!("gamma: {:?}", self.get_control_limits(Control::Gamma)?); println!("contrast: {:?}", self.get_control_limits(Control::Contrast)?); |