tiny-skia-cpp
A C++20 2D rendering library (port of tiny-skia)
Loading...
Searching...
No Matches
tiny_skia::Paint Struct Reference

Controls how a shape is painted (shader, blend mode, anti-aliasing).

#include <tiny_skia/Paint.h>

Public Member Functions

void setColor (const Color &color)
 Sets the shader to a solid color.
 
void setColorRgba8 (std::uint8_t r, std::uint8_t g, std::uint8_t b, std::uint8_t a)
 Sets the shader to a solid color from 8-bit RGBA components.
 
bool isSolidColor () const
 Returns true if the shader is a solid color.
 

Public Attributes

Shader shader = Color::black
 Paint shader source. Default: solid black.
 
BlendMode blendMode = BlendMode::SourceOver
 Blend mode. Default: SourceOver.
 
bool antiAlias = true
 Enable anti-aliased rendering. Default: true.
 
ColorSpace colorspace = ColorSpace::Linear
 Colorspace for gamma-correct blending. Default: Linear.
 
bool forceHqPipeline = false
 Force the high-quality (highp) rendering pipeline. Default: false.
 
bool unpremulStore = false
 Store output as unpremultiplied (straight) alpha. Default: false. When true, the pipeline unpremultiplies in float space before storing to u8, and re-premultiplies loaded destination pixels for correct blending. This preserves color precision at low alpha values.
 

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