ManyBlockAllocator
This class is partial framebuffer allocator using multiple blocks. New buffers can be allocated until no free blocks are available. After transfer to LCD, a block is queued for allocation again.
See: FrameBufferAllocator
Inherits from: FrameBufferAllocator
Public Functions
| virtual uint16_t | allocateBlock(const uint16_t x, const uint16_t y, const uint16_t width, const uint16_t height, uint8_t ** block) |
| Allocates a framebuffer block. | |
| virtual void | freeBlockAfterTransfer() |
| Free a block after transfer to the LCD. | |
| virtual const uint8_t * | getBlockForTransfer(Rect & rect) |
| Get the block ready for transfer. | |
| virtual bool | hasBlockReadyForTransfer() |
| Check if a block is ready for transfer to the LCD. | |
| virtual bool | hasEmptyBlock() |
| Check if a block is ready for drawing (the block is empty). | |
| ManyBlockAllocator() | |
| virtual void | markBlockReadyForTransfer() |
| Marks a previously allocated block as ready to be transferred to the LCD. | |
| virtual const Rect & | peekBlockForTransfer() |
| Get the Rect of the next block to transfer. | |
Additional inherited members
Protected Types inherited from FrameBufferAllocator
| enum | BlockState { EMPTY, ALLOCATED, DRAWN, SENDING } |
| BlockState is used for internal state of each block. | |
Public Functions inherited from FrameBufferAllocator
| virtual | ~FrameBufferAllocator() |
| Finalizes an instance of the FrameBufferAllocator class. | |
Public Functions Documentation
allocateBlock
| virtual uint16_t allocateBlock | ( | const uint16_t | x , | ||
| const uint16_t | y , | ||||
| const uint16_t | width , | ||||
| const uint16_t | height , | ||||
| uint8_t ** | block | ||||
| ) |
Allocates a framebuffer block.
The block will have at least the width requested. The height of the allocated block can be lower than requested if not enough memory is available.
| x | The absolute x coordinate of the block on the screen. |
| y | The absolute y coordinate of the block on the screen. |
| width | The width of the block. |
| height | The height of the block. |
| block | Pointer to pointer to return the block address in. |
The height of the allocated block.
Reimplements: touchgfx::FrameBufferAllocator::allocateBlock
freeBlockAfterTransfer
| virtual void freeBlockAfterTransfer | ( | ) |
Free a block after transfer to the LCD.
Marks a previously allocated block as transferred and ready to reuse.
Reimplements: touchgfx::FrameBufferAllocator::freeBlockAfterTransfer
getBlockForTransfer
| virtual const uint8_t * getBlockForTransfer | ( | Rect & | rect | ) | |
Get the block ready for transfer.
| rect | Reference to rect to write block x, y, width, and height. |
Returns the address of the block ready for transfer.
Reimplements: touchgfx::FrameBufferAllocator::getBlockForTransfer
hasBlockReadyForTransfer
| virtual bool hasBlockReadyForTransfer | ( | ) |
Check if a block is ready for transfer to the LCD.
True if a block is ready for transfer.
Reimplements: touchgfx::FrameBufferAllocator::hasBlockReadyForTransfer
hasEmptyBlock
| virtual bool hasEmptyBlock | ( | ) |
Check if a block is ready for drawing (the block is empty).
True if a block is empty.
Reimplements: touchgfx::FrameBufferAllocator::hasEmptyBlock
ManyBlockAllocator
markBlockReadyForTransfer
| virtual void markBlockReadyForTransfer | ( | ) |
Marks a previously allocated block as ready to be transferred to the LCD.
Reimplements: touchgfx::FrameBufferAllocator::markBlockReadyForTransfer
peekBlockForTransfer
| virtual const Rect & peekBlockForTransfer | ( | ) |
Get the Rect of the next block to transfer.
Rect ready for transfer.
Note
This function should only be called when the allocator has a block ready for transfer.
Reimplements: touchgfx::FrameBufferAllocator::peekBlockForTransfer