NanoCanvas
|
The Image class of Nano canas NanoVG allows you to load jpg, png, psd, tga, pic and gif files to be used for rendering. More...
#include <Image.h>
Public Types | |
enum | ImageFlag { GenerateMipmaps = 1<<0, RepeatX = 1<<1, RepeatY = 1<<2, FlipY = 1<<3, PreMultiplied = 1<<4 } |
Flags for image creation Can be used with bit operation. More... | |
Public Member Functions | |
Image ()=delete | |
Delete default constructor. More... | |
Image (Canvas &canvas, const string &filePath, int imageFlags=0) | |
Creates image by loading it from the disk from specified file name. More... | |
Image (Canvas &canvas, const Memery &memory, int imageFlags=0) | |
Creates image by loading it from the specified chunk of memory. More... | |
Image (Canvas &canvas, int w, int h, const Memery &memory, int imageFlags=0) | |
Creates image with RGBA formate from specified image data. More... | |
~Image () | |
Image (const Image &)=delete | |
Delete copy constructor. More... | |
Image & | operator= (const Image &)=delete |
Disable assignment. More... | |
bool | valid () const |
Check is the image id is bigger than 0. More... | |
void | update (const Memery &memory) |
Update the image with memory data. More... | |
void | size (int &width, int &height) |
Get image size. More... | |
Public Attributes | |
int | imageID = 0 |
The image id of nanovg. More... | |
The Image class of Nano canas NanoVG allows you to load jpg, png, psd, tga, pic and gif files to be used for rendering.
Flags for image creation Can be used with bit operation.
Enumerator | |
---|---|
GenerateMipmaps |
Generate mipmaps during creation of the image. |
RepeatX |
Repeat image in X direction. |
RepeatY |
Repeat image in Y direction. |
FlipY |
Flips (inverses) image in Y direction when rendered. |
PreMultiplied |
Image data has premultiplied alpha. |
|
delete |
Delete default constructor.
NanoCanvas::Image::Image | ( | Canvas & | canvas, |
const string & | filePath, | ||
int | imageFlags = 0 |
||
) |
Creates image by loading it from the disk from specified file name.
canvas | The canvas who owns the image |
filePath | The image file path to load |
imageFlags | Creation flags |
Creates image by loading it from the specified chunk of memory.
canvas | The canvas who owns the image |
memory | The memery block to load from |
imageFlags | Creation flags |
NanoCanvas::Image::Image | ( | Canvas & | canvas, |
int | w, | ||
int | h, | ||
const Memery & | memory, | ||
int | imageFlags = 0 |
||
) |
Creates image with RGBA formate from specified image data.
canvas | The canvas who owns the image |
w | The width of the image |
w | The height of the image |
memory | The memery block to load from |
imageFlags | Creation flags |
NanoCanvas::Image::~Image | ( | ) |
|
delete |
Delete copy constructor.
void NanoCanvas::Image::size | ( | int & | width, |
int & | height | ||
) |
Get image size.
width | [out] The width of the image , must be left-value |
height | [out] The height of the image , must be left-value |
void NanoCanvas::Image::update | ( | const Memery & | memory | ) |
Update the image with memory data.
|
inline |
Check is the image id is bigger than 0.
int NanoCanvas::Image::imageID = 0 |
The image id of nanovg.