Donner
C++20 SVG rendering library
Loading...
Searching...
No Matches
donner::svg::ImageLoader Class Reference

Utility class for loading images from a URI. More...

#include "donner/svg/resources/ImageLoader.h"

Public Member Functions

 ImageLoader (ResourceLoaderInterface &resourceLoader)
 Create a new image loader that uses the given resource loader to fetch external resources.
 
 ~ImageLoader ()=default
 Destructor.
 
 ImageLoader (const ImageLoader &)=delete
 
 ImageLoader (ImageLoader &&)=delete
 
ImageLoaderoperator= (const ImageLoader &)=delete
 
ImageLoaderoperator= (ImageLoader &&)=delete
 
std::variant< ImageResource, ImageLoaderErrorfromUri (std::string_view uri)
 Read an image from a URI, which can be a file path, a URL, or a data URL (e.g.
 

Detailed Description

Utility class for loading images from a URI.

Constructor & Destructor Documentation

◆ ImageLoader()

donner::svg::ImageLoader::ImageLoader ( ResourceLoaderInterface & resourceLoader)
inlineexplicit

Create a new image loader that uses the given resource loader to fetch external resources.

Parameters
resourceLoaderResource loader to use for fetching external resources.

Member Function Documentation

◆ fromUri()

std::variant< ImageResource, ImageLoaderError > donner::svg::ImageLoader::fromUri ( std::string_view uri)

Read an image from a URI, which can be a file path, a URL, or a data URL (e.g.

"data:image/png;base64,...").

Parameters
uriURI of the image, or data URL containing a base64 embedded image.

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