use std::fs;

pub struct Pixel {
    pub r: u16,
    pub g: u16,
    pub b: u16
}

impl Pixel {
    pub fn new(r: u16, g: u16, b: u16) -> Pixel {
        Pixel {
            r,
            g,
            b
        }
    }
}

pub struct Image {
    pub width: u32,
    pub height: u32,
    pub pixels: Vec<Pixel>
}

impl Image {
    pub fn new() -> Image {
        Image {
            width: 0,
            height: 0,
            pixels: Vec::new()
        }
    }

    pub fn parse(mut self, img: &str) {
        let content = fs::read_to_string(img).expect("Failed to parse image");
        
        for (i, c) in content.chars().enumerate() {
            if i <= 13 {
                println!("{}", c);
            } else {
                break;
            }
        }
    }
}