Enum exr::compression::Compression [−][src]
pub enum Compression { Uncompressed, RLE, ZIP1, ZIP16, PIZ, PXR24, B44, B44A, DWAA(Option<f32>), DWAB(Option<f32>), }
Expand description
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
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.
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.
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´.
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 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.
Like ZIP1
, but reduces precision of f32
images to f24
.
Therefore, this is lossless compression for f16
and u32
data, lossy compression for f32
data.
This compression method works well for depth
buffers and similar images, where the possible range of values is very large, but
where full 32-bit floating-point accuracy is not necessary. Rounding improves
compression significantly by eliminating the pixels’ 8 least significant bits, which
tend to be very noisy, and therefore difficult to compress.
This produces really small image files. Only supported for flat images, not for deep data.
This is a lossy compression method for f16 images.
It’s the predecessor of the B44A
compression,
which has improved compression rates for uniformly colored areas.
You should probably use B44A
instead of the plain B44
.
Only supported for flat images, not for deep data.
This is a lossy compression method for f16 images. All f32 and u32 channels will be stored without compression. All the f16 pixels are divided into 4x4 blocks. Each block is then compressed as a whole.
The 32 bytes of a block will require only ~14 bytes after compression, independent of the actual pixel contents. With chroma subsampling, a block will be compressed to ~7 bytes. Uniformly colored blocks will be compressed to ~3 bytes.
The 512 bytes of an f32 block will not be compressed at all.
Should be fast enough for realtime playback. Only supported for flat images, not for deep data.
This lossy compression is not yet supported by this implementation.
This lossy compression is not yet supported by this implementation.
Implementations
impl Compression
[src]
impl Compression
[src]pub fn compress_image_section(
self,
header: &Header,
uncompressed: ByteVec,
pixel_section: IntegerBounds
) -> Result<ByteVec>
[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]
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]
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]
pub fn supports_deep_data(self) -> bool
[src]Deep data can only be compressed using RLE or ZIP compression.
pub fn is_lossless_for(self, sample_type: SampleType) -> bool
[src]
pub fn is_lossless_for(self, sample_type: SampleType) -> bool
[src]Most compression methods will reconstruct the exact pixel bytes, but some might throw away unimportant data for specific types of samples.
pub fn may_loose_data(self) -> bool
[src]
pub fn may_loose_data(self) -> bool
[src]Most compression methods will reconstruct the exact pixel bytes, but some might throw away unimportant data in some cases.
pub fn supports_nan(self) -> bool
[src]
pub fn supports_nan(self) -> bool
[src]Most compression methods will reconstruct the exact pixel bytes, but some might replace NaN with zeroes.
impl Compression
[src]
impl Compression
[src]Trait Implementations
impl Clone for Compression
[src]
impl Clone for Compression
[src]fn clone(&self) -> Compression
[src]
fn clone(&self) -> Compression
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl Debug for Compression
[src]
impl Debug for Compression
[src]impl Display for Compression
[src]
impl Display for Compression
[src]impl PartialEq<Compression> for Compression
[src]
impl PartialEq<Compression> for Compression
[src]fn eq(&self, other: &Compression) -> bool
[src]
fn eq(&self, other: &Compression) -> bool
[src]This method tests for self
and other
values to be equal, and is used
by ==
. Read more
fn ne(&self, other: &Compression) -> bool
[src]
fn ne(&self, other: &Compression) -> bool
[src]This method tests for !=
.
impl Copy for Compression
[src]
impl StructuralPartialEq for Compression
[src]
Auto Trait Implementations
impl RefUnwindSafe for Compression
impl Send for Compression
impl Sync for Compression
impl Unpin for Compression
impl UnwindSafe for Compression
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more