A renderable for PNG encoded image data. More...
#include <png.hpp>
Public Member Functions | |
| void | renderAt (const Coords &coords, const shader_t &shader=0) const override |
| Display the renderable directly onto the screen. | |
| Size | getSize () const override |
| Get the size of the renderable. | |
| bool | isInterlaced () const |
| Check if this PNG image is interlaced. | |
| ImageFile (uint8_t *const bytes, size_t length) | |
| Constructor. | |
Public Member Functions inherited from ui::ImageFile | |
| ImageFile (uint8_t *const bytes, size_t length) | |
| Constructor. | |
Public Attributes | |
| uint8_t | transparencyThreshold = 128 |
| The minimum alpha value to consider fully opaque. | |
Public Attributes inherited from ui::ImageFile | |
| uint8_t *const | bytes |
| The buffer that the image data is stored in. | |
| size_t | length |
| The size of the data buffer. | |
Additional Inherited Members | |
Static Public Member Functions inherited from ui::ImageFile | |
| 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. | |
Protected Member Functions inherited from ui::ImageFile | |
| 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. | |
A renderable for PNG encoded image data.
|
overridevirtual |
Get the size of the renderable.
Implements ui::Renderable.
| ui::ImageFile::ImageFile | ( | uint8_t *const | bytes, |
| size_t | length | ||
| ) |
Constructor.
| bytes | A buffer containing the image data. |
| length | The size of the buffer. |
| bool ui::Png::isInterlaced | ( | ) | const |
Check if this PNG image is interlaced.
Display the renderable directly onto the screen.
| coords | The coordinates to render the first pixel [0,0] of the renderable. |
| shader | An optional pixel shader to apply to each pixel of the renderable. |
Implements ui::Renderable.
| uint8_t ui::Png::transparencyThreshold = 128 |
The minimum alpha value to consider fully opaque.
Gigawidgets only supports a single bit of transparency, so any alpha value below this threshold is considered fully transparent, and any above this threshold is fully opaque.