Skip to main content

EncoderParameters

Struct EncoderParameters 

Source
pub struct EncoderParameters {
Show 44 fields pub tile_size_on: bool, pub cp_tx0: i32, pub cp_ty0: i32, pub cp_tdx: i32, pub cp_tdy: i32, pub cp_disto_alloc: i32, pub cp_fixed_alloc: i32, pub cp_fixed_quality: i32, pub cp_matrice: Option<Vec<i32>>, pub cp_comment: Option<Vec<u8>>, pub csty: i32, pub prog_order: ProgressionOrder, pub pocs: [Poc; 32], pub numpocs: u32, pub tcp_numlayers: i32, pub tcp_rates: [f32; 100], pub tcp_distoratio: [f32; 100], pub numresolution: i32, pub cblockw_init: i32, pub cblockh_init: i32, pub mode: i32, pub irreversible: i32, pub roi_compno: i32, pub roi_shift: i32, pub res_spec: i32, pub prcw_init: [i32; 33], pub prch_init: [i32; 33], pub index_on: i32, pub image_offset_x0: i32, pub image_offset_y0: i32, pub subsampling_dx: i32, pub subsampling_dy: i32, pub decod_format: i32, pub cod_format: i32, pub cp_cinema: u32, pub max_comp_size: i32, pub cp_rsiz: u16, pub tp_on: i8, pub tp_flag: i8, pub tcp_mct: i8, pub jpip_on: i32, pub mct_data: Option<(Vec<f32>, Vec<i32>)>, pub max_cs_size: i32, pub rsiz: u16,
}
Expand description

Safe, owned encoder parameters. The C ABI mirror (EncoderParameters) is marshalled into this by the capi crate; the tools build it directly.

Fields§

§tile_size_on: bool

Size of tiles on by default (true = use cp_tdx x cp_tdy).

§cp_tx0: i32

Origin of the tile grid in x.

§cp_ty0: i32

Origin of the tile grid in y.

§cp_tdx: i32

Tile width.

§cp_tdy: i32

Tile height.

§cp_disto_alloc: i32

Allocation by rate/distortion.

§cp_fixed_alloc: i32

Allocation by fixed layer.

§cp_fixed_quality: i32

Add fixed_quality.

§cp_matrice: Option<Vec<i32>>

Fixed layer allocation matrix.

§cp_comment: Option<Vec<u8>>

Restrict to a comment (COM marker).

§csty: i32

Coding style (see the COD marker).

§prog_order: ProgressionOrder

Progression order.

§pocs: [Poc; 32]

Progression-order changes.

§numpocs: u32

Number of progression-order changes in pocs.

§tcp_numlayers: i32

Number of quality layers.

§tcp_rates: [f32; 100]

Rate of each layer (lossy).

§tcp_distoratio: [f32; 100]

Distortion ratio of each layer.

§numresolution: i32

Number of decomposition levels.

§cblockw_init: i32

Initial code-block width exponent.

§cblockh_init: i32

Initial code-block height exponent.

§mode: i32

Coding mode (LAZY/RESET/TERMALL/VSC/PTERM/SEGSYM bits).

§irreversible: i32

1 = irreversible 9-7, 0 = reversible 5-3.

§roi_compno: i32

Region-of-interest component.

§roi_shift: i32

Region-of-interest shift (0 disables ROI).

§res_spec: i32

Number of precinct sizes.

§prcw_init: [i32; 33]

Precinct widths per resolution.

§prch_init: [i32; 33]

Precinct heights per resolution.

§index_on: i32

Request a codestream index (unused upstream; reserved).

§image_offset_x0: i32

Image offset in x.

§image_offset_y0: i32

Image offset in y.

§subsampling_dx: i32

Component subsampling in x.

§subsampling_dy: i32

Component subsampling in y.

§decod_format: i32

Input file format (J2KFormat; the C’s OPJ_CODEC_* values).

§cod_format: i32

Output file format (J2KFormat; the C’s OPJ_CODEC_* values).

§cp_cinema: u32

Cinema profile mode.

§max_comp_size: i32

Maximum compressed size.

§cp_rsiz: u16

Profile bits (e.g. ColorTransform enables the custom-MCT marker emission).

§tp_on: i8

Write tile-part markers ('R'/'C' style flags).

§tp_flag: i8

Tile-part flag character.

§tcp_mct: i8

Component transform (1 = standard MCT; 2 = custom MCT).

§jpip_on: i32

Write JPIP index boxes (unused upstream; reserved).

§mct_data: Option<(Vec<f32>, Vec<i32>)>

Custom MCT: the decorrelation matrix (row-major, n*n entries) and the per-component DC level shifts. Setting this also sets mct = 2 in the COD marker; the encoder emits the MCT/MCC/MCO markers when rsiz carries the ColorTransform bits.

§max_cs_size: i32

Maximum codestream size.

§rsiz: u16

Profile (RsizCapabilities bits; e.g. ColorTransform enables the custom-MCT marker emission).

Trait Implementations§

Source§

impl Clone for EncoderParameters

Source§

fn clone(&self) -> EncoderParameters

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 EncoderParameters

Source§

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

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

impl Default for EncoderParameters

Source§

fn default() -> EncoderParameters

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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.