#[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_intMain 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: WebPEncCSPcolorspace: should be YUV420 for now (=Y’CbCr).
width: c_intdimensions (less or equal to WEBP_MAX_DIMENSION)
height: c_intdimensions (less or equal to WEBP_MAX_DIMENSION)
y: *mut u8pointers to luma/chroma planes.
u: *mut u8pointers to luma/chroma planes.
v: *mut u8pointers to luma/chroma planes.
y_stride: c_intluma/chroma strides.
uv_stride: c_intluma/chroma strides.
a: *mut u8pointer to the alpha plane
a_stride: c_intstride of the alpha plane
argb: *mut u32Pointer to argb (32 bit) plane.
argb_stride: c_intThis is stride in pixels units, not bytes.
writer: WebPWriterFunctioncan be NULL
custom_ptr: *mut c_voidcan be used by the writer.
extra_info_type: c_int1: intra type, 2: segment, 3: quant 4: intra-16 prediction mode, 5: chroma prediction mode, 6: bit cost, 7: distortion
extra_info: *mut u8if 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 WebPAuxStatsPointer to side statistics (updated only if not NULL)
error_code: WebPEncodingErrorError code for the latest error encountered during encoding
progress_hook: WebPProgressHookIf not NULL, report progress during encoding.
user_data: *mut c_voidthis 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
impl Clone for WebPPicture
Source§fn clone(&self) -> WebPPicture
fn clone(&self) -> WebPPicture
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more