TinyMaterialDesign
Loading...
Searching...
No Matches
Public Member Functions | List of all members
OffsetSurface< RGB_T > Class Template Reference

Draws into target moved up by dy pixels, only inside the rows [clipTop, clipBottom) of target. More...

#include <OffsetSurface.h>

Inheritance diagram for OffsetSurface< RGB_T >:
Inheritance graph
[legend]
Collaboration diagram for OffsetSurface< RGB_T >:
Collaboration graph
[legend]

Public Member Functions

 OffsetSurface (tinygpu::ISurface< RGB_T > &target, int32_t dy, int32_t clipTop, int32_t clipBottom)
 
void setPixel (size_t x, size_t y, RGB_T color) override
 
RGB_T getPixel (size_t x, size_t y) const override
 
bool resizeBuffer (size_t, size_t) override
 
const uint8_t * data () const override
 
size_t size () const override
 

Detailed Description

template<typename RGB_T>
class tinymd::OffsetSurface< RGB_T >

Draws into target moved up by dy pixels, only inside the rows [clipTop, clipBottom) of target.

TinyGPU's drawing primitives take unsigned coordinates, and toPx() clamps negative values to 0: a widget whose top is above the edge of the surface (e.g. scrolled up in a Container) would be drawn at y = 0 with its full height instead of partly hidden. Container draws such a widget through an OffsetSurface: the widget is moved down by dy (so all its coordinates are >= 0) and every pixel is written dy rows higher, where it belongs. Pixel by pixel (via SurfaceBase), so only used for those widgets.

Constructor & Destructor Documentation

◆ OffsetSurface()

OffsetSurface ( tinygpu::ISurface< RGB_T > &  target,
int32_t  dy,
int32_t  clipTop,
int32_t  clipBottom 
)
inline

Member Function Documentation

◆ data()

const uint8_t * data ( ) const
inlineoverride

◆ getPixel()

RGB_T getPixel ( size_t  x,
size_t  y 
) const
inlineoverride

◆ resizeBuffer()

bool resizeBuffer ( size_t  ,
size_t   
)
inlineoverride

◆ setPixel()

void setPixel ( size_t  x,
size_t  y,
RGB_T  color 
)
inlineoverride

◆ size()

size_t size ( ) const
inlineoverride

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