Struct WebPPicture

Source
#[repr(C)]
pub struct WebPPicture {
Show 21 fields pub use_argb: c_int, pub colorspace: WebPEncCSP, pub width: c_int, pub height: c_int, pub y: *mut u8, pub u: *mut u8, pub v: *mut u8, pub y_stride: c_int, pub uv_stride: c_int, pub a: *mut u8, pub a_stride: c_int, pub argb: *mut u32, pub argb_stride: c_int, pub writer: WebPWriterFunction, pub custom_ptr: *mut c_void, pub extra_info_type: c_int, pub extra_info: *mut u8, pub stats: *mut WebPAuxStats, pub error_code: WebPEncodingError, pub progress_hook: WebPProgressHook, pub user_data: *mut c_void, /* private fields */
}
Expand description

Main exchange structure (input samples, output bytes, statistics)

Once WebPPictureInit() has been called, it’s ok to make all the INPUT fields (use_argb, y/u/v, argb, …) point to user-owned data, even if WebPPictureAlloc() has been called. Depending on the value use_argb, it’s guaranteed that either *argb or *y/*u/*v content will be kept untouched.

Fields§

§use_argb: c_int

Main flag for encoder selecting between ARGB or YUV input. It is recommended to use ARGB input (*argb, argb_stride) for lossless compression, and YUV input (*y, *u, *v, etc.) for lossy compression since these are the respective native colorspace for these formats.

§colorspace: WebPEncCSP

colorspace: should be YUV420 for now (=Y’CbCr).

§width: c_int

dimensions (less or equal to WEBP_MAX_DIMENSION)

§height: c_int

dimensions (less or equal to WEBP_MAX_DIMENSION)

§y: *mut u8

pointers to luma/chroma planes.

§u: *mut u8

pointers to luma/chroma planes.

§v: *mut u8

pointers to luma/chroma planes.

§y_stride: c_int

luma/chroma strides.

§uv_stride: c_int

luma/chroma strides.

§a: *mut u8

pointer to the alpha plane

§a_stride: c_int

stride of the alpha plane

§argb: *mut u32

Pointer to argb (32 bit) plane.

§argb_stride: c_int

This is stride in pixels units, not bytes.

§writer: WebPWriterFunction

can be NULL

§custom_ptr: *mut c_void

can be used by the writer.

§extra_info_type: c_int

1: intra type, 2: segment, 3: quant 4: intra-16 prediction mode, 5: chroma prediction mode, 6: bit cost, 7: distortion

§extra_info: *mut u8

if not NULL, points to an array of size ((width + 15) / 16) * ((height + 15) / 16) that will be filled with a macroblock map, depending on extra_info_type.

§stats: *mut WebPAuxStats

Pointer to side statistics (updated only if not NULL)

§error_code: WebPEncodingError

Error code for the latest error encountered during encoding

§progress_hook: WebPProgressHook

If not NULL, report progress during encoding.

§user_data: *mut c_void

this field is free to be set to any value and used during callbacks (like progress-report e.g.).

Trait Implementations§

Source§

impl Clone for WebPPicture

Source§

fn clone(&self) -> WebPPicture

Returns a copy of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for WebPPicture

Source§

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

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

impl Copy for WebPPicture

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, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> 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.