tinyimg 1.0.0
Lightweight image manipulation library for Cloudflare Workers
Loading...
Searching...
No Matches
TinyImageInfo Struct Reference

What a format's header says about an image, before any pixel is decoded. More...

#include <image.h>

Public Attributes

uint32_t width
uint32_t height
uint32_t frames
TinyImageFormat format
uint8_t channels
uint8_t bit_depth
uint8_t has_alpha
uint8_t progressive

Detailed Description

What a format's header says about an image, before any pixel is decoded.

Filled by tiny_image_probe for every format the library recognizes, including the ones it cannot decode.

Unlike TinyImage, this layout is part of the ABI: the fields are ordered so there is no padding between them, and a host reads them straight out of linear memory at their documented offsets rather than through an accessor apiece. Changing the order or the widths bumps TINYIMG_ABI_VERSION.

Member Data Documentation

◆ bit_depth

uint8_t TinyImageInfo::bit_depth

Bits per channel in the file, before decoding normalizes them to 8.

◆ channels

uint8_t TinyImageInfo::channels

Channels a full decode would produce.

◆ format

TinyImageFormat TinyImageInfo::format

The format the magic bytes identified.

◆ frames

uint32_t TinyImageInfo::frames

Frames the file holds; 1 for a still image.

◆ has_alpha

uint8_t TinyImageInfo::has_alpha

Non-zero when the file carries transparency.

◆ height

uint32_t TinyImageInfo::height

Height in pixels.

◆ progressive

uint8_t TinyImageInfo::progressive

Non-zero for a progressive JPEG, which cannot stream a region.

◆ width

uint32_t TinyImageInfo::width

Width in pixels.


The documentation for this struct was generated from the following file: