Trait tiff_encoder::Datablock[][src]

pub trait Datablock {
    fn size(&self) -> u32;
fn write_to(self, file: &mut EndianFile) -> Result<()>; }

A block of data in the file pointed to by a field value, but that isn't part of the field itself (such as image strips).

It is also possible to store any block of data in a ByteBlock, but that would require to know the Endianness of the file beforehand, so the bytes are written in the correct order.

Using a Datablock, on the other hand, allows to make use of the functionality of an EndianFile, so the data can be written without worrying about the endianness.

Required Methods

The number of bytes occupied by this Datablock.

Panics

The number of written bytes to the EndianFile in write_to(self, &mut EndianFile) must be the same value returned by this function.

Failing to meet that specification will panic.

Writes this Datablock to an EndianFile. The number of bytes written must be exactly same number as returned by size(&self).

Panics

Failing to write the exact same number of bytes as indicated in size(&self) will panic.

Implementors