Container class for visual (image/animation) content.
More...
#include <VContent.h>
|
| std::vector< std::vector< uint8_t > > | frames |
| | Image frame buffers.
|
| uint16_t | active_frame_id = 0 |
| | Selected frame index on load.
|
| uint16_t | ft = 0 |
| | Total number of frames in the sequence.
|
| uint16_t | width = 0 |
| | Frame width in pixels.
|
| uint16_t | height = 0 |
| | Frame height in pixels.
|
| std::string | path |
| | Source path of the image/animation.
|
| bool | alpha |
| | True if the source image has an alpha channel.
|
| bool | color12Bit |
| | True if image color depth is 12-bit.
|
| uint8_t | ratio = 1 |
| | Frame rate divider.
|
| uint16_t | loop = 0 |
| | Loop count for animations.
|
Container class for visual (image/animation) content.
- Examples
- EyeControl/main.cpp.
◆ VContent()
◆ ~VContent()
◆ getImage()
| VContent VContent::getImage |
( |
std::string | path, |
|
|
bool | isRGBA, |
|
|
bool | set12Bit ) |
|
static |
Load a PNG image and create a VContent instance.
Supported formats:
- 8-bit RGB
- 8-bit RGBA
- 16-bit RGB
- 16-bit RGBA
- Parameters
-
| path | Path to the image file. |
| isRGBA | True if the image contains an alpha channel. |
| set12Bit | If true, convert image to 12-bit color depth. |
- Returns
- VContent instance containing the loaded image data.
- Note
- Color depth conversion does not change buffer size; data remains 8-bit per channel.
- Examples
- EyeControl/main.cpp.
◆ isReady()
| bool VContent::isReady |
( |
| ) |
|
Check whether the visual content is loaded and ready.
- Returns
- true if content was loaded successfully; false otherwise.
- Examples
- EyeControl/main.cpp.
◆ active_frame_id
| uint16_t VContent::active_frame_id = 0 |
Selected frame index on load.
◆ alpha
True if the source image has an alpha channel.
◆ color12Bit
| bool VContent::color12Bit |
True if image color depth is 12-bit.
◆ frames
| std::vector<std::vector<uint8_t> > VContent::frames |
Image frame buffers.
Each frame is stored as a vector of bytes.
- Single-image content uses frames[0]
- Multi-frame content (animations) are stored sequentially: frames[0], frames[1], ...
◆ ft
| uint16_t VContent::ft = 0 |
Total number of frames in the sequence.
◆ height
| uint16_t VContent::height = 0 |
◆ loop
| uint16_t VContent::loop = 0 |
Loop count for animations.
- loop = 0 : loop forever
- loop = 1 : play once
◆ path
| std::string VContent::path |
Source path of the image/animation.
◆ ratio
| uint8_t VContent::ratio = 1 |
Frame rate divider.
Example:
- ratio = 2 means play at (base_fps / 2)
◆ width
| uint16_t VContent::width = 0 |
The documentation for this class was generated from the following file: