Crate libwebp_sys

Source

Structs§

WebPAnimDecoderOptionsdemux and 0_5
WebPAnimEncoderOptionsmux and 0_5
WebPAnimInfodemux and 0_5
WebPAuxStats
Structure for storing auxiliary statistics.
WebPBitstreamFeatures
Features gathered from the bitstream
WebPChunkIteratordemux
WebPConfig
Compression parameters.
WebPDatamux or demux
WebPDecBuffer
Output buffer
WebPDecoderConfig
Main object storing the configuration for advanced decoding.
WebPDecoderOptions
Decoding options
WebPIteratordemux
WebPMemoryWriter
WebPMemoryWrite: a special WebPWriterFunction that writes to memory using the following WebPMemoryWriter object (to be set as a custom_ptr).
WebPMuxAnimParamsmux
WebPMuxFrameInfomux
WebPPicture
Main exchange structure (input samples, output bytes, statistics)
WebPRGBABuffer
view as RGBA
WebPYUVABuffer
view as YUVA

Constants§

ALL_VALID_FLAGS(mux or demux) and 0_6
ALPHA_FLAGmux or demux
ANIMATION_FLAGmux or demux
EXIF_FLAGmux or demux
ICCP_FLAGmux or demux
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
picture has invalid width/height
VP8_ENC_ERROR_BAD_WRITE
error while flushing bytes
VP8_ENC_ERROR_BITSTREAM_OUT_OF_MEMORY
memory error while flushing bits
VP8_ENC_ERROR_FILE_TOO_BIG
file is bigger than 4G
VP8_ENC_ERROR_INVALID_CONFIGURATION
configuration is invalid
VP8_ENC_ERROR_LAST
list terminator. always last.
VP8_ENC_ERROR_NULL_PARAMETER
a pointer parameter is NULL
VP8_ENC_ERROR_OUT_OF_MEMORY
memory error allocating objects
VP8_ENC_ERROR_PARTITION0_OVERFLOW
partition is bigger than 512k
VP8_ENC_ERROR_PARTITION_OVERFLOW
partition is bigger than 16M
VP8_ENC_ERROR_USER_ABORT
abort request by user
VP8_ENC_OK
VP8_STATUS_BITSTREAM_ERROR
VP8_STATUS_INVALID_PARAM
VP8_STATUS_NOT_ENOUGH_DATA
VP8_STATUS_OK
VP8_STATUS_OUT_OF_MEMORY
VP8_STATUS_SUSPENDED
VP8_STATUS_UNSUPPORTED_FEATURE
VP8_STATUS_USER_ABORT
WEBP_CHUNK_ALPHAmux
WEBP_CHUNK_ANIMmux
WEBP_CHUNK_ANMFmux
WEBP_CHUNK_DEPRECATEDmux and 0_6
WEBP_CHUNK_EXIFmux
WEBP_CHUNK_ICCPmux
WEBP_CHUNK_IMAGEmux
WEBP_CHUNK_NILmux
WEBP_CHUNK_UNKNOWNmux
WEBP_CHUNK_VP8Xmux
WEBP_CHUNK_XMPmux
WEBP_CSP_ALPHA_BIT
bit that is set if alpha is present
WEBP_CSP_UV_MASK
bit-mask to get the UV sampling factors
WEBP_DECODER_ABI_VERSION
WEBP_DEMUX_ABI_VERSIONdemux
WEBP_DEMUX_DONEdemux
WEBP_DEMUX_PARSED_HEADERdemux
WEBP_DEMUX_PARSE_ERRORdemux
WEBP_DEMUX_PARSING_HEADERdemux
WEBP_ENCODER_ABI_VERSION
WEBP_FF_BACKGROUND_COLORdemux
WEBP_FF_CANVAS_HEIGHTdemux
WEBP_FF_CANVAS_WIDTHdemux
WEBP_FF_FORMAT_FLAGSdemux
WEBP_FF_FRAME_COUNTdemux
WEBP_FF_LOOP_COUNTdemux
WEBP_HINT_DEFAULT
default preset.
WEBP_HINT_GRAPH
Discrete tone image (graph, map-tile etc).
WEBP_HINT_LAST
WEBP_HINT_PHOTO
outdoor photograph, with natural lighting
WEBP_HINT_PICTURE
digital picture, like portrait, inner shot
WEBP_MAX_DIMENSION
WEBP_MUX_ABI_VERSIONmux
WEBP_MUX_BAD_DATAmux
WEBP_MUX_BLENDmux or demux
WEBP_MUX_DISPOSE_BACKGROUNDmux or demux
WEBP_MUX_DISPOSE_NONEmux or demux
WEBP_MUX_INVALID_ARGUMENTmux
WEBP_MUX_MEMORY_ERRORmux
WEBP_MUX_NOT_ENOUGH_DATAmux
WEBP_MUX_NOT_FOUNDmux
WEBP_MUX_NO_BLENDmux or demux
WEBP_MUX_OKmux
WEBP_PRESET_DEFAULT
default preset.
WEBP_PRESET_DRAWING
hand or line drawing, with high-contrast details
WEBP_PRESET_ICON
small-sized colorful images
WEBP_PRESET_PHOTO
outdoor photograph, with natural lighting
WEBP_PRESET_PICTURE
digital picture, like portrait, inner shot
WEBP_PRESET_TEXT
text-like
WEBP_YUV420
4:2:0
WEBP_YUV420A
alpha channel variant
XMP_FLAGmux or demux

Functions§

WEBP_ABI_IS_INCOMPATIBLE
Macro to check ABI compatibility (same major revision number)
WebPAnimDecoderDeletedemux and 0_5
WebPAnimDecoderGetDemuxerdemux and 0_5
WebPAnimDecoderGetInfodemux and 0_5
WebPAnimDecoderGetNextdemux and 0_5
WebPAnimDecoderHasMoreFramesdemux and 0_5
WebPAnimDecoderNewdemux and 0_5
WebPAnimDecoderOptionsInitdemux and 0_5
WebPAnimDecoderResetdemux and 0_5
WebPAnimEncoderAddmux and 0_5
WebPAnimEncoderAssemblemux and 0_5
WebPAnimEncoderDeletemux and 0_5
WebPAnimEncoderDeleteChunkmux and 1_4
WebPAnimEncoderGetChunkmux and 1_4
WebPAnimEncoderGetErrormux and 0_5
WebPAnimEncoderNewmux and 0_5
WebPAnimEncoderOptionsInitmux and 0_5
WebPAnimEncoderSetChunkmux and 1_4
WebPBlendAlpha
Remove the transparency information (if present) by blending the color with the background color background_rgb (specified as 24bit RGB triplet). After this call, all alpha values are reset to 0xff.
WebPCleanupTransparentArea
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).
WebPConfigInit
Should always be called, to initialize a fresh WebPConfig structure before modification. Returns false in case of version mismatch. WebPConfigInit() must have succeeded before using the config object. Note that the default values are lossless=0 and quality=75.
WebPConfigLosslessPreset0_5
Activate the lossless compression mode with the desired efficiency level between 0 (fastest, lowest compression) and 9 (slower, best compression). A good default level is 6, providing a fair tradeoff between compression speed and final compressed size. This function will overwrite several fields from config: method, quality and lossless. Returns false in case of parameter error.
WebPConfigPreset
This function will initialize the configuration according to a predefined set of parameters (referred to by preset) and a given quality factor. This function can be called as a replacement to WebPConfigInit(). Will return false in case of error.
WebPDataClearmux or demux
WebPDataCopymux or demux
WebPDataInitmux or demux
WebPDecode
Non-incremental version. This version decodes the full data at once, taking ‘config’ into account. Returns decoding status (which should be VP8_STATUS_OK if the decoding was successful). Note that ‘config’ cannot be NULL.
WebPDecodeARGB
Same as WebPDecodeRGBA, but returning A, R, G, B, A, R, G, B… ordered data.
WebPDecodeARGBInto
WebPDecodeBGR
Same as WebPDecodeRGB, but returning B, G, R, B, G, R… ordered data.
WebPDecodeBGRA
Same as WebPDecodeRGBA, but returning B, G, R, A, B, G, R, A… ordered data.
WebPDecodeBGRAInto
WebPDecodeBGRInto
WebPDecodeRGB
Same as WebPDecodeRGBA, but returning R, G, B, R, G, B… ordered data. If the bitstream contains transparency, it is ignored.
WebPDecodeRGBA
Decodes WebP images pointed to by ‘data’ and returns RGBA samples, along with the dimensions in *width and *height. The ordering of samples in memory is R, G, B, A, R, G, B, A… in scan order (endian-independent). The returned pointer should be deleted calling WebPFree(). Returns NULL in case of error.
WebPDecodeRGBAInto
WebPDecodeRGBInto
WebPDecodeYUV
Decode WebP images pointed to by ‘data’ to Y’UV format(*). The pointer returned is the Y samples buffer. Upon return, *u and *v will point to the U and V chroma data. These U and V buffers need NOT be passed to WebPFree(), unlike the returned Y luma one. The dimension of the U and V planes are both (*width + 1) / 2 and (*height + 1) / 2. Upon return, the Y buffer has a stride returned as ‘*stride’, while U and V have a common stride returned as ‘uv_stride’. ‘width’ and ‘height’ may be NULL, the other pointers must not be. Returns NULL in case of error. () Also named Y’CbCr. See: https://en.wikipedia.org/wiki/YCbCr
WebPDecodeYUVInto
WebPDecodeYUVInto() is a variant of WebPDecodeYUV() that operates directly into pre-allocated luma/chroma plane buffers. This function requires the strides to be passed: one for the luma plane and one for each of the chroma ones. The size of each plane buffer is passed as ‘luma_size’, ‘u_size’ and ‘v_size’ respectively. Pointer to the luma plane (‘*luma’) is returned or NULL if an error occurred during decoding (or because some buffers were found to be too small).
WebPDemuxdemux
WebPDemuxDeletedemux
WebPDemuxGetChunkdemux
WebPDemuxGetFramedemux
WebPDemuxGetIdemux
WebPDemuxNextChunkdemux
WebPDemuxNextFramedemux
WebPDemuxPartialdemux
WebPDemuxPrevChunkdemux
WebPDemuxPrevFramedemux
WebPDemuxReleaseChunkIteratordemux
WebPDemuxReleaseIteratordemux
WebPEncode
Main encoding call, after config and picture have been initialized. picture must be less than 16384x16384 in dimension (cf WEBP_MAX_DIMENSION), and the config object must be a valid one. Returns false in case of error, true otherwise. In case of error, picture->error_code is updated accordingly. picture can hold the source samples in both YUV(A) or ARGB input, depending on the value of picture->use_argb. It is highly recommended to use the former for lossy encoding, and the latter for lossless encoding (when config.lossless is true). Automatic conversion from one format to another is provided but they both incur some loss.
WebPEncodeBGR
Returns the size of the compressed data (pointed to by *output``), or 0 if an error occurred. The compressed data must be released by the caller using the call WebPFree(*output)`. These functions compress using the lossy format, and the quality_factor can go from 0 (smaller output, lower quality) to 100 (best quality, larger output).
WebPEncodeBGRA
Returns the size of the compressed data (pointed to by *output``), or 0 if an error occurred. The compressed data must be released by the caller using the call WebPFree(*output)`. These functions compress using the lossy format, and the quality_factor can go from 0 (smaller output, lower quality) to 100 (best quality, larger output).
WebPEncodeLosslessBGR
Equivalent to WebPEncodeBGR, but compressing in a lossless manner. Files are usually larger than lossy format, but will not suffer any compression loss. Note these functions, like the lossy versions, use the library’s default settings. For lossless this means exact is disabled. RGB values in transparent areas will be modified to improve compression. To avoid this, use WebPEncode() and set WebPConfig::exact to 1.
WebPEncodeLosslessBGRA
Equivalent to WebPEncodeBGRA, but compressing in a lossless manner. Files are usually larger than lossy format, but will not suffer any compression loss. Note these functions, like the lossy versions, use the library’s default settings. For lossless this means exact is disabled. RGB values in transparent areas will be modified to improve compression. To avoid this, use WebPEncode() and set WebPConfig::exact to 1.
WebPEncodeLosslessRGB
Equivalent to WebPEncodeRGB, but compressing in a lossless manner. Files are usually larger than lossy format, but will not suffer any compression loss. Note these functions, like the lossy versions, use the library’s default settings. For lossless this means exact is disabled. RGB values in transparent areas will be modified to improve compression. To avoid this, use WebPEncode() and set WebPConfig::exact to 1.
WebPEncodeLosslessRGBA
Equivalent to WebPEncodeRGBA, but compressing in a lossless manner. Files are usually larger than lossy format, but will not suffer any compression loss. Note these functions, like the lossy versions, use the library’s default settings. For lossless this means exact is disabled. RGB values in transparent areas will be modified to improve compression. To avoid this, use WebPEncode() and set WebPConfig::exact to 1.
WebPEncodeRGB
Returns the size of the compressed data (pointed to by *output``), or 0 if an error occurred. The compressed data must be released by the caller using the call WebPFree(*output)`. These functions compress using the lossy format, and the quality_factor can go from 0 (smaller output, lower quality) to 100 (best quality, larger output).
WebPEncodeRGBA
Returns the size of the compressed data (pointed to by *output``), or 0 if an error occurred. The compressed data must be released by the caller using the call WebPFree(*output)`. These functions compress using the lossy format, and the quality_factor can go from 0 (smaller output, lower quality) to 100 (best quality, larger output).
WebPFree0_5
Releases memory returned by the WebPDecode*() functions (from decode.h).
WebPFreeDecBuffer
Free any memory associated with the buffer. Must always be called last. Note: doesn’t free the ‘buffer’ structure itself.
WebPGetDecoderVersion
Return the decoder’s version number, packed in hexadecimal using 8bits for each of major/minor/revision. E.g: v2.5.7 is 0x020507.
WebPGetDemuxVersiondemux
WebPGetEncoderVersion
Return the encoder’s version number, packed in hexadecimal using 8bits for each of major/minor/revision. E.g: v2.5.7 is 0x020507.
WebPGetFeatures
Retrieve features from the bitstream. The *features structure is filled with information gathered from the bitstream. Returns VP8_STATUS_OK when the features are successfully retrieved. Returns VP8_STATUS_NOT_ENOUGH_DATA when more data is needed to retrieve the features from headers. Returns error in other cases. Note: The following chunk sequences (before the raw VP8/VP8L data) are considered valid by this function: RIFF + VP8(L) RIFF + VP8X + (optional chunks) + VP8(L) ALPH + VP8 <– Not a valid WebP format: only allowed for internal purpose. VP8(L) <– Not a valid WebP format: only allowed for internal purpose.
WebPGetInfo
Retrieve basic header information: width, height. This function will also validate the header, returning true on success, false otherwise. ‘*width’ and ‘*height’ are only valid on successful return. Pointers ‘width’ and ‘height’ can be passed NULL if deemed irrelevant. Note: The following chunk sequences (before the raw VP8/VP8L data) are considered valid by this function: RIFF + VP8(L) RIFF + VP8X + (optional chunks) + VP8(L) ALPH + VP8 <– Not a valid WebP format: only allowed for internal purpose. VP8(L) <– Not a valid WebP format: only allowed for internal purpose.
WebPGetMuxVersionmux
WebPIAppend
Copies and decodes the next available data. Returns VP8_STATUS_OK when the image is successfully decoded. Returns VP8_STATUS_SUSPENDED when more data is expected. Returns error in other cases.
WebPIDecGetRGB
Returns the RGB/A image decoded so far. Returns NULL if output params are not initialized yet. The RGB/A output type corresponds to the colorspace specified during call to WebPINewDecoder() or WebPINewRGB(). *last_y is the index of last decoded row in raster scan order. Some pointers (*last_y, *width etc.) can be NULL if corresponding information is not needed. The values in these pointers are only valid on successful (non-NULL) return.
WebPIDecGetYUV
Deprecated alpha-less version of WebPIDecGetYUVA(): it will ignore the alpha information (if present). Kept for backward compatibility.
WebPIDecGetYUVA
Same as above function to get a YUVA image. Returns pointer to the luma plane or NULL in case of error. If there is no alpha information the alpha pointer ‘*a’ will be returned NULL.
WebPIDecode
Instantiate a new incremental decoder object with the requested configuration. The bitstream can be passed using ‘data’ and ‘data_size’ parameter, in which case the features will be parsed and stored into config->input. Otherwise, ‘data’ can be NULL and no parsing will occur. Note that ‘config’ can be NULL too, in which case a default configuration is used. If ‘config’ is not NULL, it must outlive the WebPIDecoder object as some references to its fields will be used. No internal copy of ‘config’ is made. The return WebPIDecoder object must always be deleted calling WebPIDelete(). Returns NULL in case of error (and config->status will then reflect the error condition, if available).
WebPIDecodedArea
Generic call to retrieve information about the displayable area. If non NULL, the left/right/width/height pointers are filled with the visible rectangular area so far. Returns NULL in case the incremental decoder object is in an invalid state. Otherwise returns the pointer to the internal representation. This structure is read-only, tied to WebPIDecoder’s lifespan and should not be modified.
WebPIDelete
Deletes the WebPIDecoder object and associated memory. Must always be called if WebPINewDecoder, WebPINewRGB or WebPINewYUV succeeded.
WebPINewDecoder
Creates a new incremental decoder with the supplied buffer parameter. This output_buffer can be passed NULL, in which case a default output buffer is used (with MODE_RGB). Otherwise, an internal reference to ‘output_buffer’ is kept, which means that the lifespan of ‘output_buffer’ must be larger than that of the returned WebPIDecoder object. The supplied ‘output_buffer’ content MUST NOT be changed between calls to WebPIAppend() or WebPIUpdate() unless ‘output_buffer.is_external_memory’ is not set to 0. In such a case, it is allowed to modify the pointers, size and stride of output_buffer.u.RGBA or output_buffer.u.YUVA, provided they remain within valid bounds. All other fields of WebPDecBuffer MUST remain constant between calls. Returns NULL if the allocation failed.
WebPINewRGB
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’. The size of this buffer is at least ‘output_buffer_size’ and the stride (distance in bytes between two scanlines) is specified by ‘output_stride’. Additionally, output_buffer can be passed NULL in which case the output buffer will be allocated automatically when the decoding starts. The colorspace ‘csp’ is taken into account for allocating this buffer. All other parameters are ignored. Returns NULL if the allocation failed, or if some parameters are invalid.
WebPINewYUV
Deprecated version of the above, without the alpha plane. Kept for backward compatibility.
WebPINewYUVA
This function allocates and initializes an incremental-decoder object, which will output the raw luma/chroma samples into a preallocated planes if supplied. The luma plane is specified by its pointer ‘luma’, its size ‘luma_size’ and its stride ‘luma_stride’. Similarly, the chroma-u plane is specified by the ‘u’, ‘u_size’ and ‘u_stride’ parameters, and the chroma-v plane by ‘v’ and ‘v_size’. And same for the alpha-plane. The ‘a’ pointer can be pass NULL in case one is not interested in the transparency plane. Conversely, ‘luma’ can be passed NULL if no preallocated planes are supplied. In this case, the output buffer will be automatically allocated (using MODE_YUVA) when decoding starts. All parameters are then ignored. Returns NULL if the allocation failed or if a parameter is invalid.
WebPIUpdate
A variant of the above function to be used when data buffer contains partial data from the beginning. In this case data buffer is not copied to the internal memory. Note that the value of the ‘data’ pointer can change between calls to WebPIUpdate, for instance when the data buffer is resized to fit larger data.
WebPInitDecBuffer
Initialize the structure as empty. Must be called before any other use. Returns false in case of version mismatch
WebPInitDecoderConfig
Initialize the configuration as empty. This function must always be called first, unless WebPGetFeatures() is to be called. Returns false in case of mismatched version.
WebPIsAlphaMode
WebPIsPremultipliedMode
WebPIsRGBMode
WebPMalloc1_1
Allocates size bytes of memory. Returns NULL upon error. Memory must be deallocated by calling WebPFree(). This function is made available by the core libwebp library.
WebPMemoryWrite
The custom writer to be used with WebPMemoryWriter as custom_ptr. Upon completion, writer.mem and writer.size will hold the coded data. writer.mem must be freed by calling WebPMemoryWriterClear.
WebPMemoryWriterClear0_5
The following must be called to deallocate writer->mem memory. The writer object itself is not deallocated.
WebPMemoryWriterInit
The following must be called first before any use.
WebPMuxAssemblemux
WebPMuxCreatemux
WebPMuxDeletemux
WebPMuxDeleteChunkmux
WebPMuxDeleteFramemux
WebPMuxGetAnimationParamsmux
WebPMuxGetCanvasSizemux
WebPMuxGetChunkmux
WebPMuxGetFeaturesmux
WebPMuxGetFramemux
WebPMuxNewmux
WebPMuxNumChunksmux
WebPMuxPushFramemux
WebPMuxSetAnimationParamsmux
WebPMuxSetCanvasSizemux and 0_5
WebPMuxSetChunkmux
WebPMuxSetImagemux
WebPPictureARGBToYUVA
Converts picture->argb data to the YUV420A format. The colorspace parameter is deprecated and should be equal to WEBP_YUV420. Upon return, picture->use_argb is set to false. The presence of real non-opaque transparent values is detected, and colorspace will be adjusted accordingly. Note that this method is lossy. Returns false in case of error.
WebPPictureARGBToYUVADithered
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). This is useful for photographic picture.
WebPPictureAlloc
Convenience allocation / deallocation based on picture->width/height: Allocate y/u/v buffers as per colorspace/width/height specification. Note! This function will free the previous buffer if needed. Returns false in case of memory error.
WebPPictureCopy
Copy the pixels of *src into *dst, using WebPPictureAlloc. Upon return, *dst will fully own the copied pixels (this is not a view). The dst picture need not be initialized as its content is overwritten. Returns false in case of memory allocation error.
WebPPictureCrop
self-crops a picture to the rectangle defined by top/left/width/height. Returns false in case of memory allocation error, or if the rectangle is outside of the source picture. The rectangle for the view is defined by the top-left corner pixel coordinates (left, top) as well as its width and height. This rectangle must be fully be comprised inside the src source picture. If the source picture uses the YUV420 colorspace, the top and left coordinates will be snapped to even values.
WebPPictureDistortion
Compute PSNR, SSIM or LSIM distortion metric between two pictures. Results are in dB, stored in result[] in the B/G/R/A/All order. The distortion is always performed using ARGB samples. Hence if the input is YUV(A), the picture will be internally converted to ARGB (just for the measurement). Warning: this function is rather CPU-intensive.
WebPPictureFree
Release the memory allocated by WebPPictureAlloc() or WebPPictureImport*(). Note that this function does not free the memory used by the picture object itself. Besides memory (which is reclaimed) all other fields of picture are preserved.
WebPPictureHasTransparency
Scan the picture picture for the presence of non fully opaque alpha values. Returns true in such case. Otherwise returns false (indicating that the alpha plane can be ignored altogether e.g.).
WebPPictureImportBGR
Variants of the above WebPPictureImportRGB, but taking BGR(A|X) input.
WebPPictureImportBGRA
Variants of the above WebPPictureImportRGB, but taking BGR(A|X) input.
WebPPictureImportBGRX
Variants of the above WebPPictureImportRGB, but taking BGR(A|X) input.
WebPPictureImportRGB
Colorspace conversion function to import RGB samples. Previous buffer will be free’d, if any. *rgb buffer should have a size of at least height * rgb_stride. Returns false in case of memory error.
WebPPictureImportRGBA
Same as WebPPictureImportRGB, but for RGBA buffer.
WebPPictureImportRGBX
Same as WebPPictureImportRGB, but for RGBA buffer. Imports the RGB direct from the 32-bit format input buffer ignoring the alpha channel. Avoids needing to copy the data to a temporary 24-bit RGB buffer to import the RGB only.
WebPPictureInit
Should always be called, to initialize the structure. Returns false in case of version mismatch. WebPPictureInit() must have succeeded before using the picture object. Note that, by default, use_argb is false and colorspace is WEBP_YUV420.
WebPPictureIsView
Returns true if the picture is actually a view and therefore does not own the memory for pixels.
WebPPictureRescale
Rescale a picture to new dimension width x height. If either width or height (but not both) is 0 the corresponding dimension will be calculated preserving the aspect ratio. No gamma correction is applied. Returns false in case of error (invalid parameter or insufficient memory).
WebPPictureSharpARGBToYUVA0_6
Performs sharp RGBA->YUVA420 downsampling and colorspace conversion Downsampling is handled with extra care in case of color clipping. This method is roughly 2x slower than WebPPictureARGBToYUVA() but produces better and sharper YUV representation. Returns false in case of error.
WebPPictureSmartARGBToYUVA0_5
kept for backward compatibility:
WebPPictureView
Extracts a view from src picture into dst. The rectangle for the view is defined by the top-left corner pixel coordinates (left, top) as well as its width and height. This rectangle must be fully be comprised inside the src source picture. If the source picture uses the YUV420 colorspace, the top and left coordinates will be snapped to even values. Picture src must out-live dst picture. Self-extraction of view is allowed (src equal to dst) as a mean of fast-cropping (but note that doing so, the original dimension will be lost). Picture dst need not be initialized with WebPPictureInit() if it is different from src, since its content will be overwritten. Returns false in case of invalid parameters.
WebPPictureYUVAToARGB
Converts picture->yuv to picture->argb and sets picture->use_argb to true. The input format must be YUV_420 or YUV_420A. The conversion from YUV420 to ARGB incurs a small loss too. Note that the use of this colorspace is discouraged if one has access to the raw ARGB samples, since using YUV420 is comparatively lossy. Returns false in case of error.
WebPPlaneDistortion0_6
Compute the single distortion for packed planes of samples. src will be compared to ref, and the raw distortion stored into *distortion. The refined metric (log(MSE), log(1 - ssim),…) will be stored in *result. x_step is the horizontal stride (in bytes) between samples. src/ref_stride is the byte distance between rows. Returns false in case of error (bad parameter, memory allocation error, …).
WebPValidateConfig
Returns true if config is non-NULL and all configuration parameters are within their valid ranges.

Type Aliases§

VP8StatusCode
Enumeration of the status codes
WEBP_CSP_MODE
WebPChunkIdmux
WebPDemuxStatedemux
WebPEncCSP
Color spaces.
WebPEncodingError
Encoding error conditions.
WebPFeatureFlagsmux or demux
WebPFormatFeaturedemux
WebPImageHint
Image characteristics hint for the underlying encoder.
WebPMuxAnimBlendmux or demux
WebPMuxAnimDisposemux or demux
WebPMuxErrormux
WebPPreset
Enumerate some predefined settings for WebPConfig, depending on the type of source picture. These presets are used when calling WebPConfigPreset().
WebPProgressHook
Progress hook, called from time to time to report progress. It can return false to request an abort of the encoding process, or true otherwise if everything is OK.
WebPWriterFunction
Signature for output function. Should return true if writing was successful. data/data_size is the segment of data to write, and picture is for reference (and so one can make use of picture->custom_ptr).

Unions§

__WebPDecBufferUnion

Foreign Types§

WebPAnimDecoderdemux and 0_5
WebPAnimEncoder0_5
WebPDemuxerdemux
WebPIDecoder
WebPMuxmux