Data bundle returned with an image loaded to RAM. Used by ImageReader.loadBMP() and Image.draw(), not ImageReader.drawBMP().
More...
#include <Adafruit_ImageReader.h>
|
union { |
GFXcanvas1 * canvas1 |
| Canvas object if 1bpp format.
|
|
GFXcanvas8 * canvas8 |
| Canvas object if 8bpp format.
|
|
GFXcanvas16 * canvas16 |
| Canvas object if 16bpp.
|
|
} | canvas |
| Union of different GFXcanvas types.
|
|
GFXcanvas1 * | mask |
| 1bpp image mask (or NULL)
|
|
uint16_t * | palette |
| Color palette for 8bpp image (or NULL)
|
|
uint8_t | format |
| Canvas bundle type in use.
|
|
Data bundle returned with an image loaded to RAM. Used by ImageReader.loadBMP() and Image.draw(), not ImageReader.drawBMP().
◆ Adafruit_Image()
Adafruit_Image::Adafruit_Image |
( |
void |
| ) |
|
◆ ~Adafruit_Image()
Adafruit_Image::~Adafruit_Image |
( |
void |
| ) |
|
Destructor.
- Returns
- None (void).
◆ width()
int16_t Adafruit_Image::width |
( |
void |
| ) |
const |
Get width of Adafruit_Image object.
- Returns
- Width in pixels, or 0 if no image loaded.
◆ height()
int16_t Adafruit_Image::height |
( |
void |
| ) |
const |
Get height of Adafruit_Image object.
- Returns
- Height in pixels, or 0 if no image loaded.
◆ draw()
void Adafruit_Image::draw |
( |
Adafruit_SPITFT & |
tft, |
|
|
int16_t |
x, |
|
|
int16_t |
y |
|
) |
| |
Draw image to an Adafruit_SPITFT-type display.
- Parameters
-
tft | Screen to draw to (any Adafruit_SPITFT-derived class). |
x | Horizontal offset in pixels; left edge = 0, positive = right. Value is signed, image will be clipped if all or part is off the screen edges. Screen rotation setting is observed. |
y | Vertical offset in pixels; top edge = 0, positive = down. |
- Returns
- None (void).
◆ getFormat()
Return canvas image format.
- Returns
- An ImageFormat type: IMAGE_1 for a GFXcanvas1, IMAGE_8 for a GFXcanvas8, IMAGE_16 for a GFXcanvas16, IMAGE_NONE if no canvas currently allocated.
◆ getCanvas()
void * Adafruit_Image::getCanvas |
( |
void |
| ) |
const |
Return pointer to image's GFX canvas object.
- Returns
- void* pointer, must be type-converted to a GFX canvas type consistent with the image's format (e.g. GFXcanvas16* if image format is IMAGE_16 – use image.format() to determine the image format). Returns NULL if no canvas allocated.
- Note
- Calling function must type-convert the result to one of the supported canvas object types, and must act accordingly with regard to calling functions on this object (e.g. doing the right thing with an 8- or 16-bit canvas, each has distinct drawing functions, things like that). This is here mostly to allow more advanced applications to get directly into an image's canvas object (and, in turn, its raw graphics buffer via canvas->getBuffer()) to move data in or out. Potential for a lot of mayhem here if used wrong.
◆ getPalette()
uint16_t* Adafruit_Image::getPalette |
( |
void |
| ) |
const |
|
inline |
Return pointer to color palette.
- Returns
- Pointer to an array of 16-bit color values, or NULL if no palette associated with image.
◆ getMask()
GFXcanvas1* Adafruit_Image::getMask |
( |
void |
| ) |
const |
|
inline |
Return pointer to 1bpp image mask canvas.
- Returns
- GFXcanvas1* pointer (1-bit RAM-resident image) if present, NULL otherwise.
◆ dealloc()
void Adafruit_Image::dealloc |
( |
void |
| ) |
|
|
protected |
Free/deinitialize variables.
Deallocates memory associated with Adafruit_Image object and resets member variables to 'empty' state.
- Returns
- None (void).
The documentation for this class was generated from the following files: