[][src]Struct tiff::decoder::Decoder

pub struct Decoder<R> where
    R: Read + Seek
{ /* fields omitted */ }

The representation of a TIFF decoder

Currently does not support decoding of interlaced images

Implementations

impl<R: Read + Seek> Decoder<R>[src]

pub fn new(r: R) -> TiffResult<Decoder<R>>[src]

Create a new decoder that decodes from the stream r

pub fn with_limits(self, limits: Limits) -> Decoder<R>[src]

pub fn dimensions(&mut self) -> TiffResult<(u32, u32)>[src]

pub fn colortype(&mut self) -> TiffResult<ColorType>[src]

pub fn init(self) -> TiffResult<Decoder<R>>[src]

Initializes the decoder.

pub fn next_image(&mut self) -> TiffResult<()>[src]

Reads in the next image. If there is no further image in the TIFF file a format error is returned. To determine whether there are more images call TIFFDecoder::more_images instead.

pub fn more_images(&self) -> bool[src]

Returns true if there is at least one more image available.

pub fn byte_order(&self) -> ByteOrder[src]

Returns the byte_order

pub fn read_ifd_offset(&mut self) -> Result<u64, Error>[src]

pub fn read_byte(&mut self) -> Result<u8, Error>[src]

Reads a TIFF byte value

pub fn read_short(&mut self) -> Result<u16, Error>[src]

Reads a TIFF short value

pub fn read_sshort(&mut self) -> Result<i16, Error>[src]

Reads a TIFF sshort value

pub fn read_long(&mut self) -> Result<u32, Error>[src]

Reads a TIFF long value

pub fn read_slong(&mut self) -> Result<i32, Error>[src]

Reads a TIFF slong value

pub fn read_float(&mut self) -> Result<f32, Error>[src]

Reads a TIFF float value

pub fn read_double(&mut self) -> Result<f64, Error>[src]

Reads a TIFF double value

pub fn read_long8(&mut self) -> Result<u64, Error>[src]

pub fn read_string(&mut self, length: usize) -> TiffResult<String>[src]

Reads a string

pub fn read_offset(&mut self) -> TiffResult<[u8; 4]>[src]

Reads a TIFF IFA offset/value field

pub fn read_offset_u64(&mut self) -> Result<[u8; 8], Error>[src]

Reads a TIFF IFA offset/value field

pub fn goto_offset(&mut self, offset: u32) -> Result<()>[src]

Moves the cursor to the specified offset

pub fn goto_offset_u64(&mut self, offset: u64) -> Result<()>[src]

pub fn find_tag(&mut self, tag: Tag) -> TiffResult<Option<Value>>[src]

Tries to retrieve a tag. Return Ok(None) if the tag is not present.

pub fn find_tag_unsigned<T: TryFrom<u64>>(
    &mut self,
    tag: Tag
) -> TiffResult<Option<T>>
[src]

Tries to retrieve a tag and convert it to the desired unsigned type.

pub fn find_tag_unsigned_vec<T: TryFrom<u64>>(
    &mut self,
    tag: Tag
) -> TiffResult<Option<Vec<T>>>
[src]

Tries to retrieve a vector of all a tag's values and convert them to the desired unsigned type.

pub fn get_tag_unsigned<T: TryFrom<u64>>(&mut self, tag: Tag) -> TiffResult<T>[src]

Tries to retrieve a tag and convert it to the desired unsigned type. Returns an error if the tag is not present.

pub fn get_tag(&mut self, tag: Tag) -> TiffResult<Value>[src]

Tries to retrieve a tag. Returns an error if the tag is not present

pub fn get_tag_u32(&mut self, tag: Tag) -> TiffResult<u32>[src]

Tries to retrieve a tag and convert it to the desired type.

pub fn get_tag_u64(&mut self, tag: Tag) -> TiffResult<u64>[src]

pub fn get_tag_f32(&mut self, tag: Tag) -> TiffResult<f32>[src]

Tries to retrieve a tag and convert it to the desired type.

pub fn get_tag_f64(&mut self, tag: Tag) -> TiffResult<f64>[src]

Tries to retrieve a tag and convert it to the desired type.

pub fn get_tag_u32_vec(&mut self, tag: Tag) -> TiffResult<Vec<u32>>[src]

Tries to retrieve a tag and convert it to the desired type.

pub fn get_tag_u16_vec(&mut self, tag: Tag) -> TiffResult<Vec<u16>>[src]

pub fn get_tag_u64_vec(&mut self, tag: Tag) -> TiffResult<Vec<u64>>[src]

pub fn get_tag_f32_vec(&mut self, tag: Tag) -> TiffResult<Vec<f32>>[src]

Tries to retrieve a tag and convert it to the desired type.

pub fn get_tag_f64_vec(&mut self, tag: Tag) -> TiffResult<Vec<f64>>[src]

Tries to retrieve a tag and convert it to the desired type.

pub fn get_tag_u8_vec(&mut self, tag: Tag) -> TiffResult<Vec<u8>>[src]

Tries to retrieve a tag and convert it to a 8bit vector.

pub fn get_tag_ascii_string(&mut self, tag: Tag) -> TiffResult<String>[src]

Tries to retrieve a tag and convert it to a ascii vector.

pub fn strip_count(&mut self) -> TiffResult<u32>[src]

Number of strips in image

pub fn read_jpeg(&mut self) -> TiffResult<DecodingResult>[src]

pub fn read_strip_to_buffer(
    &mut self,
    buffer: DecodingBuffer<'_>
) -> TiffResult<()>
[src]

pub fn read_strip(&mut self) -> TiffResult<DecodingResult>[src]

Read a single strip from the image and return it as a Vector

pub fn read_image(&mut self) -> TiffResult<DecodingResult>[src]

Decodes the entire image and return it as a Vector

Trait Implementations

impl<R: Debug> Debug for Decoder<R> where
    R: Read + Seek
[src]

Auto Trait Implementations

impl<R> RefUnwindSafe for Decoder<R> where
    R: RefUnwindSafe

impl<R> Send for Decoder<R> where
    R: Send

impl<R> Sync for Decoder<R> where
    R: Sync

impl<R> Unpin for Decoder<R> where
    R: Unpin

impl<R> UnwindSafe for Decoder<R> where
    R: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.