Adafruit ImageReader Library
Public Member Functions | List of all members
Adafruit_ImageReader_EPD Class Reference

An optional adjunct to Adafruit_EPD that reads RGB BMP images (maybe others in the future) from a flash filesystem (SD card or SPI/QSPI flash). It's purposefully been made an entirely separate class (rather than part of SPITFT or GFX classes) so that Arduino code that uses GFX or SPITFT without image loading does not need to incur the RAM overhead and additional dependencies of the Adafruit_SPIFlash library by its mere inclusion. The syntaxes can therefore be a bit bizarre (passing display object as an argument), see examples for use. More...

#include <Adafruit_ImageReader_EPD.h>

Inheritance diagram for Adafruit_ImageReader_EPD:
Adafruit_ImageReader

Public Member Functions

 Adafruit_ImageReader_EPD (FatVolume &fs)
 Constructor. More...
 
ImageReturnCode drawBMP (char *filename, Adafruit_EPD &epd, int16_t x, int16_t y, boolean transact=true)
 Loads BMP image file from SD card directly to Adafruit_EPD screen. More...
 
- Public Member Functions inherited from Adafruit_ImageReader
 Adafruit_ImageReader (FatVolume &fs)
 Constructor. More...
 
 ~Adafruit_ImageReader (void)
 Destructor. More...
 
ImageReturnCode drawBMP (const char *filename, Adafruit_SPITFT &tft, int16_t x, int16_t y, boolean transact=true)
 Loads BMP image file from SD card directly to SPITFT screen. More...
 
ImageReturnCode loadBMP (const char *filename, Adafruit_Image &img)
 Loads BMP image file from SD card into RAM (as one of the GFX canvas object types) for use with the bitmap-drawing functions. Not practical for most AVR microcontrollers, but some of the more capable 32-bit micros can afford some RAM for this. More...
 
ImageReturnCode bmpDimensions (const char *filename, int32_t *w, int32_t *h)
 Query pixel dimensions of BMP image file on SD card. More...
 
void printStatus (ImageReturnCode stat, Stream &stream=Serial)
 Print human-readable status message corresponding to an ImageReturnCode type. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Adafruit_ImageReader
ImageReturnCode coreBMP (const char *filename, Adafruit_SPITFT *tft, uint16_t *dest, int16_t x, int16_t y, Adafruit_Image *img, boolean transact)
 BMP-reading function common both to the draw function (to TFT) and load function (to canvas object in RAM). BMP code has been centralized here so if/when more BMP format variants are added in the future, it doesn't need to be implemented, debugged and kept in sync in two places. More...
 
uint16_t readLE16 (void)
 Reads a little-endian 16-bit unsigned value from currently- open File, converting if necessary to the microcontroller's native endianism. (BMP files use little-endian values.) More...
 
uint32_t readLE32 (void)
 Reads a little-endian 32-bit unsigned value from currently- open File, converting if necessary to the microcontroller's native endianism. (BMP files use little-endian values.) More...
 
- Protected Attributes inherited from Adafruit_ImageReader
FatVolume * filesys
 FAT FileSystem Object.
 
File32 file
 Current Open file.
 

Detailed Description

An optional adjunct to Adafruit_EPD that reads RGB BMP images (maybe others in the future) from a flash filesystem (SD card or SPI/QSPI flash). It's purposefully been made an entirely separate class (rather than part of SPITFT or GFX classes) so that Arduino code that uses GFX or SPITFT without image loading does not need to incur the RAM overhead and additional dependencies of the Adafruit_SPIFlash library by its mere inclusion. The syntaxes can therefore be a bit bizarre (passing display object as an argument), see examples for use.

Constructor & Destructor Documentation

◆ Adafruit_ImageReader_EPD()

Adafruit_ImageReader_EPD::Adafruit_ImageReader_EPD ( FatVolume &  fs)

Constructor.

Returns
Adafruit_ImageReader object.
Parameters
fsFAT filesystem associated with this Adafruit_ImageReader instance. Any images to load will come from this filesystem; if multiple filesystems are required, each will require its own Adafruit_ImageReader object. The filesystem does NOT need to be initialized yet when passed in here (since this will often be in pre-setup() declaration, but DOES need initializing before any of the image loading or size functions are called!

Member Function Documentation

◆ drawBMP()

ImageReturnCode Adafruit_ImageReader_EPD::drawBMP ( char *  filename,
Adafruit_EPD &  epd,
int16_t  x,
int16_t  y,
boolean  transact = true 
)

Loads BMP image file from SD card directly to Adafruit_EPD screen.

Parameters
filenameName of BMP image file to load.
epdScreen to draw to (any Adafruit_EPD-derived class).
xHorizontal 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.
yVertical offset in pixels; top edge = 0, positive = down.
transactPass 'true' if TFT and SD are on the same SPI bus, in which case SPI transactions are necessary. If separate peripherals, can pass 'false'.
Returns
One of the ImageReturnCode values (IMAGE_SUCCESS on successful completion, other values on failure).

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