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

Utility class for saving images to disk. More...

#include "donner/svg/renderer/RendererImageIO.h"

Static Public Member Functions

static bool writeRgbaPixelsToPngFile (const char *filename, std::span< const uint8_t > rgbaPixels, int width, int height, size_t strideInPixels=0)
 Write raw RGBA pixel data to a PNG file.
 

Detailed Description

Utility class for saving images to disk.

Member Function Documentation

◆ writeRgbaPixelsToPngFile()

bool donner::svg::RendererImageIO::writeRgbaPixelsToPngFile ( const char * filename,
std::span< const uint8_t > rgbaPixels,
int width,
int height,
size_t strideInPixels = 0 )
static

Write raw RGBA pixel data to a PNG file.

Parameters
filenameFilename to save to.
rgbaPixelsSpan containing RGBA-ordered pixel data.
widthWidth of the image.
heightHeight of the image.
strideInPixelsStride in pixels. Defaults to 0, which assumes a stride of width.
Returns
true if the image was written successfully.

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