NXWidgets  1.19
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
NXWidgets::CRlePaletteBitmap Class Reference

#include <crlepalettebitmap.hxx>

Inheritance diagram for NXWidgets::CRlePaletteBitmap:
Inheritance graph

Public Member Functions

 CRlePaletteBitmap (const struct SRlePaletteBitmap *bitmap)
 
 ~CRlePaletteBitmap (void)
 
const uint8_t getColorFormat (void) const
 
const uint8_t getBitsPerPixel (void) const
 
const nxgl_coord_t getWidth (void) const
 
const nxgl_coord_t getHeight (void) const
 
const size_t getStride (void) const
 
void setSelected (bool selected)
 
bool getRun (nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, FAR void *data)
 
- Public Member Functions inherited from NXWidgets::IBitmap
virtual ~IBitmap (void)
 

Protected Member Functions

void startOfImage (void)
 
bool advancePosition (nxgl_coord_t npixels)
 
bool skipPixels (nxgl_coord_t npixels)
 
bool nextRow (void)
 
bool seekRow (nxgl_coord_t row)
 
void copyColor (nxgl_coord_t npixels, FAR void *data)
 
bool copyPixels (nxgl_coord_t npixels, FAR void *data)
 

Protected Attributes

FAR const struct SRlePaletteBitmapm_bitmap
 
nxgl_coord_t m_row
 
nxgl_coord_t m_col
 
uint8_t m_remaining
 
FAR const void * m_lut
 
FAR const struct SRlePaletteBitmapEntrym_rle
 

Detailed Description

Class providing bitmap accessor for a bitmap represented by SRlePaletteBitmap.

Definition at line 100 of file crlepalettebitmap.hxx.

Constructor & Destructor Documentation

◆ CRlePaletteBitmap()

CRlePaletteBitmap::CRlePaletteBitmap ( const struct SRlePaletteBitmap bitmap)

Constructor.

Parameters
bitmapThe bitmap structure being wrapped.

Definition at line 101 of file crlepalettebitmap.cxx.

◆ ~CRlePaletteBitmap()

NXWidgets::CRlePaletteBitmap::~CRlePaletteBitmap ( void  )
inline

Destructor.

Definition at line 198 of file crlepalettebitmap.hxx.

Member Function Documentation

◆ advancePosition()

bool CRlePaletteBitmap::advancePosition ( nxgl_coord_t  npixels)
protected

Advance position data ahead. Called after npixels have have been consume.

Parameters
npixelsThe number of pixels to advance
Returns
False if this goes beyond the end of the image

Definition at line 243 of file crlepalettebitmap.cxx.

◆ copyColor()

void CRlePaletteBitmap::copyColor ( nxgl_coord_t  npixels,
FAR void *  data 
)
protected

Copy the pixels from the current RLE entry the specified number of times.

Parameters
npixelsThe number of pixels to copy. Must be less than or equal to m_remaining.
dataThe memory location provided by the caller in which to return the data. This should be at least (getWidth()*getBitsPerPixl() + 7)/8 bytes in length and properly aligned for the pixel color format.

Copy the pixels from the current RLE entry the specified number of times.

Parameters
npixelsThe number of pixels to copy. Must be less than or equal to m_remaining (not checked here, must be handled by higher level code).
dataThe memory location provided by the caller in which to return the data. This should be at least (getWidth()*getBitsPerPixl() + 7)/8 bytes in length and properly aligned for the pixel color format.

Definition at line 359 of file crlepalettebitmap.cxx.

◆ copyPixels()

bool CRlePaletteBitmap::copyPixels ( nxgl_coord_t  npixels,
FAR void *  data 
)
protected

Copy pixels from the current position

Parameters
npixelsThe number of pixels to copy
dataThe memory location provided by the caller in which to return the data. This should be at least (getWidth()*getBitsPerPixl() + 7)/8 bytes in length and properly aligned for the pixel color format.
Returns
False if this goes beyond the end of the image

Definition at line 389 of file crlepalettebitmap.cxx.

◆ getBitsPerPixel()

const uint8_t CRlePaletteBitmap::getBitsPerPixel ( void  ) const
virtual

Get the bitmap's color format.

Returns
The bitmap's color format.

Implements NXWidgets::IBitmap.

Definition at line 125 of file crlepalettebitmap.cxx.

◆ getColorFormat()

const uint8_t CRlePaletteBitmap::getColorFormat ( void  ) const
virtual

Get the bitmap's color format.

Returns
The bitmap's width.

Implements NXWidgets::IBitmap.

Definition at line 114 of file crlepalettebitmap.cxx.

◆ getHeight()

const nxgl_coord_t CRlePaletteBitmap::getHeight ( void  ) const
virtual

Get the bitmap's height (in rows).

Returns
The bitmap's height.

Implements NXWidgets::IBitmap.

Definition at line 147 of file crlepalettebitmap.cxx.

◆ getRun()

bool CRlePaletteBitmap::getRun ( nxgl_coord_t  x,
nxgl_coord_t  y,
nxgl_coord_t  width,
FAR void *  data 
)
virtual

Get one row from the bit map image using the selected colors.

Parameters
xThe offset into the row to get
yThe row number to get
widthThe number of pixels to get from the row
dataThe memory location provided by the caller in which to return the data. This should be at least (getWidth()*getBitsPerPixl() + 7)/8 bytes in length and properly aligned for the pixel color format.
Trueif the run was returned successfully.

Get one row from the bit map image using the selected LUT.

Parameters
xThe offset into the row to get
yThe row number to get
widthThe number of pixels to get from the row
dataThe memory location provided by the caller in which to return the data. This should be at least (getWidth()*getBitsPerPixl() + 7)/8 bytes in length and properly aligned for the pixel color format.
Trueif the run was returned successfully.

Implements NXWidgets::IBitmap.

Definition at line 190 of file crlepalettebitmap.cxx.

◆ getStride()

const size_t CRlePaletteBitmap::getStride ( void  ) const
virtual

Get the bitmap's width (in bytes).

Returns
The bitmap's width.

Implements NXWidgets::IBitmap.

Definition at line 158 of file crlepalettebitmap.cxx.

◆ getWidth()

const nxgl_coord_t CRlePaletteBitmap::getWidth ( void  ) const
virtual

Get the bitmap's width (in pixels/columns).

Returns
The bitmap's pixel depth.

Implements NXWidgets::IBitmap.

Definition at line 136 of file crlepalettebitmap.cxx.

◆ nextRow()

bool CRlePaletteBitmap::nextRow ( void  )
protected

Seek to the beginning of the next row

Returns
False if this was the last row of the image

Definition at line 313 of file crlepalettebitmap.cxx.

◆ seekRow()

bool CRlePaletteBitmap::seekRow ( nxgl_coord_t  row)
protected

Seek to the beignning specific row

Parameters
rowThe row number to seek to
Returns
False if this goes beyond the end of the image

Definition at line 324 of file crlepalettebitmap.cxx.

◆ setSelected()

void CRlePaletteBitmap::setSelected ( bool  selected)
virtual

Use the colors associated with a selected image.

Parameters
selected.true: Use colors for a selected widget, false: Use normal (default) colors.

Implements NXWidgets::IBitmap.

Definition at line 172 of file crlepalettebitmap.cxx.

◆ skipPixels()

bool CRlePaletteBitmap::skipPixels ( nxgl_coord_t  npixels)
protected

Seek ahead the specific number of pixels – discarding and advancing.

Parameters
npixelsThe number of pixels to skip
Returns
False if this goes beyond the end of the image

Seek ahead the specific number of pixels – discarding and advancing.

Parameters
npixelsThe number of pixels to skip

Definition at line 277 of file crlepalettebitmap.cxx.

◆ startOfImage()

void CRlePaletteBitmap::startOfImage ( void  )
protected

Reset to the beginning of the image

Definition at line 227 of file crlepalettebitmap.cxx.

Member Data Documentation

◆ m_bitmap

FAR const struct SRlePaletteBitmap* NXWidgets::CRlePaletteBitmap::m_bitmap
protected

The bitmap that is being managedThe bitmap that is being managed

Definition at line 107 of file crlepalettebitmap.hxx.

◆ m_col

nxgl_coord_t NXWidgets::CRlePaletteBitmap::m_col
protected

Logical column number

Definition at line 114 of file crlepalettebitmap.hxx.

◆ m_lut

FAR const void* NXWidgets::CRlePaletteBitmap::m_lut
protected

The selected LUT

Definition at line 116 of file crlepalettebitmap.hxx.

◆ m_remaining

uint8_t NXWidgets::CRlePaletteBitmap::m_remaining
protected

Number of bytes remaining in current entry

Definition at line 115 of file crlepalettebitmap.hxx.

◆ m_rle

FAR const struct SRlePaletteBitmapEntry* NXWidgets::CRlePaletteBitmap::m_rle
protected

RLE entry being processed

Definition at line 117 of file crlepalettebitmap.hxx.

◆ m_row

nxgl_coord_t NXWidgets::CRlePaletteBitmap::m_row
protected

Accessor state dataLogical row number

Definition at line 113 of file crlepalettebitmap.hxx.


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