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

Floating-point rectangle (left, top, right, bottom). All components must be finite, and width/height must be > 0.

#include <tiny_skia/Geom.h>

Public Member Functions

std::optional< IntRectroundOut () const
 Converts to IntRect by rounding outward (floor left/top, ceil right/bottom).
 
std::optional< IntRectround () const
 Converts to IntRect by rounding to nearest integer.
 

Static Public Member Functions

static std::optional< RectfromLTRB (float left, float top, float right, float bottom)
 Creates from edges. Returns nullopt for non-finite, empty, or inverted rects.
 
static std::optional< RectfromXYWH (float x, float y, float w, float h)
 Creates from origin and size. Returns nullopt if invalid.
 

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