Maxim Integrated / Mbed OS MAXREFDES155#

Dependencies:   MaximInterface

Embed: (wiki syntax)

« Back to documentation index

Bitmap Class Reference

Bitmap Class Reference

Stores a black and white bitmap image. More...

#include <Bitmap.hpp>

Public Member Functions

 Bitmap (int width, int height)
 Construct a zero-initialized bitmap with specified dimensions.
 Bitmap (const uint8_t *data, size_t size, int width)
 Load bitmap from a byte array.
int width () const
 Width in pixels.
int height () const
 Height in pixels.
bool pixelEnabled (int x, int y) const
 Check if a pixel is enabled (black).
void setPixelEnabled (int x, int y, bool enabled)
 Enable or disable a pixel.
void overlay (int x, int y, const Bitmap &src)
 Overlay another bitmap on top of this bitmap.
void overlay (int x, int y, const uint8_t *data, size_t size, int width)
 Overlay bitmap data from a byte array on top of this bitmap.
void clear ()
 Reset to initial state.
void clear (int x, int y, int width, int height)
 Reset region to initial state.

Detailed Description

Stores a black and white bitmap image.

Definition at line 41 of file Bitmap.hpp.


Constructor & Destructor Documentation

Bitmap ( int  width,
int  height 
)

Construct a zero-initialized bitmap with specified dimensions.

Parameters:
widthWidth in pixels that is >= 1.
heightHeight in pixels that is >= 1.

Definition at line 60 of file Bitmap.cpp.

Bitmap ( const uint8_t *  data,
size_t  size,
int  width 
)

Load bitmap from a byte array.

Parameters:
dataArray of scanline bitmap data.
sizeSize of data array.
widthWidth of loaded image in pixels that is >= 1.

Definition at line 65 of file Bitmap.cpp.


Member Function Documentation

void clear (  )

Reset to initial state.

Definition at line 120 of file Bitmap.cpp.

void clear ( int  x,
int  y,
int  width,
int  height 
)

Reset region to initial state.

Parameters:
x,yCoordinates to begin clearing at.
width,heightDimensions of the cleared region.

Definition at line 122 of file Bitmap.cpp.

int height (  ) const

Height in pixels.

Definition at line 58 of file Bitmap.hpp.

void overlay ( int  x,
int  y,
const Bitmap src 
)

Overlay another bitmap on top of this bitmap.

Parameters:
xx-coordinate location to overlay.
yy-coordinate location to overlay.
srcBitmap to overlay.

Definition at line 116 of file Bitmap.cpp.

void overlay ( int  x,
int  y,
const uint8_t *  data,
size_t  size,
int  width 
)

Overlay bitmap data from a byte array on top of this bitmap.

Parameters:
xx-coordinate location to overlay.
yy-coordinate location to overlay.
dataArray of scanline bitmap data.
sizeSize of data array.
widthWidth of overlayed image in pixels that is >= 1.

Definition at line 93 of file Bitmap.cpp.

bool pixelEnabled ( int  x,
int  y 
) const

Check if a pixel is enabled (black).

Returns:
True if the pixel is enabled or false if the coordinate is out of range.

Definition at line 72 of file Bitmap.cpp.

void setPixelEnabled ( int  x,
int  y,
bool  enabled 
)

Enable or disable a pixel.

Parameters:
Trueto set to black. False to set to white.

Definition at line 81 of file Bitmap.cpp.

int width (  ) const

Width in pixels.

Definition at line 55 of file Bitmap.hpp.