Struct ImageEncoder
pub struct ImageEncoder<'a, W: 'a + Write + Seek, C: ColorType, K: TiffKind> { /* private fields */ }
Type to encode images strip by strip.
You should call finish on this when you are finished with it.
Encoding can silently fail while this is dropping.
Examples
# extern crate tiff;
#
You can also call write_data function wich will encode by strip and finish
Implementations
impl<'a, W: 'a + Write + Seek, T: ColorType, K: TiffKind> ImageEncoder<'a, W, T, K>
fn extra_samples(&mut self, extra: &[ExtraSamples]) -> Result<(), TiffError>fn next_strip_sample_count(&self) -> u64Number of samples the next strip should have.
fn write_strip(&mut self, value: &[T::Inner]) -> TiffResult<()> where [T::Inner]: TiffValue,Write a single strip.
fn write_data(self, data: &[T::Inner]) -> TiffResult<()> where [T::Inner]: TiffValue,Write strips from data
fn resolution(&mut self, unit: ResolutionUnit, value: Rational)Set image resolution
fn resolution_unit(&mut self, unit: ResolutionUnit)Set image resolution unit
fn x_resolution(&mut self, value: Rational)Set image x-resolution
fn y_resolution(&mut self, value: Rational)Set image y-resolution
fn rows_per_strip(&mut self, value: u32) -> TiffResult<()>Set image number of lines per strip
This function needs to be called before any calls to
write_dataorwrite_stripand will return an error otherwise.fn encoder(&mut self) -> &mut DirectoryEncoder<'a, W, K>Get a reference of the underlying
DirectoryEncoderfn finish(self) -> TiffResult<()>Write out image and ifd directory.
Trait Implementations
impl<'a, W: Write + Seek, C: ColorType, K: TiffKind> Drop for ImageEncoder<'a, W, C, K>
fn drop(&mut self)
Auto Trait Implementations
impl<'a, W, C, K> !UnwindSafe for ImageEncoder<'a, W, C, K>
impl<'a, W, C, K> Freeze for ImageEncoder<'a, W, C, K>
where
DirectoryEncoder<'a, W, K>: Freeze,
Vec<<K as TiffKind>::OffsetType>: Freeze + Freeze,
PhantomData<C>: Freeze,
impl<'a, W, C, K> RefUnwindSafe for ImageEncoder<'a, W, C, K>
where
DirectoryEncoder<'a, W, K>: RefUnwindSafe,
Vec<<K as TiffKind>::OffsetType>: RefUnwindSafe + RefUnwindSafe,
PhantomData<C>: RefUnwindSafe,
impl<'a, W, C, K> Send for ImageEncoder<'a, W, C, K>
where
DirectoryEncoder<'a, W, K>: Send,
Vec<<K as TiffKind>::OffsetType>: Send + Send,
PhantomData<C>: Send,
impl<'a, W, C, K> Sync for ImageEncoder<'a, W, C, K>
where
DirectoryEncoder<'a, W, K>: Sync,
Vec<<K as TiffKind>::OffsetType>: Sync + Sync,
PhantomData<C>: Sync,
impl<'a, W, C, K> Unpin for ImageEncoder<'a, W, C, K>
where
DirectoryEncoder<'a, W, K>: Unpin,
Vec<<K as TiffKind>::OffsetType>: Unpin + Unpin,
PhantomData<C>: Unpin,
impl<'a, W, C, K> UnsafeUnpin for ImageEncoder<'a, W, C, K>
where
DirectoryEncoder<'a, W, K>: UnsafeUnpin,
Vec<<K as TiffKind>::OffsetType>: UnsafeUnpin + UnsafeUnpin,
PhantomData<C>: UnsafeUnpin,
Blanket Implementations
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for ImageEncoder<'a, W, C, K>
where
ST: ?Sized,
DT: ?Sized,
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for ImageEncoder<'a, W, C, K>
where
ST: ?Sized,
DT: ?Sized,
impl<T> Any for ImageEncoder<'a, W, C, K>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for ImageEncoder<'a, W, C, K>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for ImageEncoder<'a, W, C, K>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> From<T> for ImageEncoder<'a, W, C, K>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> Read<Exclusive, BecauseExclusive> for ImageEncoder<'a, W, C, K>
where
T: ?Sized,
impl<T, U> Into<U> for ImageEncoder<'a, W, C, K>
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for ImageEncoder<'a, W, C, K>
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for ImageEncoder<'a, W, C, K>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>