An image, loaded from a .png file, which can be used for generating textures.
More...
#include <Image.hpp>
|
| Image (const std::string &fileLocation="") |
| File-reading constructor. More...
|
|
| Image (std::vector< char > &data) |
| Memory-based constructor. More...
|
|
| ~Image ()=default |
| Destructor.
|
|
void | toColour (Vec4 colour) |
| Convert to a coloured 10 x 10 pixel image. More...
|
|
unsigned long | getWidth () const |
| Get the image width. More...
|
|
unsigned long | getHeight () const |
| Get the image height. More...
|
|
unsigned long | getByteSize () const |
| Get the size of the image, in bytes. More...
|
|
const uint8_t * | getData () const |
| Get the image data. More...
|
|
template<class Archive > |
void | serialize (Archive &archive) |
|
|
static const std::string | NOTRGBA = "Image format not recognised. Only RGB / RGBA png images are supported." |
| String saying that the colour encoding of the image being read is not RGB/RGBA.
|
|
An image, loaded from a .png file, which can be used for generating textures.
◆ Image() [1/2]
small3d::Image::Image |
( |
const std::string & |
fileLocation = "" | ) |
|
|
explicit |
File-reading constructor.
- Parameters
-
fileLocation | Location of the png image file |
◆ Image() [2/2]
small3d::Image::Image |
( |
std::vector< char > & |
data | ) |
|
|
explicit |
Memory-based constructor.
- Parameters
-
data | PNG bytes already read into memory |
◆ getByteSize()
unsigned long small3d::Image::getByteSize |
( |
| ) |
const |
Get the size of the image, in bytes.
- Returns
- Size of the image, in bytes
◆ getData()
const uint8_t * small3d::Image::getData |
( |
| ) |
const |
Get the image data.
- Returns
- The image data
◆ getHeight()
unsigned long small3d::Image::getHeight |
( |
| ) |
const |
Get the image height.
- Returns
- The image height
◆ getWidth()
unsigned long small3d::Image::getWidth |
( |
| ) |
const |
Get the image width.
- Returns
- The image width
◆ toColour()
void small3d::Image::toColour |
( |
Vec4 |
colour | ) |
|
Convert to a coloured 10 x 10 pixel image.
- Parameters
-
colour | The colour of the image |
The documentation for this class was generated from the following files: