Skip to main content

astroimage/
types.rs

1#[allow(dead_code)]
2#[derive(Copy, Clone, PartialEq, Debug)]
3pub enum BayerPattern {
4    None,
5    Rggb,
6    Bggr,
7    Gbrg,
8    Grbg,
9}
10
11#[derive(Copy, Clone, PartialEq, Debug)]
12pub enum DataType {
13    Uint16,
14    Float32,
15}
16
17pub enum PixelData {
18    Uint16(Vec<u16>),
19    Float32(Vec<f32>),
20}
21
22#[allow(dead_code)]
23pub struct ImageMetadata {
24    pub width: usize,
25    pub height: usize,
26    pub channels: usize,
27    pub dtype: DataType,
28    pub bayer_pattern: BayerPattern,
29    pub flip_vertical: bool,
30}
31
32#[allow(dead_code)]
33pub struct ProcessedImage {
34    pub data: Vec<u8>,
35    pub width: usize,
36    pub height: usize,
37    pub is_color: bool,
38    /// Number of channels in `data`: 3 = RGB, 4 = RGBA.
39    pub channels: u8,
40}
41
42#[allow(dead_code)]
43pub struct ProcessConfig {
44    pub downscale_factor: usize,
45    pub jpeg_quality: u8,
46    pub apply_debayer: bool,
47    pub preview_mode: bool,
48    pub auto_stretch: bool,
49    /// Output RGBA (4 bytes/pixel) instead of RGB (3 bytes/pixel).
50    pub rgba_output: bool,
51}