pub enum Compression {
Rice,
Gzip,
ShuffledGzip,
Hcompress {
scale: i64,
},
Plio,
None,
}Expand description
Which algorithm the tiles are compressed with.
The convention defines several, and they suit different data. Rice is the usual choice for astronomical images: it is fast and, on data where each pixel is close to the one before it, it is the smallest of these. Gzip compresses anything at all, including floating point values that have not been quantised, which is what makes it the one lossless choice for a floating point image.
Variants§
Rice
RICE_1: the differences between neighbouring pixels, coded so that
small ones are short. Integers only — a floating point image has to be
quantised first.
Gzip
GZIP_1: deflate over the tile’s bytes as they stand.
ShuffledGzip
GZIP_2: deflate after gathering the first byte of every value, then
the second, and so on, which usually compresses better because the high
bytes of neighbouring values are alike.
Hcompress
HCOMPRESS_1: an image transform that gathers each two by two block
into a sum and three differences, coded as a quadtree. It compresses
smooth images better than Rice, and at a scale above one it does so by
throwing away the low bits of each coefficient — which is lossy, and
which ImageHDU::read_image can smooth back over.
A scale of zero or one keeps every bit. Tiles are two-dimensional, so this cannot be used with a tile that reaches along a third axis.
Plio
PLIO_1: run-length coding for the integer masks IRAF writes, where a
tile is mostly long runs of the same small number. Values must be
non-negative and no wider than twenty-seven bits.
None
NOCOMPRESS: the tiles are stored as they are. Useful for writing a
file in the tiled layout without paying to compress it.
Implementations§
Source§impl Compression
impl Compression
Sourcepub fn card_value(self) -> &'static str
pub fn card_value(self) -> &'static str
The name a ZCMPTYPE card writes this algorithm under.
Trait Implementations§
Source§impl Clone for Compression
impl Clone for Compression
Source§fn clone(&self) -> Compression
fn clone(&self) -> Compression
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for Compression
Source§impl Debug for Compression
impl Debug for Compression
Source§impl Default for Compression
impl Default for Compression
Source§fn default() -> Compression
fn default() -> Compression
impl Eq for Compression
Source§impl PartialEq for Compression
impl PartialEq for Compression
impl StructuralPartialEq for Compression
Auto Trait Implementations§
impl Freeze for Compression
impl RefUnwindSafe for Compression
impl Send for Compression
impl Sync for Compression
impl Unpin for Compression
impl UnsafeUnpin for Compression
impl UnwindSafe for Compression
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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