roo_display
API Documentation for roo_display
Loading...
Searching...
No Matches
roo_display::SmoothShape Class Reference

Smooth (anti-aliased) shape rasterizable. More...

#include <smooth.h>

Inheritance diagram for roo_display::SmoothShape:
[legend]
Collaboration diagram for roo_display::SmoothShape:
[legend]

Data Structures

struct  Arc
 
struct  Pixel
 
struct  RoundRect
 
struct  Triangle
 
struct  Wedge
 

Public Member Functions

 SmoothShape ()
 
Box extents () const override
 Return the bounding box encompassing all pixels that need to be drawn.
 
void readColors (const int16_t *x, const int16_t *y, uint32_t count, Color *result) const override
 Read colors for the given points.
 
bool readColorRect (int16_t xMin, int16_t yMin, int16_t xMax, int16_t yMax, Color *result) const override
 Read colors for a rectangle.
 
- Public Member Functions inherited from roo_display::Rasterizable
void readColorsMaybeOutOfBounds (const int16_t *x, const int16_t *y, uint32_t count, Color *result, Color out_of_bounds_color=color::Transparent) const
 Read colors for points that may be out of bounds.
 
std::unique_ptr< PixelStreamcreateStream () const override
 Default createStream() using readColors().
 
std::unique_ptr< PixelStreamcreateStream (const Box &bounds) const override
 Default createStream() for a clipped box using readColors().
 
- Public Member Functions inherited from roo_display::Streamable
virtual TransparencyMode getTransparencyMode () const
 Return the transparency mode for pixels in this stream.
 
- Public Member Functions inherited from roo_display::Drawable
virtual ~Drawable ()
 
virtual Box anchorExtents () const
 Return the bounds used for alignment.
 

Friends

SmoothShape SmoothWedgedLine (FpPoint a, float width_a, FpPoint b, float width_b, Color color, EndingStyle ending_style)
 Create a wedged line with different start/end widths.
 
SmoothShape SmoothThickRoundRect (float x0, float y0, float x1, float y1, float radius, float thickness, Color color, Color interior_color)
 Create an outlined round-rect with thickness.
 
SmoothShape SmoothRotatedFilledRect (FpPoint center, float width, float height, float angle, Color color)
 Create a rotated filled rectangle.
 
SmoothShape SmoothThickArcImpl (FpPoint center, float radius, float thickness, float angle_start, float angle_end, Color active_color, Color inactive_color, Color interior_color, EndingStyle ending_style, bool trim_to_active)
 
SmoothShape SmoothFilledTriangle (FpPoint a, FpPoint b, FpPoint c, Color color)
 Create a filled triangle.
 

Additional Inherited Members

- Static Public Member Functions inherited from roo_display::Drawable
static const DrawableEmpty ()
 A singleton representing a no-op drawable with no bounding box.
 

Detailed Description

Smooth (anti-aliased) shape rasterizable.

Definition at line 91 of file smooth.h.

Constructor & Destructor Documentation

◆ SmoothShape()

roo_display::SmoothShape::SmoothShape ( )

Definition at line 9 of file smooth.cpp.

Member Function Documentation

◆ extents()

Box roo_display::SmoothShape::extents ( ) const
inlineoverridevirtual

Return the bounding box encompassing all pixels that need to be drawn.

This method is called during a transaction and must not block or perform I/O.

Implements roo_display::Drawable.

Definition at line 188 of file smooth.h.

◆ readColorRect()

bool roo_display::SmoothShape::readColorRect ( int16_t  xMin,
int16_t  yMin,
int16_t  xMax,
int16_t  yMax,
Color result 
) const
overridevirtual

Read colors for a rectangle.

Returns true if all colors are identical (then only result[0] is valid). The caller must ensure the rectangle is within bounds.

Reimplemented from roo_display::Rasterizable.

Definition at line 1888 of file smooth.cpp.

References arc_, roo_display::SmoothShape::Pixel::color, pixel_, roo_display::Rasterizable::readColorRect(), round_rect_, and triangle_.

◆ readColors()

void roo_display::SmoothShape::readColors ( const int16_t x,
const int16_t y,
uint32_t  count,
Color result 
) const
overridevirtual

Read colors for the given points.

The caller must ensure all points are within bounds.

Implements roo_display::Rasterizable.

Definition at line 1854 of file smooth.cpp.

References arc_, roo_display::SmoothShape::Pixel::color, pixel_, round_rect_, triangle_, and wedge_.

Friends And Related Symbol Documentation

◆ SmoothFilledTriangle

SmoothShape SmoothFilledTriangle ( FpPoint  a,
FpPoint  b,
FpPoint  c,
Color  color 
)
friend

Create a filled triangle.

Definition at line 454 of file smooth.cpp.

◆ SmoothRotatedFilledRect

SmoothShape SmoothRotatedFilledRect ( FpPoint  center,
float  width,
float  height,
float  angle,
Color  color 
)
friend

Create a rotated filled rectangle.

Definition at line 91 of file smooth.cpp.

◆ SmoothThickArcImpl

SmoothShape SmoothThickArcImpl ( FpPoint  center,
float  radius,
float  thickness,
float  angle_start,
float  angle_end,
Color  active_color,
Color  inactive_color,
Color  interior_color,
EndingStyle  ending_style,
bool  trim_to_active 
)
friend

Definition at line 214 of file smooth.cpp.

◆ SmoothThickRoundRect

SmoothShape SmoothThickRoundRect ( float  x0,
float  y0,
float  x1,
float  y1,
float  radius,
float  thickness,
Color  color,
Color  interior_color 
)
friend

Create an outlined round-rect with thickness.

Definition at line 104 of file smooth.cpp.

◆ SmoothWedgedLine

SmoothShape SmoothWedgedLine ( FpPoint  a,
float  width_a,
FpPoint  b,
float  width_b,
Color  color,
EndingStyle  ending_style 
)
friend

Create a wedged line with different start/end widths.

Definition at line 38 of file smooth.cpp.

Field Documentation

◆ arc_

Arc roo_display::SmoothShape::arc_

Definition at line 240 of file smooth.h.

Referenced by readColorRect(), and readColors().

◆ pixel_

Pixel roo_display::SmoothShape::pixel_

Definition at line 242 of file smooth.h.

Referenced by readColorRect(), and readColors().

◆ round_rect_

RoundRect roo_display::SmoothShape::round_rect_

Definition at line 239 of file smooth.h.

Referenced by readColorRect(), and readColors().

◆ triangle_

Triangle roo_display::SmoothShape::triangle_

Definition at line 241 of file smooth.h.

Referenced by readColorRect(), and readColors().

◆ wedge_

Wedge roo_display::SmoothShape::wedge_

Definition at line 238 of file smooth.h.

Referenced by readColors().


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