Struct tiff::encoder::DirectoryEncoder
source · pub struct DirectoryEncoder<'a, W: 'a + Write + Seek, K: TiffKind> {
writer: &'a mut TiffWriter<W>,
dropped: bool,
ifd_pointer_pos: u64,
ifd: BTreeMap<u16, DirectoryEntry<K::OffsetType>>,
}
Expand description
Low level interface to encode ifd directories.
You should call finish
on this when you are finished with it.
Encoding can silently fail while this is dropping.
Fields§
§writer: &'a mut TiffWriter<W>
§dropped: bool
§ifd_pointer_pos: u64
§ifd: BTreeMap<u16, DirectoryEntry<K::OffsetType>>
Implementations§
source§impl<'a, W: 'a + Write + Seek, K: TiffKind> DirectoryEncoder<'a, W, K>
impl<'a, W: 'a + Write + Seek, K: TiffKind> DirectoryEncoder<'a, W, K>
fn new(writer: &'a mut TiffWriter<W>) -> TiffResult<Self>
sourcepub fn write_tag<T: TiffValue>(&mut self, tag: Tag, value: T) -> TiffResult<()>
pub fn write_tag<T: TiffValue>(&mut self, tag: Tag, value: T) -> TiffResult<()>
Write a single ifd tag.
fn write_directory(&mut self) -> TiffResult<u64>
sourcepub fn write_data<T: TiffValue>(&mut self, value: T) -> TiffResult<u64>
pub fn write_data<T: TiffValue>(&mut self, value: T) -> TiffResult<u64>
Write some data to the tiff file, the offset of the data is returned.
This could be used to write tiff strips.
sourcefn last_written(&self) -> u64
fn last_written(&self) -> u64
Provides the number of bytes written by the underlying TiffWriter during the last call.
fn finish_internal(&mut self) -> TiffResult<()>
sourcepub fn finish(self) -> TiffResult<()>
pub fn finish(self) -> TiffResult<()>
Write out the ifd directory.
Trait Implementations§
Auto Trait Implementations§
impl<'a, W, K> Freeze for DirectoryEncoder<'a, W, K>
impl<'a, W, K> RefUnwindSafe for DirectoryEncoder<'a, W, K>
impl<'a, W, K> Send for DirectoryEncoder<'a, W, K>
impl<'a, W, K> Sync for DirectoryEncoder<'a, W, K>
impl<'a, W, K> Unpin for DirectoryEncoder<'a, W, K>
impl<'a, W, K> !UnwindSafe for DirectoryEncoder<'a, W, K>
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 more