pub struct Encoder { /* private fields */ }Expand description
Ultra HDR encoder.
For production use without a bundled JPEG codec, use encode_ultrahdr directly.
The builder methods that require a JPEG codec (set_hdr_image, set_sdr_image,
encode) are only available in tests where zenjpeg is a dev-dependency.
Implementations§
Source§impl Encoder
impl Encoder
Sourcepub fn set_compressed_sdr(&mut self, jpeg: Vec<u8>) -> &mut Self
pub fn set_compressed_sdr(&mut self, jpeg: Vec<u8>) -> &mut Self
Set a pre-compressed SDR JPEG.
Sourcepub fn set_base_jpeg(&mut self, jpeg: Vec<u8>) -> &mut Self
pub fn set_base_jpeg(&mut self, jpeg: Vec<u8>) -> &mut Self
Alias for set_compressed_sdr.
Sourcepub fn set_existing_gainmap_jpeg(
&mut self,
jpeg: Vec<u8>,
metadata: GainMapMetadata,
) -> &mut Self
pub fn set_existing_gainmap_jpeg( &mut self, jpeg: Vec<u8>, metadata: GainMapMetadata, ) -> &mut Self
Set an existing gain map as raw JPEG bytes and metadata.
Sourcepub fn set_gainmap_jpeg(
&mut self,
jpeg: Vec<u8>,
metadata: GainMapMetadata,
) -> &mut Self
pub fn set_gainmap_jpeg( &mut self, jpeg: Vec<u8>, metadata: GainMapMetadata, ) -> &mut Self
Alias for set_existing_gainmap_jpeg.
Sourcepub fn set_quality(&mut self, base: u8, gainmap: u8) -> &mut Self
pub fn set_quality(&mut self, base: u8, gainmap: u8) -> &mut Self
Set JPEG quality for base and gain map images.
Sourcepub fn set_gainmap_scale(&mut self, scale: u8) -> &mut Self
pub fn set_gainmap_scale(&mut self, scale: u8) -> &mut Self
Set gain map downscale factor.
Sourcepub fn set_target_display_peak(&mut self, nits: f32) -> &mut Self
pub fn set_target_display_peak(&mut self, nits: f32) -> &mut Self
Set target display peak brightness in nits.
Sourcepub fn set_min_content_boost(&mut self, boost: f32) -> &mut Self
pub fn set_min_content_boost(&mut self, boost: f32) -> &mut Self
Set minimum content boost.
Sourcepub fn encode_from_jpegs(&self) -> Result<Vec<u8>>
pub fn encode_from_jpegs(&self) -> Result<Vec<u8>>
Encode to Ultra HDR JPEG from pre-set JPEGs (production API).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Encoder
impl RefUnwindSafe for Encoder
impl Send for Encoder
impl Sync for Encoder
impl Unpin for Encoder
impl UnsafeUnpin for Encoder
impl UnwindSafe for Encoder
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
Mutably borrows from an owned value. Read more