Skip to main content

EncodeOptions

Struct EncodeOptions 

Source
pub struct EncodeOptions {
Show 21 fields pub num_decomposition_levels: u8, pub reversible: bool, pub code_block_width_exp: u8, pub code_block_height_exp: u8, pub guard_bits: u8, pub use_ht_block_coding: bool, pub progression_order: EncodeProgressionOrder, pub write_tlm: bool, pub write_plt: bool, pub write_plm: bool, pub write_sop: bool, pub write_eph: bool, pub use_mct: bool, pub num_layers: u8, pub quality_layer_byte_targets: Vec<u64>, pub validate_high_throughput_codestream: bool, pub irreversible_quantization_scale: f32, pub irreversible_quantization_subband_scales: IrreversibleQuantizationSubbandScales, pub component_sampling: Option<Vec<(u8, u8)>>, pub tile_size: Option<(u32, u32)>, pub precinct_exponents: Vec<(u8, u8)>,
}
Expand description

Encoding options for JPEG 2000.

Fields§

§num_decomposition_levels: u8

Number of decomposition levels (default: 5).

§reversible: bool

Use reversible (lossless) transform (default: true).

§code_block_width_exp: u8

Code-block width exponent minus 2 (default: 4, meaning 2^6=64).

§code_block_height_exp: u8

Code-block height exponent minus 2 (default: 4, meaning 2^6=64).

§guard_bits: u8

Number of guard bits (default: 1 for reversible, 2 for irreversible).

§use_ht_block_coding: bool

Encode using HT block coding (HTJ2K / Part 15) instead of classic EBCOT.

§progression_order: EncodeProgressionOrder

Packet progression order to write in COD and use for packetization.

§write_tlm: bool

Write a TLM marker segment for the single tile-part.

§write_plt: bool

Write PLT packet-length marker segments in the tile-part header.

§write_plm: bool

Write PLM packet-length marker segments in the main header.

§write_sop: bool

Write SOP marker segments before packets.

§write_eph: bool

Write EPH markers after packet headers.

§use_mct: bool

Apply the JPEG 2000 multi-component color transform for 3+ component inputs.

§num_layers: u8

Number of cumulative quality layers to emit.

§quality_layer_byte_targets: Vec<u64>

Optional cumulative packet-body byte targets for each quality layer.

§validate_high_throughput_codestream: bool

Decode and verify HTJ2K codestreams inside the native encoder.

§irreversible_quantization_scale: f32

Multiplier applied to irreversible 9/7 scalar quantization step sizes.

1.0 preserves the near-lossless default step sizes. Larger values produce smaller codestreams by coarsening quantization.

§irreversible_quantization_subband_scales: IrreversibleQuantizationSubbandScales

Per-subband multipliers applied on top of irreversible_quantization_scale.

§component_sampling: Option<Vec<(u8, u8)>>

Optional per-component SIZ sampling factors (XRsiz, YRsiz).

None means every component is stored at the reference-grid resolution. This is experimental and primarily intended for precomputed coefficient encoders that preserve JPEG-native chroma subsampling.

§tile_size: Option<(u32, u32)>

Optional tile width and height for multi-tile codestream output.

§precinct_exponents: Vec<(u8, u8)>

Optional precinct exponents in COD order, one per resolution level.

Trait Implementations§

Source§

impl Clone for EncodeOptions

Source§

fn clone(&self) -> EncodeOptions

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EncodeOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for EncodeOptions

Source§

fn default() -> EncodeOptions

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(_simd: S, value: T) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.