Struct zune_core::options::EncoderOptions
source · pub struct EncoderOptions {
pub width: usize,
pub height: usize,
pub colorspace: ColorSpace,
pub quality: u8,
pub depth: BitDepth,
}Fields§
§width: usizeThe image width
This is the width the image will be encoded in
Note
Images have different width and height limit, encoding an image larger than that limit is an error.
Consult with your favourite image codec on its limit
height: usizeThe image height
This is the height the image will be encoded in.
Note
Images have different width and height limit, encoding an image larger than that limit is an error.
Consult with your favourite image codec on its limit
colorspace: ColorSpaceThe colorspace the pixels are in.
Note
Each encoder has different set of supported colorspaces.
Check with your favourite image codec on its limit.
quality: u8The quality expected for the image
This has different results depending on encoder.
- lossy encoders: Higher values, good visual quality/larger file, lower values bad visual quality/smaller file.
- lossless encoders: Higher values, more encoding time/smaller image, lower value, less encoding time/image.
Though this is not respected by some encoders, e.g ppm doesn’t have a notion of quality.
depth: BitDepthThe bit depth of the data
The data is expected in native endian the encoder will convert the data to whatever endian is needed by the format.
- Respected by:
png,ppm
Implementations§
source§impl EncoderOptions
impl EncoderOptions
pub const fn get_width(&self) -> usize
pub const fn get_height(&self) -> usize
pub const fn get_depth(&self) -> BitDepth
pub const fn get_quality(&self) -> u8
pub const fn get_colorspace(&self) -> ColorSpace
Trait Implementations§
source§impl Clone for EncoderOptions
impl Clone for EncoderOptions
source§fn clone(&self) -> EncoderOptions
fn clone(&self) -> EncoderOptions
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more