#[derive(Clone, Copy)]
pub struct QualitySettings {
    pub values: [u8; 8],
}

pub const QUANTIZATION_QUANT0_DIVISOR: usize = 0;
pub const QUANTIZATION_CONSTANT: usize = 1;
pub const QUANTIZATION_LINEAR: usize = 2;
pub const QUANTIZATION_N_QUANTS_TO_KEEP: usize = 3;
pub const THUMBNAIL_IS_WIDE: usize = 4;
// 5, 6, 7: reserved


impl QualitySettings {
    pub fn new(level: u8) -> Self {
        // Concept: 
        // Levels 0, 1, and 2 are incredibly deep fried
        // Levels 3, 4, 5, 6 are usable with artifacting 
        // Levels 7, 8, 9 are above what you would seriously use
        if level == 0 {
            return QualitySettings { values: [255, 255, 32, 1, 0, 0, 0, 0] };
        } else if level == 1 {
            return QualitySettings { values: [192, 192, 24, 2, 0, 0, 0, 0] };
        } else if level == 2 {
            return QualitySettings { values: [128, 128, 16, 3, 0, 0, 0, 0] };
        } else if level == 3 {
            return QualitySettings { values: [96, 96, 12, 4, 0, 0, 0, 0] };

            // TODO: Levels 4, 5, 6


        } else if level == 7 {
            return QualitySettings { values: [1, 24, 8, 24, 1, 0, 0, 0] };
        } else if level == 8 {
            return QualitySettings { values: [1, 12, 4, 48, 1, 0, 0, 0] };
        } else { // level >= 9
            return QualitySettings { values: [1, 1, 1, 96, 1, 0, 0, 0] };
        }
    }
}