constixel
Loading...
Searching...
No Matches
constixel::shapes::round_rect_aa< T, W, H, GRAYSCALE, USE_SPAN > Class Template Reference

Fluent API for drawing anti-aliased rounded rectangles. More...

#include <constixel.hpp>

Public Member Functions

constexpr round_rect_aa (image_type &image, int32_t x_, int32_t y_, int32_t w_, int32_t h_, int32_t radius_)
 Construct an anti-aliased rounded rectangle shape.
 
constexpr round_rect_aafill (uint8_t col)
 Fill the rounded 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) -> round_rect_aa &
 Fill the rounded rectangle using a shader function.
 
constexpr round_rect_aastroke (uint8_t col, int32_t stroke_width=1)
 Draw the rounded rectangle outline.
 

Detailed Description

template<template< size_t, size_t, bool, bool > class T, size_t W, size_t H, bool GRAYSCALE, bool USE_SPAN>
class constixel::shapes::round_rect_aa< T, W, H, GRAYSCALE, USE_SPAN >

Fluent API for drawing anti-aliased rounded rectangles.

Provides a chainable interface for drawing filled and stroked rounded rectangles with anti-aliasing.

Constructor & Destructor Documentation

◆ round_rect_aa()

template<template< size_t, size_t, bool, bool > class T, size_t W, size_t H, bool GRAYSCALE, bool USE_SPAN>
constixel::shapes::round_rect_aa< T, W, H, GRAYSCALE, USE_SPAN >::round_rect_aa ( image_type & image,
int32_t x_,
int32_t y_,
int32_t w_,
int32_t h_,
int32_t radius_ )
inlineconstexpr

Construct an anti-aliased rounded rectangle shape.

Parameters
imageTarget 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
radius_Corner radius

Member Function Documentation

◆ fill()

template<template< size_t, size_t, bool, bool > class T, size_t W, size_t H, bool GRAYSCALE, bool USE_SPAN>
round_rect_aa & constixel::shapes::round_rect_aa< T, W, H, GRAYSCALE, USE_SPAN >::fill ( uint8_t col)
inlineconstexpr

Fill the rounded rectangle with a solid color.

Parameters
colColor value
Returns
Reference to this rounded rectangle for chaining

◆ fill_shader()

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>
auto constixel::shapes::round_rect_aa< T, W, H, GRAYSCALE, USE_SPAN >::fill_shader ( const shader_func & shader) -> round_rect_aa &
inlineconstexpr

Fill the rounded rectangle using a shader function.

Parameters
shaderFunction that returns RGBA values based on normalized coordinates
Returns
Reference to this rounded rectangle for chaining

◆ stroke()

template<template< size_t, size_t, bool, bool > class T, size_t W, size_t H, bool GRAYSCALE, bool USE_SPAN>
round_rect_aa & constixel::shapes::round_rect_aa< T, W, H, GRAYSCALE, USE_SPAN >::stroke ( uint8_t col,
int32_t stroke_width = 1 )
inlineconstexpr

Draw the rounded rectangle outline.

Parameters
colColor value
stroke_widthWidth of the stroke (default: 1)
Returns
Reference to this rounded rectangle for chaining

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