[][src]Enum exr::compression::Compression

pub enum Compression {
    Uncompressed,
    RLE,
    ZIP1,
    ZIP16,
    PIZ,
    PXR24,
    B44,
    B44A,
    DWAA(Option<f32>),
    DWAB,
}

Specifies which compression method to use. Use uncompressed data for fastest loading and writing speeds. Use RLE compression for fast loading and writing with slight memory savings. Use ZIP compression for slow processing with large memory savings.

Variants

Uncompressed

Store uncompressed values. Produces large files that can be read and written very quickly. Consider using RLE instead, as it provides some compression with almost equivalent speed.

RLE

Produces slightly smaller files that can still be read and written rather quickly. The compressed file size is usually between 60 and 75 percent of the uncompressed size. Works best for images with large flat areas, such as masks and abstract graphics. This compression method is lossless.

ZIP1

Uses ZIP compression to compress each line. Slowly produces small images which can be read with moderate speed. This compression method is lossless. Might be slightly faster but larger than `ZIP16´.

ZIP16

Uses ZIP compression to compress blocks of 16 lines. Slowly produces small images which can be read with moderate speed. This compression method is lossless. Might be slightly slower but smaller than `ZIP1´.

PIZ

PIZ compression works well for noisy and natural images. Works better with larger tiles. Only supported for flat images, but not for deep data. This compression method is lossless.

PXR24

Like ZIP1, but reduces precision of f32 images to f24. This produces really small image files. Only supported for flat images, not for deep data.

B44

This lossy compression is not yet supported by this implementation.

B44A

This lossy compression is not yet supported by this implementation.

DWAA(Option<f32>)

This lossy compression is not yet supported by this implementation.

DWAB

This lossy compression is not yet supported by this implementation.

Implementations

impl Compression[src]

pub fn compress_image_section(
    self,
    header: &Header,
    uncompressed: ByteVec,
    pixel_section: IntegerBounds
) -> Result<ByteVec>
[src]

Compress the image section of bytes.

pub fn decompress_image_section(
    self,
    header: &Header,
    compressed: ByteVec,
    pixel_section: IntegerBounds,
    pedantic: bool
) -> Result<ByteVec>
[src]

Decompress the image section of bytes.

pub fn scan_lines_per_block(self) -> usize[src]

For scan line images and deep scan line images, one or more scan lines may be stored together as a scan line block. The number of scan lines per block depends on how the pixel data are compressed.

pub fn supports_deep_data(self) -> bool[src]

Deep data can only be compressed using RLE or ZIP compression.

impl Compression[src]

pub fn byte_size() -> usize[src]

Number of bytes this would consume in an exr file.

pub fn write<W: Write>(self, write: &mut W) -> UnitResult[src]

Without validation, write this instance to the byte stream.

pub fn read<R: Read>(read: &mut R) -> Result<Self>[src]

Read the value without validating.

Trait Implementations

impl Clone for Compression[src]

impl Copy for Compression[src]

impl Debug for Compression[src]

impl Display for Compression[src]

impl PartialEq<Compression> for Compression[src]

impl StructuralPartialEq for Compression[src]

Auto Trait Implementations

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[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.