The common interface for images read from raw data.
More...
#include <image_file.hpp>
|
| static ImageType | getType (uint8_t *const bytes, size_t length) |
| | Determine the image type based on the file data.
|
| |
| static bool | hasSequence (uint8_t *const bytes, size_t length, const std::initializer_list< uint8_t > &&sequence, size_t index) |
| | Check if a buffer contains a specific sequence of bytes at the given index.
|
| |
|
| uint8_t *const | bytes |
| | The buffer that the image data is stored in.
|
| |
|
size_t | length |
| | The size of the data buffer.
|
| |
|
| unsigned int | getInt (size_t index, uint8_t count) const |
| | Read a big-endian integer from raw bytes.
|
| |
| unsigned int | getIntLE (size_t index, uint8_t count) const |
| | Read a little-endian integer from raw bytes.
|
| |
The common interface for images read from raw data.
- Note
- This is different from the various bitmap renderables as, unlike the bespoke bitmap formats, these image types may be loaded directly from files.
◆ ImageFile()
| ui::ImageFile::ImageFile |
( |
uint8_t *const |
bytes, |
|
|
size_t |
length |
|
) |
| |
Constructor.
- Parameters
-
| bytes | A buffer containing the image data. |
| length | The size of the buffer. |
◆ getInt()
| unsigned int ui::ImageFile::getInt |
( |
size_t |
index, |
|
|
uint8_t |
count |
|
) |
| const |
|
protected |
Read a big-endian integer from raw bytes.
- Parameters
-
| index | The starting index. |
| count | The number of bytes to read. |
- Returns
- The resulting integer.
◆ getIntLE()
| unsigned int ui::ImageFile::getIntLE |
( |
size_t |
index, |
|
|
uint8_t |
count |
|
) |
| const |
|
protected |
Read a little-endian integer from raw bytes.
- Parameters
-
| index | The starting index. |
| count | The number of bytes to read. |
- Returns
- The resulting integer.
◆ getType()
| static ImageType ui::ImageFile::getType |
( |
uint8_t *const |
bytes, |
|
|
size_t |
length |
|
) |
| |
|
static |
Determine the image type based on the file data.
- Parameters
-
| bytes | A buffer containing the image data. |
| length | The size of the buffer. |
- Returns
- The type of image that was determined, or
IMAGE_UNKNOWN (aka 0) if unable to be determined.
◆ hasSequence()
| static bool ui::ImageFile::hasSequence |
( |
uint8_t *const |
bytes, |
|
|
size_t |
length, |
|
|
const std::initializer_list< uint8_t > && |
sequence, |
|
|
size_t |
index |
|
) |
| |
|
static |
Check if a buffer contains a specific sequence of bytes at the given index.
- Parameters
-
| bytes | A buffer containing the image data. |
| length | The size of the buffer. |
| sequence | A sequence of bytes. |
| index | The index to look at. |
◆ bytes
| uint8_t* const ui::ImageFile::bytes |
The buffer that the image data is stored in.
- Note
- This buffer is NOT owned by the ImageFile instance, and will not be cleaned up by it. Any cleanup/deletion must be done be the caller or owning entity.
The documentation for this struct was generated from the following file: