Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::CA::ca_gif_detail Namespace Reference

Classes

class  Bit_Writer
 
struct  Frame
 

Functions

void put_le16 (std::ostream &out, const std::uint16_t value)
 
std::uint32_t dist2 (const RGB8 a, const RGB8 b) noexcept
 
std::uint8_t palette_index (Array< RGB8 > &palette, const RGB8 c)
 
std::uint8_t lookup_palette_index (const Array< RGB8 > &palette, const RGB8 c) noexcept
 Read-only lookup variant: assumes the palette is already finalised (every colour either present or to be approximated by nearest match) and never mutates it.
 
unsigned ceil_log2 (std::size_t n)
 
Array< std::uint8_t > lzw_bytes (const Array< std::uint8_t > &indices, const unsigned min_code_size)
 
void write_subblocks (std::ostream &out, const Array< std::uint8_t > &bytes)
 
Array< RGB8 > build_palette (const Array< Frame > &frames)
 

Function Documentation

◆ build_palette()

Array< RGB8 > Aleph::CA::ca_gif_detail::build_palette ( const Array< Frame > &  frames)
inline

◆ ceil_log2()

unsigned Aleph::CA::ca_gif_detail::ceil_log2 ( std::size_t  n)
inline

Definition at line 144 of file ca-gif.H.

◆ dist2()

std::uint32_t Aleph::CA::ca_gif_detail::dist2 ( const RGB8  a,
const RGB8  b 
)
inlinenoexcept

Definition at line 86 of file ca-gif.H.

References Aleph::blossom_maximum_cardinality_matching().

Referenced by lookup_palette_index(), and palette_index().

◆ lookup_palette_index()

std::uint8_t Aleph::CA::ca_gif_detail::lookup_palette_index ( const Array< RGB8 > &  palette,
const RGB8  c 
)
inlinenoexcept

Read-only lookup variant: assumes the palette is already finalised (every colour either present or to be approximated by nearest match) and never mutates it.

Used by the per-frame loop in write_gif so the palette does not need to be copied per frame.

Definition at line 123 of file ca-gif.H.

References Aleph::blossom_maximum_cardinality_matching(), and dist2().

◆ lzw_bytes()

Array< std::uint8_t > Aleph::CA::ca_gif_detail::lzw_bytes ( const Array< std::uint8_t > &  indices,
const unsigned  min_code_size 
)
inline

◆ palette_index()

std::uint8_t Aleph::CA::ca_gif_detail::palette_index ( Array< RGB8 > &  palette,
const RGB8  c 
)
inline

Definition at line 94 of file ca-gif.H.

References Aleph::blossom_maximum_cardinality_matching(), and dist2().

Referenced by build_palette().

◆ put_le16()

void Aleph::CA::ca_gif_detail::put_le16 ( std::ostream &  out,
const std::uint16_t  value 
)
inline

Definition at line 80 of file ca-gif.H.

References out, and value.

◆ write_subblocks()

void Aleph::CA::ca_gif_detail::write_subblocks ( std::ostream &  out,
const Array< std::uint8_t > &  bytes 
)
inline

Definition at line 213 of file ca-gif.H.

References Aleph::Array< T >::base(), out, and Aleph::Array< T >::size().