[−][src]Struct image::dxt::DXTDecoder
DXT decoder
Methods
impl<R: Read> DXTDecoder<R>[src]
impl<R: Read> DXTDecoder<R>pub fn new(
r: R,
width: u32,
height: u32,
variant: DXTVariant
) -> Result<DXTDecoder<R>, ImageError>[src]
pub fn new(
r: R,
width: u32,
height: u32,
variant: DXTVariant
) -> Result<DXTDecoder<R>, ImageError>Create a new DXT decoder that decodes from the stream r.
As DXT is often stored as raw buffers with the width/height
somewhere else the width and height of the image need
to be passed in width and height, as well as the
DXT variant in variant.
width and height are required to be powers of 2 and at least 4.
otherwise an error will be returned
Trait Implementations
impl<R: Read> ImageDecoder for DXTDecoder<R>[src]
impl<R: Read> ImageDecoder for DXTDecoder<R>Note that, due to the way that DXT compression works, a scanline is considered to consist out of 4 lines of pixels.
fn dimensions(&mut self) -> ImageResult<(u32, u32)>[src]
fn dimensions(&mut self) -> ImageResult<(u32, u32)>Returns a tuple containing the width and height of the image
fn colortype(&mut self) -> ImageResult<ColorType>[src]
fn colortype(&mut self) -> ImageResult<ColorType>Returns the color type of the image e.g. RGB(8) (8bit RGB)
fn row_len(&mut self) -> ImageResult<usize>[src]
fn row_len(&mut self) -> ImageResult<usize>Returns the length in bytes of one decoded row of the image
fn read_scanline(&mut self, buf: &mut [u8]) -> ImageResult<u32>[src]
fn read_scanline(&mut self, buf: &mut [u8]) -> ImageResult<u32>Reads one row from the image into buf and returns the row index
fn read_image(&mut self) -> ImageResult<DecodingResult>[src]
fn read_image(&mut self) -> ImageResult<DecodingResult>Decodes the entire image and return it as a Vector
fn is_animated(&mut self) -> ImageResult<bool>[src]
fn is_animated(&mut self) -> ImageResult<bool>Returns true if the image is animated
fn into_frames(self) -> ImageResult<Frames>[src]
fn into_frames(self) -> ImageResult<Frames>Returns the frames of the image Read more
fn load_rect(
&mut self,
x: u32,
y: u32,
length: u32,
width: u32
) -> ImageResult<Vec<u8>>[src]
fn load_rect(
&mut self,
x: u32,
y: u32,
length: u32,
width: u32
) -> ImageResult<Vec<u8>>Decodes a specific region of the image, represented by the rectangle starting from x and y and having length and width Read more
Auto Trait Implementations
impl<R> Send for DXTDecoder<R> where
R: Send,
impl<R> Send for DXTDecoder<R> where
R: Send, impl<R> Sync for DXTDecoder<R> where
R: Sync,
impl<R> Sync for DXTDecoder<R> where
R: Sync, Blanket Implementations
impl<T> From for T[src]
impl<T> From for Timpl<T, U> Into for T where
U: From<T>, [src]
impl<T, U> Into for T where
U: From<T>, impl<T, U> TryFrom for T where
T: From<U>, [src]
impl<T, U> TryFrom for T where
T: From<U>, type Error = !
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>try_from)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized, [src]
impl<T> Borrow for T where
T: ?Sized, ⓘImportant traits for &'a mut Rfn borrow(&self) -> &T[src]
fn borrow(&self) -> &TImmutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
impl<T, U> TryInto for T where
U: TryFrom<T>, type Error = <U as TryFrom<T>>::Error
try_from)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>try_from)Performs the conversion.
impl<T> BorrowMut for T where
T: ?Sized, [src]
impl<T> BorrowMut for T where
T: ?Sized, ⓘImportant traits for &'a mut Rfn borrow_mut(&mut self) -> &mut T[src]
fn borrow_mut(&mut self) -> &mut TMutably borrows from an owned value. Read more
impl<T> Any for T where
T: 'static + ?Sized, [src]
impl<T> Any for T where
T: 'static + ?Sized, fn get_type_id(&self) -> TypeId[src]
fn get_type_id(&self) -> TypeId🔬 This is a nightly-only experimental API. (get_type_id)
this method will likely be replaced by an associated static
Gets the TypeId of self. Read more
impl<T> SetParameter for T[src]
impl<T> SetParameter for T