|
tiny-skia-cpp
A C++20 2D rendering library (port of tiny-skia)
|
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< IntRect > | roundOut () const |
| Converts to IntRect by rounding outward (floor left/top, ceil right/bottom). | |
| std::optional< IntRect > | round () const |
| Converts to IntRect by rounding to nearest integer. | |
Static Public Member Functions | |
| static std::optional< Rect > | fromLTRB (float left, float top, float right, float bottom) |
| Creates from edges. Returns nullopt for non-finite, empty, or inverted rects. | |
| static std::optional< Rect > | fromXYWH (float x, float y, float w, float h) |
| Creates from origin and size. Returns nullopt if invalid. | |