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

Binary clip mask using a packed bit buffer. More...

#include <clip_mask.h>

Public Member Functions

 ClipMask (const roo::byte *data, Box bounds, bool inverted=false)
 Construct a clip mask.
 
template<typename U = uint8_t, typename std::enable_if<!std::is_same< U, roo::byte >::value, int >::type = 0>
 ClipMask (const U *data, Box bounds)
 Deprecated: use the roo::byte* constructor instead.
 
const roo::byte * data () const
 Return raw data buffer.
 
const Boxbounds () const
 Return mask bounds.
 
bool inverted () const
 Return inversion flag.
 
bool isMasked (int16_t x, int16_t y) const
 Return whether a point is masked out.
 
bool isAllMasked (int16_t x, int16_t y, roo::byte mask, uint8_t lines) const
 Return whether all bits in a block are masked.
 
bool isAllUnmasked (int16_t x, int16_t y, roo::byte mask, uint8_t lines) const
 Return whether all bits in a block are unmasked.
 
void setInverted (bool inverted)
 Set inversion behavior.
 

Detailed Description

Binary clip mask using a packed bit buffer.

Each bit represents a pixel within bounds. Rows are byte-aligned. For best performance, align the mask to 8-pixel boundaries in device coordinates.

Definition at line 17 of file clip_mask.h.

Constructor & Destructor Documentation

◆ ClipMask() [1/2]

roo_display::ClipMask::ClipMask ( const roo::byte *  data,
Box  bounds,
bool  inverted = false 
)
inline

Construct a clip mask.

Definition at line 20 of file clip_mask.h.

◆ ClipMask() [2/2]

template<typename U = uint8_t, typename std::enable_if<!std::is_same< U, roo::byte >::value, int >::type = 0>
roo_display::ClipMask::ClipMask ( const U data,
Box  bounds 
)
inline

Deprecated: use the roo::byte* constructor instead.

Definition at line 30 of file clip_mask.h.

Member Function Documentation

◆ bounds()

const Box & roo_display::ClipMask::bounds ( ) const
inline

Return mask bounds.

Definition at line 36 of file clip_mask.h.

Referenced by roo_display::FrontToBackWriter::setAddress().

◆ data()

const roo::byte * roo_display::ClipMask::data ( ) const
inline

Return raw data buffer.

Definition at line 34 of file clip_mask.h.

◆ inverted()

bool roo_display::ClipMask::inverted ( ) const
inline

Return inversion flag.

Definition at line 38 of file clip_mask.h.

Referenced by setInverted().

◆ isAllMasked()

bool roo_display::ClipMask::isAllMasked ( int16_t  x,
int16_t  y,
roo::byte  mask,
uint8_t  lines 
) const
inline

Return whether all bits in a block are masked.

Definition at line 52 of file clip_mask.h.

◆ isAllUnmasked()

bool roo_display::ClipMask::isAllUnmasked ( int16_t  x,
int16_t  y,
roo::byte  mask,
uint8_t  lines 
) const
inline

Return whether all bits in a block are unmasked.

Definition at line 59 of file clip_mask.h.

◆ isMasked()

bool roo_display::ClipMask::isMasked ( int16_t  x,
int16_t  y 
) const
inline

◆ setInverted()

void roo_display::ClipMask::setInverted ( bool  inverted)
inline

Set inversion behavior.

Definition at line 66 of file clip_mask.h.

References inverted().


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