|
|
Donner
C++20 SVG rendering library
|
Test utilities for rendering and saving SVGs in tests. More...
#include "donner/svg/renderer/tests/RendererTestUtils.h"
Static Public Member Functions | |
| static std::optional< Image > | readRgbaImageFromPngFile (const char *filename) |
| Read an RGBA image from a PNG file. | |
| static AsciiImage | renderToAsciiImage (std::string_view svgFragment, Vector2i size=kTestSvgDefaultSize) |
| Render the given SVG fragment into ASCII art. | |
| static AsciiImage | renderToAsciiImage (SVGDocument document) |
| Render the given SVGDocument into ASCII art. | |
Test utilities for rendering and saving SVGs in tests.
|
static |
Read an RGBA image from a PNG file.
| filename | Path to a PNG file to load. |
|
inlinestatic |
Render the given SVG fragment into ASCII art.
The generated image is of the given size, and has a black background.
Colors will be mapped to ASCII characters, with @ white all the way to . black, with ten shades of gray.
To compare the generated ASCII image to a golden ASCII string, use matches on the returned AsciiImage object.
Example:
| svgFragment | The SVG fragment to render. |
| size | The size of the generated image. |
|
inlinestatic |
Render the given SVGDocument into ASCII art.
The generated image is of given size, and has a black background.
Colors will be mapped to ASCII characters, with @ white all the way to . black, with ten shades of gray.
To compare the generated ASCII image to a golden ASCII string, use matches on the returned AsciiImage object.
| document | SVG document to render, of max size 64x64. |