RMGui 0.15.0
C11 retained-mode UI library: layout kernel, style schema, widget painters, fonts, software framebuffer
Loading...
Searching...
No Matches
image_webp.h File Reference

image_webp.h — dependency-free still WebP decoding (VP8, ALPH and VP8L). More...

#include "image.h"

Functions

int rmgui_image_decode_webp (rmgui_fb_t *out, const uint8_t *bytes, size_t length, const rmgui_image_limits_t *limits)
 Decode still WebP from the complete RIFF byte span.

Variables

const rmgui_image_codec_t rmgui_image_codec_webp
 Immutable WebP descriptor for explicit caller-owned registry registration.

Detailed Description

image_webp.h — dependency-free still WebP decoding (VP8, ALPH and VP8L).

The output is tightly packed, straight (not premultiplied) RGBA8, released with rmgui_fb_free(). The shared image.h limits and failure-atomic output contract apply. VP8 dimensions are 14-bit (1..16383); VP8L uses 1..16384. Animation is refused, including ANIM/ANMF chunks without the VP8X animation flag. RIFF framing, chunk padding and canvas dimensions are checked. ICC profiles and EXIF/XMP metadata do not modify pixels.

VP8L and alpha are exact. VP8 uses center-aligned bilinear chroma upsampling and fixed-point BT.601 conversion, within 3 per RGB channel of libwebp's default fancy-upsampled output; alpha matches exactly. Other chroma upsamplers/matrices (including ffmpeg's default conversion of its YUV output) need not fall within this RGB tolerance.

Function Documentation

◆ rmgui_image_decode_webp()

int rmgui_image_decode_webp ( rmgui_fb_t * out,
const uint8_t * bytes,
size_t length,
const rmgui_image_limits_t * limits )

Decode still WebP from the complete RIFF byte span.

NULL limits select the shared defaults; explicit limits require positive fields. Returns 0 with malloc-compatible RGBA pixels transferred to *out (free with rmgui_fb_free), or -1 leaving *out unchanged for NULL arguments, malformed/unsupported input, exceeded limits, unrepresentable byte counts or allocation failure. out must not own live pixels. No file I/O or mutable global state.

Variable Documentation

◆ rmgui_image_codec_webp

const rmgui_image_codec_t rmgui_image_codec_webp
extern

Immutable WebP descriptor for explicit caller-owned registry registration.