|
constexpr | rect (image_type &image, int32_t x_, int32_t y_, int32_t w_, int32_t h_) |
| Construct a rectangle shape.
|
|
constexpr rect & | fill (uint8_t col) |
| Fill the rectangle with a solid color.
|
|
template<typename shader_func>
requires std::is_invocable_r_v<std::array<float, 4>, shader_func, float, float, int32_t, int32_t> |
constexpr auto | fill_shader (const shader_func &shader) -> rect & |
| Fill the rectangle using a shader function.
|
|
constexpr rect & | stroke (uint8_t col, int32_t stroke_width=1) |
| Draw the rectangle outline.
|
|
template<template< size_t, size_t, bool, bool > class T, size_t W, size_t H, bool GRAYSCALE, bool USE_SPAN>
class constixel::shapes::rect< T, W, H, GRAYSCALE, USE_SPAN >
Fluent API for drawing rectangles.
Provides a chainable interface for drawing filled and stroked rectangles.
template<template< size_t, size_t, bool, bool > class T, size_t W, size_t H, bool GRAYSCALE, bool USE_SPAN>
Construct a rectangle shape.
- Parameters
-
image | Target image to draw on |
x_ | X coordinate of top-left corner |
y_ | Y coordinate of top-left corner |
w_ | Width of rectangle |
h_ | Height of rectangle |
template<template< size_t, size_t, bool, bool > class T, size_t W, size_t H, bool GRAYSCALE, bool USE_SPAN>
Fill the rectangle with a solid color.
- Parameters
-
- Returns
- Reference to this rectangle for chaining
template<template< size_t, size_t, bool, bool > class T, size_t W, size_t H, bool GRAYSCALE, bool USE_SPAN>
template<typename shader_func>
requires std::is_invocable_r_v<std::array<float, 4>, shader_func, float, float, int32_t, int32_t>
Fill the rectangle using a shader function.
- Parameters
-
shader | Function that returns RGBA values based on normalized coordinates |
- Returns
- Reference to this rectangle for chaining
template<template< size_t, size_t, bool, bool > class T, size_t W, size_t H, bool GRAYSCALE, bool USE_SPAN>
Draw the rectangle outline.
- Parameters
-
col | Color value |
stroke_width | Width of the stroke (default: 1) |
- Returns
- Reference to this rectangle for chaining