Struct elma_lgr::Image
[−]
[src]
pub struct Image { pub info: Option<Picture>, pub width: u16, pub height: u16, pub pixels: Vec<u8>, pub pcx: Vec<u8>, }
Image from LGR.
Fields
info: Option<Picture>
Optional information describing image.
width: u16
Width of the image.
height: u16
Height of the image.
pixels: Vec<u8>
Image pixels. Each pixel is an index into LGR palette.
This array will only contain values if LGR was loaded with load_pixels
option.
pcx: Vec<u8>
Raw content of the PCX file.
This array will only contain values if LGR was loaded with load_raw_pcx
option.
Methods
impl Image
[src]
fn get_pixel(&self, x: u16, y: u16) -> u8
Get image pixel. Returned value is an index into LGR palette.
This function will panic if x >= width
, y >= height
or LGR was loaded with load_pixels
set to false
.
Trait Implementations
impl Debug for Image
[src]
impl Clone for Image
[src]
fn clone(&self) -> Image
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more