INNER CODE UNIT · Rust

get_raw_pixels_slice

silvia-odwyer/photon · crate/src/lib.rs:81

    pub fn get_raw_pixels_slice(&self) -> &[u8] {
        &self.raw_pixels
    }
}

#[cfg_attr(feature = "enable_wasm", wasm_bindgen)]
impl PhotonImage {
    #[cfg_attr(feature = "enable_wasm", wasm_bindgen(constructor))]
    /// Create a new PhotonImage from a Vec of u8s, which represent raw pixels.
    pub fn new(raw_pixels: Vec<u8>, width: u32, height: u32) -> PhotonImage {
        PhotonImage {
            raw_pixels,
            width,
            height,
        }
    }

    /// Create a new PhotonImage from a base64 string.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…