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

image_jpeg.h — optional, memory-only baseline/progressive JPEG codec. More...

#include "image.h"

Functions

int rmgui_image_decode_jpeg (rmgui_fb_t *out, const uint8_t *bytes, size_t length, const rmgui_image_limits_t *limits)
 Decode 8-bit baseline or progressive JPEG into straight RGBA8 (alpha 255).

Variables

const rmgui_image_codec_t rmgui_image_codec_jpeg
 Immutable JPEG descriptor for caller-owned registries; no auto-registration.

Detailed Description

image_jpeg.h — optional, memory-only baseline/progressive JPEG codec.

Function Documentation

◆ rmgui_image_decode_jpeg()

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

Decode 8-bit baseline or progressive JPEG into straight RGBA8 (alpha 255).

EXIF IFD0 orientation 1..8 is applied, including mirrored orientations; malformed/unsupported EXIF metadata is ignored. ICC profiles and EXIF color transforms are not applied. NULL limits selects RMGUI_IMAGE_LIMITS_DEFAULT. Non-NULL limits require positive fields; JPEG dimensions are 16-bit values and stb's signed output byte count limits RGBA pixels to INT_MAX / 4. NULL arguments, length above INT_MAX, incomplete or unsupported JPEG, exceeded limits and allocation failure return -1, leaving *out unchanged. Success returns 0 and transfers an allocation released with rmgui_fb_free; out must not own live pixels. No file I/O or global settings are used. Bytes following a complete EOI are ignored.

Variable Documentation

◆ rmgui_image_codec_jpeg

const rmgui_image_codec_t rmgui_image_codec_jpeg
extern

Immutable JPEG descriptor for caller-owned registries; no auto-registration.