diff options
author | iximeow <me@iximeow.net> | 2020-10-16 13:02:22 -0700 |
---|---|---|
committer | iximeow <me@iximeow.net> | 2020-10-16 13:02:22 -0700 |
commit | 1f014480b45b5a224aa61c4ee99c62905f032bf9 (patch) | |
tree | e6b1f0e8014ca674eb2c506eb1ca28f1bcb81613 /src | |
parent | 6ba1324af6fcaf7e239605d04a93a616322d30df (diff) |
add more incremental changes
Diffstat (limited to 'src')
-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)?); |