Struct quake_files::lmp::LmpImage
[−]
[src]
pub struct LmpImage { /* fields omitted */ }
Quake 1 style LMP image. Does not store color values, only stores
indices into a color palette. (see quake_files::palette::Palette
)
Methods
impl LmpImage
[src]
fn read<R>(reader: &mut R) -> QResult<LmpImage> where
R: Read,
R: Read,
Opens the LMP image at the supplied Read
instance.
fn write<W>(&self, writer: &mut W) -> QResult<()> where
W: Write,
W: Write,
Writes the image to the supplied Write
instance.
fn from_image(image: &DynamicImage, palette: &Palette) -> QResult<LmpImage>
Creates a LMP image from a palette and some image. Returns an error if any of the image's colors are not in the palette.
fn save_as<P>(&self, path: P, palette: Palette) -> QResult<()> where
P: AsRef<Path>,
P: AsRef<Path>,
Saves the image to a file. See image::ImageBuffer#save
for supported image formats.
fn get(&self, x: u32, y: u32) -> u8
fn get_color(&self, x: u32, y: u32, palette: &Palette) -> Color
Uses the given palette to translate an index in this image to a color.