Struct elma_lgr::Lgr
[−]
[src]
pub struct Lgr { pub images: BTreeMap<String, Image>, pub palette: Vec<u8>, }
Content of an LGR file.
Fields
images: BTreeMap<String, Image>
All images contained in this LGR. Names include .pcx extension.
palette: Vec<u8>
Palette contains 256-colors, format is R0, G0, B0, R1, G1, B1, ...
Methods
impl Lgr
[src]
fn get_palette_color(&self, i: u8) -> (u8, u8, u8)
Get color from LGR palette. There are 256 colors in the palette.
Returns triple (R, G, B).
fn load_from_file<P: AsRef<Path>>(
path: P,
load_pixels: bool,
load_raw_pcx: bool
) -> Result<Self>
path: P,
load_pixels: bool,
load_raw_pcx: bool
) -> Result<Self>
Read LGR from file.
Arguments:
load_pixels
- load pixels from PCX images and store them intoImage::pixels
.load_raw_pcx
- load raw byte content of PCX images intoImage::pcx
.
If you are going to use LGR for rendering then set load_pixels
to true
and load_raw_pcx
to false
.
If you wat to extract files from LGR then set load_pixels
to false
and load_raw_pcx
to true
.
fn load_from_stream<R: Read>(
stream: &mut R,
load_pixels: bool,
load_raw_pcx: bool
) -> Result<Self>
stream: &mut R,
load_pixels: bool,
load_raw_pcx: bool
) -> Result<Self>
Read LGR from stream.
See description of load_from_file
for more info.
Trait Implementations
impl Debug for Lgr
[src]
impl Clone for Lgr
[src]
fn clone(&self) -> Lgr
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