Utility class for saving images to disk.
More...
#include "donner/svg/renderer/RendererImageIO.h"
|
| 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.
|
| static std::vector< uint8_t > | writeRgbaPixelsToPngMemory (std::span< const uint8_t > rgbaPixels, int width, int height, size_t strideInPixels=0) |
| | Write raw RGBA pixel data to a PNG in memory.
|
Utility class for saving images to disk.
◆ 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
-
| filename | Filename to save to. |
| rgbaPixels | Span containing RGBA-ordered pixel data. |
| width | Width of the image. |
| height | Height of the image. |
| strideInPixels | Stride in pixels. Defaults to 0, which assumes a stride of width. |
- Returns
- true if the image was written successfully.
◆ writeRgbaPixelsToPngMemory()
| std::vector< uint8_t > donner::svg::RendererImageIO::writeRgbaPixelsToPngMemory |
( |
std::span< const uint8_t > | rgbaPixels, |
|
|
int | width, |
|
|
int | height, |
|
|
size_t | strideInPixels = 0 ) |
|
static |
Write raw RGBA pixel data to a PNG in memory.
- Parameters
-
| rgbaPixels | Span containing RGBA-ordered pixel data. |
| width | Width of the image. |
| height | Height of the image. |
| strideInPixels | Stride in pixels. Defaults to 0, which assumes a stride of width. |
- Returns
- Vector containing the PNG-encoded data.
The documentation for this class was generated from the following files: