pub(crate) struct Header {
pub(crate) id_length: u8,
pub(crate) map_type: u8,
pub(crate) image_type: u8,
pub(crate) map_origin: u16,
pub(crate) map_length: u16,
pub(crate) map_entry_size: u8,
pub(crate) x_origin: u16,
pub(crate) y_origin: u16,
pub(crate) image_width: u16,
pub(crate) image_height: u16,
pub(crate) pixel_depth: u8,
pub(crate) image_desc: u8,
}
Expand description
Header used by TGA image files.
Fields§
§id_length: u8
§map_type: u8
§image_type: u8
§map_origin: u16
§map_length: u16
§map_entry_size: u8
§x_origin: u16
§y_origin: u16
§image_width: u16
§image_height: u16
§pixel_depth: u8
§image_desc: u8
Implementations§
source§impl Header
impl Header
sourcepub(crate) fn from_pixel_info(
color_type: ColorType,
width: u16,
height: u16,
use_rle: bool,
) -> ImageResult<Self>
pub(crate) fn from_pixel_info( color_type: ColorType, width: u16, height: u16, use_rle: bool, ) -> ImageResult<Self>
Load the header with values from pixel information.
sourcepub(crate) fn from_reader(r: &mut dyn Read) -> ImageResult<Self>
pub(crate) fn from_reader(r: &mut dyn Read) -> ImageResult<Self>
Load the header with values from the reader.
sourcepub(crate) fn write_to(&self, w: &mut dyn Write) -> ImageResult<()>
pub(crate) fn write_to(&self, w: &mut dyn Write) -> ImageResult<()>
Write out the header values.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Header
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnwindSafe for Header
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian()
.