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

#include <image_cache.hpp>

Public Member Functions

 ImageCache ()=default
void set_decoder (ImageDecodeFn fn)
void set_releaser (ImageReleaseFn fn)
void set_byte_budget (std::size_t bytes)
 Soft byte cap.
const DecodedImage * get (const std::string &uri)
 Look up (and decode if absent) the image at uri.
void clear ()
 Drop everything rebuildable.
ImageCacheStats stats () const

Constructor & Destructor Documentation

◆ ImageCache()

pulp::view::ImageCache::ImageCache ( )
default

Member Function Documentation

◆ clear()

void pulp::view::ImageCache::clear ( )

Drop everything rebuildable.

Wired to Processor::on_memory_pressure(Critical) at the host layer.

◆ get()

const DecodedImage * pulp::view::ImageCache::get ( const std::string & uri)

Look up (and decode if absent) the image at uri.

Returns nullptr on decode failure.

◆ set_byte_budget()

void pulp::view::ImageCache::set_byte_budget ( std::size_t bytes)
inline

Soft byte cap.

When insertions push total_bytes past this, LRU entries are evicted until it fits. A cap of 0 disables trimming (useful in tests).

◆ set_decoder()

void pulp::view::ImageCache::set_decoder ( ImageDecodeFn fn)
inline

◆ set_releaser()

void pulp::view::ImageCache::set_releaser ( ImageReleaseFn fn)
inline

◆ stats()

ImageCacheStats pulp::view::ImageCache::stats ( ) const

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