Expand description
libwebp
FFI.
Constants§
- MODE_
ARGB - MODE_
Argb - MODE_
BGR - MODE_
BGRA - MODE_
LAST - MODE_
RGB - MODE_
RGBA - MODE_
RGBA_ 4444 - MODE_
RGB_ 565 - MODE_
YUV - MODE_
YUVA - MODE_
bgrA - MODE_
rgbA - MODE_
rgbA_ 4444 - VP8_
ENC_ ERROR_ BAD_ DIMENSION - VP8_
ENC_ ERROR_ BAD_ WRITE - VP8_
ENC_ ERROR_ BITSTREAM_ OUT_ OF_ MEMORY - VP8_
ENC_ ERROR_ FILE_ TOO_ BIG - VP8_
ENC_ ERROR_ INVALID_ CONFIGURATION - VP8_
ENC_ ERROR_ LAST - VP8_
ENC_ ERROR_ NULL_ PARAMETER - VP8_
ENC_ ERROR_ OUT_ OF_ MEMORY - VP8_
ENC_ ERROR_ PARTITIO N0_ OVERFLOW - VP8_
ENC_ ERROR_ PARTITION_ OVERFLOW - VP8_
ENC_ ERROR_ USER_ ABORT - VP8_
ENC_ OK - WEBP_
CSP_ ALPHA_ BIT - WEBP_
CSP_ UV_ MASK - WEBP_
DECODER_ ABI_ VERSION - WEBP_
ENCODER_ ABI_ VERSION - WEBP_
HINT_ DEFAULT - WEBP_
HINT_ GRAPH - WEBP_
HINT_ LAST - WEBP_
HINT_ PHOTO - WEBP_
HINT_ PICTURE - WEBP_
MAX_ DIMENSION - WEBP_
PRESET_ DEFAULT - WEBP_
PRESET_ DRAWING - WEBP_
PRESET_ ICON - WEBP_
PRESET_ PHOTO - WEBP_
PRESET_ PICTURE - WEBP_
PRESET_ TEXT - WEBP_
YUV420 - WEBP_
YUV420A
Functions§
- webp_
blend_ ⚠alpha - webp_
cleanup_ ⚠transparent_ area - Helper function: given a width x height plane of RGBA or YUV(A) samples clean-up or smoothen the YUV or RGB samples under fully transparent area, to help compressibility (no guarantee, though).
- webp_
config_ ⚠init - Should always be called, to initialize a fresh WebPConfig structure before modification.
- webp_
config_ ⚠init_ internal - Internal, version-checked, entry point
- webp_
config_ ⚠lossless_ preset - Activate the lossless compression mode with the desired efficiency level between 0 (fastest, lowest compression) and 9 (slower, best compression).
- webp_
config_ ⚠preset - This function will initialize the configuration according to a predefined set of parameters (referred to by ‘preset’) and a given quality factor.
- webp_
decode ⚠ - Non-incremental version. This version decodes the full data at once, taking ‘config’ into account.
- webp_
decode_ ⚠argb - Same as WebPDecodeRGBA, but returning A, R, G, B, A, R, G, B… ordered data.
- webp_
decode_ ⚠argb_ into - webp_
decode_ ⚠bgr - Same as WebPDecodeRGB, but returning B, G, R, B, G, R… ordered data.
- webp_
decode_ ⚠bgr_ into - webp_
decode_ ⚠bgra - Same as WebPDecodeRGBA, but returning B, G, R, A, B, G, R, A… ordered data.
- webp_
decode_ ⚠rgb - Same as WebPDecodeRGBA, but returning R, G, B, R, G, B… ordered data. If the bitstream contains transparency, it is ignored.
- webp_
decode_ ⚠rgb_ into - RGB and BGR variants. Here too the transparency information, if present, will be dropped and ignored.
- webp_
decode_ ⚠rgba - Decodes WebP images pointed to by ‘data’ and returns RGBA samples, along with the dimensions in *width and *height.
- webp_
decode_ ⚠rgba_ into - These five functions are variants of the above ones, that decode the image directly into a pre-allocated buffer ‘output_buffer’.
- webp_
decode_ ⚠yuv - Decode WebP images pointed to by ‘data’ to Y’UV format(*).
- webp_
decode_ ⚠yuv_ into - WebPDecodeYUVInto() is a variant of WebPDecodeYUV() that operates directly into pre-allocated luma/chroma plane buffers.
- webp_
decodebgra_ ⚠into - webp_
encode ⚠ - Main call
- webp_
encode_ ⚠bgr - One-stop-shop call! No questions asked:
- webp_
encode_ ⚠bgra - One-stop-shop call! No questions asked:
- webp_
encode_ ⚠lossless_ bgr - One-stop-shop call! No questions asked:
- webp_
encode_ ⚠lossless_ bgra - One-stop-shop call! No questions asked:
- webp_
encode_ ⚠lossless_ rgb - One-stop-shop call! No questions asked:
- webp_
encode_ ⚠lossless_ rgba - One-stop-shop call! No questions asked:
- webp_
encode_ ⚠rgb - One-stop-shop call! No questions asked:
- webp_
encode_ ⚠rgba - One-stop-shop call! No questions asked:
- webp_
free ⚠ - Releases memory returned by the WebPDecode*() functions (from decode.h).
- webp_
free_ ⚠dec_ buffer - Free any memory associated with the buffer. Must always be called last.
- webp_
get_ ⚠decoder_ version - Return the decoder’s version number, packed in hexadecimal using 8bits for each of major/minor/revision.
- webp_
get_ ⚠encoder_ version - Return the encoder’s version number, packed in hexadecimal using 8bits for each of major/minor/revision.
- webp_
get_ ⚠features_ internal - Internal, version-checked, entry point.
- webp_
get_ ⚠info - Retrieve basic header information: width, height.
- webp_
iappend ⚠ - Copies and decodes the next available data.
- webp_
idec_ ⚠get_ rgb - Returns the RGB/A image decoded so far.
- webp_
idec_ ⚠get_ yuva - Same as above function to get a YUVA image.
- webp_
idecode ⚠ - Instantiate a new incremental decoder object with the requested configuration.
- webp_
idecoded_ ⚠area - Generic call to retrieve information about the displayable area.
- webp_
idelete ⚠ - Deletes the WebPIDecoder object and associated memory.
- webp_
inew_ ⚠decoder - Creates a new incremental decoder with the supplied buffer parameter.
- webp_
inew_ ⚠rgb - This function allocates and initializes an incremental-decoder object, which will output the RGB/A samples specified by ‘csp’ into a preallocated buffer ‘output_buffer’.
- webp_
inew_ ⚠yuv - Deprecated version of the above, without the alpha plane.
- webp_
inew_ ⚠yuva - This function allocates and initializes an incremental-decoder object, which will output the raw luma/chroma samples into a preallocated planes if supplied.
- webp_
init_ ⚠dec_ buffer_ internal - Internal, version-checked, entry point
- webp_
init_ ⚠decoder_ config_ internal - Internal, version-checked, entry point
- webp_
iupdate ⚠ - A variant of the above function to be used when data buffer contains partial data from the beginning.
- webp_
memory_ ⚠write - WebPMemoryWrite: a special WebPWriterFunction that writes to memory using the following WebPMemoryWriter object (to be set as a custom_ptr).
- webp_
memory_ ⚠writer_ clear - The following must be called to deallocate writer->mem memory.
- webp_
memory_ ⚠writer_ init - The following must be called first before any use.
- webp_
picture_ ⚠alloc - Convenience allocation / deallocation based on picture->width/height
- webp_
picture_ ⚠argb_ to_ yuva - Converts picture->argb data to the YUV420A format.
- webp_
picture_ ⚠argb_ to_ yuva_ dithered - Same as WebPPictureARGBToYUVA(), but the conversion is done using pseudo-random dithering with a strength ‘dithering’ between 0.0 (no dithering) and 1.0 (maximum dithering).
- webp_
picture_ ⚠copy - Copy the pixels of *src into *dst, using WebPPictureAlloc.
- webp_
picture_ ⚠crop - self-crops a picture to the rectangle defined by top/left/width/height.
- webp_
picture_ ⚠distortion - Compute PSNR, SSIM or LSIM distortion metric between two pictures.
- webp_
picture_ ⚠free - Release the memory allocated by WebPPictureAlloc() or WebPPictureImport*().
- webp_
picture_ ⚠has_ transparency - Scan the picture ‘picture’ for the presence of non fully opaque alpha values.
- webp_
picture_ ⚠import_ bgr - webp_
picture_ ⚠import_ bgra - webp_
picture_ ⚠import_ bgrx - webp_
picture_ ⚠import_ rgb - Colorspace conversion function to import RGB samples.
- webp_
picture_ ⚠import_ rgba - Same as
webp_picture_import_rgb
, but for RGBA buffer. - webp_
picture_ ⚠import_ rgbx - Imports the RGB direct from the 32-bit format input buffer ignoring the alpha channel.
- webp_
picture_ ⚠init - Should always be called, to initialize the structure.
- webp_
picture_ ⚠init_ internal - Internal, version-checked, entry point
- webp_
picture_ ⚠is_ view - Returns true if the ‘picture’ is actually a view and therefore does not own the memory for pixels.
- webp_
picture_ ⚠rescale - Rescale a picture to new dimension width x height.
- webp_
picture_ ⚠sharp_ argb_ to_ yuva - Performs ‘sharp’ RGBA->YUVA420 downsampling and colorspace conversion.
- webp_
picture_ ⚠smart_ argb_ to_ yuva - kept for backward compatibility
- webp_
picture_ ⚠view - Extracts a view from ‘src’ picture into ‘dst’.
- webp_
picture_ ⚠yuva_ to_ argb - Converts picture->yuv to picture->argb and sets picture->use_argb to true.
- webp_
plane_ ⚠distortion - Compute the single distortion for packed planes of samples.
- webp_
validate_ ⚠config - Returns true if ‘config’ is non-NULL and all configuration parameters are within their valid ranges.
Type Aliases§
- VP8Status
Code - Enumeration of the status codes.
- WebP
AuxStats - Structure for storing auxiliary statistics.
- WebP
Bitstream Features - Features gathered from the bitstream.
- WebPCSP
Mode - Colorspaces.
- WebP
Config - Compression parameters.
- WebP
DecBuffer - WebPDecBuffer: Generic structure for describing the output sample buffer.
- WebP
Decoder Config - Main object storing the configuration for advanced decoding.
- WebP
Decoder Options - Decoding options
- WebP
EncCSP - Color spaces.
- WebP
Encoding Error - Encoding error conditions.
- WebPI
Decoder - WebP
Image Hint - Image characteristics hint for the underlying encoder.
- WebP
Memory Writer - WebPMemoryWrite: a special WebPWriterFunction that writes to memory using the following WebPMemoryWriter object (to be set as a custom_ptr).
- WebP
Picture - Main exchange structure (input samples, output bytes, statistics)
- WebP
Preset - Enumerate some predefined settings for WebPConfig, depending on the type of source picture.
- WebP
Progress Hook - Progress hook, called from time to time to report progress.
- WebPRGBA
Buffer - WebPDecBuffer: Generic structure for describing the output sample buffer.
- WebP
Writer Function - Signature for output function.
- WebPYUVA
Buffer - WebPDecBuffer: Generic structure for describing the output sample buffer.