Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::canvas::GifReader Class Reference

GIF reader. Decodes GIF87a + GIF89a streams. More...

#include <image_codecs.hpp>

Static Public Member Functions

static std::optional< DecodedRaster > decode_first (const uint8_t *data, std::size_t size)
 Decode just the first frame of the GIF.
static std::optional< std::vector< GifFrame > > decode_all (const uint8_t *data, std::size_t size)
 Decode every frame in order.
static bool is_gif (const uint8_t *data, std::size_t size)
 Quick probe — does the byte stream begin with a GIF87a/89a signature?

Detailed Description

GIF reader. Decodes GIF87a + GIF89a streams.

Member Function Documentation

◆ decode_all()

std::optional< std::vector< GifFrame > > pulp::canvas::GifReader::decode_all ( const uint8_t * data,
std::size_t size )
static

Decode every frame in order.

delay_ms is filled from the Graphic Control Extension when present; absent values default to 100 ms to match common browser behavior.

◆ decode_first()

std::optional< DecodedRaster > pulp::canvas::GifReader::decode_first ( const uint8_t * data,
std::size_t size )
static

Decode just the first frame of the GIF.

Suitable for non-animated image-view consumers that want a single cover. Returns nullopt for malformed input.

◆ is_gif()

bool pulp::canvas::GifReader::is_gif ( const uint8_t * data,
std::size_t size )
static

Quick probe — does the byte stream begin with a GIF87a/89a signature?

Used by the host's encoded-format dispatcher to route to this reader before invoking the (more expensive) full decoder.


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