DisplayList.h
Go to the documentation of this file.
31 #define DEFINE_RB_COMMAND(cmd, len, ...) uint8_t(uint8_t(DisplayList::Code::command) | (len << 4)), cmd, ##__VA_ARGS__,
55 XX(readStart, 2 + sizeof(void*), "Read data: len, bufptr (first packet after setting address)") \
73 BlendAlpha::blendRGB565(__builtin_bswap16(info.color.value), info.dstptr, info.length, info.color.alpha);
235 DisplayList(AddressWindow& addrWindow, size_t bufferSize) : addrWindow(addrWindow), capacity(bufferSize)
245 DisplayList(AddressWindow& addrWindow, const FSTR::ObjectBase& data) : DisplayList(addrWindow, data.size())
256 DisplayList(AddressWindow& addrWindow, const void* data, size_t length) : DisplayList(addrWindow, length)
403 bool fill(const Rect& rect, PackedColor color, uint8_t bytesPerPixel, FillInfo::Callback callback);
DisplayList(AddressWindow &addrWindow, const FSTR::ObjectBase &data)
Create pre-defined display list from flash data.
Definition: DisplayList.h:245
void(*)(void *parameterData) Callback
Queued callback.
Definition: DisplayList.h:215
static String toString(Code code)
bool writeCommand(uint8_t command, uint32_t data, uint8_t length)
Write command with 1-4 bytes of parameter data.
Definition: DisplayList.h:342
void write(const void *data, uint16_t length)
Write a block of data into the display list buffer.
Definition: DisplayList.h:489
Manages a rectangular area of display memory with position information.
Definition: AddressWindow.h:56
size_t read(size_t offset, void *buffer, size_t count) const
Read contents of a String into RAM.
Definition: ObjectBase.hpp:110
Location and size of rectangular area (x, y, w, h)
Definition: Libraries/Graphics/src/include/Graphics/Types.h:306
uint8_t * getBuffer(uint16_t minBytes, uint16_t &available)
Get some space in the list to write pixel data.
Definition: DisplayList.h:326
uint8_t * getBuffer(uint16_t &available)
Get some space in the list to write pixel data.
Timer2Clock::Ticks< uint32_t > read()
Get elapsed watchdog time since last reset.
bool canLockBuffer()
Enforce maximum number of locked buffers to conserve memory.
Definition: DisplayList.h:409
bool isEmpty() const
Determine if any commands have been stored for execution.
Definition: DisplayList.h:271
bool blockFill(const void *data, uint16_t length, uint32_t repeat)
Perform a block fill operation with repeat, e.g. multiple pixel fill or repeated pattern.
void write(uint8_t c)
Write a byte into the display list buffer.
Definition: DisplayList.h:454
size_t size() const
Get the object data size in bytes.
Definition: ObjectBase.hpp:82
uint16_t size
Number of bytes stored in buffer.
Definition: DisplayList.h:563
Definition: Virtual.h:30
CodeArgLengths
Obtain maximum size for command, not including variable data which may be added.
Definition: DisplayList.h:162
static void callbackRGB565(FillInfo &info)
Definition: DisplayList.h:71
XX(code, arglen, desc)
static uint16_t blendRGB565(uint16_t src, uint16_t dst, uint8_t alpha)
bool require(uint16_t length)
Check if list has space for the given number of bytes.
Definition: DisplayList.h:423
Code getReadCode()
Get the appropriate command code to use for a read operation.
Definition: DisplayList.h:524
static constexpr size_t maxLockedBuffers
Definition: DisplayList.h:558
uint16_t used() const
Get number of bytes stored in buffer.
Definition: DisplayList.h:295
uint16_t freeSpace() const
Get number of bytes remaining in buffer.
Definition: DisplayList.h:279
bool writeCallback(Callback callback, void *params, uint16_t paramLength)
Request a callback.
bool fill(const Rect &rect, PackedColor color, uint8_t bytesPerPixel, FillInfo::Callback callback)
Perform a block fill operation with blending.
bool setPixel(PackedColor color, uint8_t bytesPerPixel, Point pt)
Set a single pixel.
bool writeData(const void *data, uint16_t length)
Add WRITE command plus data.
#define GRAPHICS_DL_COMMAND_LIST(XX)
DisplayList command codes.
Definition: DisplayList.h:46
void internalSetAddrWindow(const Rect &rect)
void read(void *data, uint16_t len)
Read block of data from buffer.
Definition: DisplayList.h:536
bool readMem(void *buffer, uint16_t length)
Read a block of display memory.
void writeVar(uint16_t count)
Write a value using 1 or 2 bytes as required.
Definition: DisplayList.h:500
void prepare(Callback callback, void *param)
Prepare for playback.
Definition: DisplayList.h:443
DisplayList(AddressWindow &addrWindow, size_t bufferSize)
Definition: DisplayList.h:235
Code getWriteCode()
Get the appropriate command code to use for a write operation.
Definition: DisplayList.h:514
bool writeDataBuffer(SharedBuffer &data, size_t offset, uint16_t length)
Add WRITE command plus external data.
void write16(uint16_t c)
Write a value as 2 bytes.
Definition: DisplayList.h:480
bool setAddrWindow(const Rect &rect)
Set window for read/write operations.
uint16_t readOffset() const
Get current read position.
Definition: DisplayList.h:287
const uint8_t * getContent() const
Get read-only pointer to start of buffer.
Definition: DisplayList.h:304
DisplayList(AddressWindow &addrWindow, const void *data, size_t length)
Create initialised display list from RAM data.
Definition: DisplayList.h:256
bool lockBuffer(SharedBuffer &buffer)
Lock a shared buffer by storing a reference to it. This will be released when reset() is called.
void reset()
Reset the display list ready for re-use List MUST NOT be in use!
void writeHeader(Code code, uint16_t length)
Write a Header structure to the buffer.
Definition: DisplayList.h:464