Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: MaximInterface
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:
- 
  width Width in pixels that is >= 1. height Height 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:
- 
  data Array of scanline bitmap data. size Size of data array. width Width 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,y Coordinates to begin clearing at. width,height Dimensions 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:
- 
  x x-coordinate location to overlay. y y-coordinate location to overlay. src Bitmap 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:
- 
  x x-coordinate location to overlay. y y-coordinate location to overlay. data Array of scanline bitmap data. size Size of data array. width Width 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:
- 
  True to 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.
Generated on Tue Jul 12 2022 12:06:50 by
 1.7.2
 1.7.2