CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
host_api_image.cpp File Reference

Image host API: decode PNG/JPEG, scale to a target width and dither into a packed 1-bpp raster via the cdc_image engine. More...

#include "plugin_manager/host_api.h"
#include "cdc_core/Raii.h"
#include "cdc_image/Dither.h"
#include "cdc_image/ImageDecoder.h"
#include "cdc_log.h"
#include <cstring>

Go to the source code of this file.

Functions

int host_image_info (const uint8_t *data, size_t len, uint16_t *out_w, uint16_t *out_h)
 Decode only the image header to get its dimensions.
int host_image_render (const uint8_t *data, size_t len, uint16_t target_w, uint8_t *out, size_t out_size, uint16_t *out_stride_bytes, uint16_t *out_height_px)
 Decode, scale to target_w (aspect preserved) and dither to 1-bpp.

Detailed Description

Image host API: decode PNG/JPEG, scale to a target width and dither into a packed 1-bpp raster via the cdc_image engine.

No capability gate - pure compute on caller-supplied memory. Temporaries live in PSRAM and are bounded by the decoder's 1-megapixel input cap.

Definition in file host_api_image.cpp.