NanoCanvas
Public Types | Public Member Functions | Public Attributes | List of all members
NanoCanvas::Image Class Reference

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...
 
Imageoperator= (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...
 

Detailed Description

The Image class of Nano canas NanoVG allows you to load jpg, png, psd, tga, pic and gif files to be used for rendering.

Member Enumeration Documentation

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.

Constructor & Destructor Documentation

NanoCanvas::Image::Image ( )
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.

Parameters
canvasThe canvas who owns the image
filePathThe image file path to load
imageFlagsCreation flags
See also
Image::ImageFlag
NanoCanvas::Image::Image ( Canvas canvas,
const Memery memory,
int  imageFlags = 0 
)

Creates image by loading it from the specified chunk of memory.

Parameters
canvasThe canvas who owns the image
memoryThe memery block to load from
imageFlagsCreation flags
See also
Image::ImageFlag
NanoCanvas::Image::Image ( Canvas canvas,
int  w,
int  h,
const Memery memory,
int  imageFlags = 0 
)

Creates image with RGBA formate from specified image data.

Parameters
canvasThe canvas who owns the image
wThe width of the image
wThe height of the image
memoryThe memery block to load from
imageFlagsCreation flags
NanoCanvas::Image::~Image ( )
NanoCanvas::Image::Image ( const Image )
delete

Delete copy constructor.

Member Function Documentation

Image& NanoCanvas::Image::operator= ( const Image )
delete

Disable assignment.

void NanoCanvas::Image::size ( int &  width,
int &  height 
)

Get image size.

Parameters
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.

bool NanoCanvas::Image::valid ( ) const
inline

Check is the image id is bigger than 0.

Member Data Documentation

int NanoCanvas::Image::imageID = 0

The image id of nanovg.


The documentation for this class was generated from the following file:

The documentation was generated by Doxygen

Copyright © 2015 Geequlim. All rights reserved.