![]() |
rag
graphic 2d engine
|
#include <Image.h>
Public Member Functions | |
Image (const std::string &path="", int textureWrapMode=GL_CLAMP_TO_EDGE, bool deleteImageData=true, bool downloaded=false) | |
Returns a functional image with size, the image is loaded in background. More... | |
virtual | ~Image () |
Default destructor. | |
virtual void | loadInBackground () override |
CPU intensive load goes here. | |
virtual void | loadSync () override |
The part of the loading that must be done in main thread. | |
void | reload () |
on context lost, images can be reloaded. | |
![]() | |
void | acquire () |
Prevents the Resource to be deleted until it's release()'d. | |
void | release () |
Releases the Resource, so it can be deleted. | |
Static Public Member Functions | |
static Image * | loadImage (const std::string &path="", int textureWrapMode=GL_CLAMP_TO_EDGE, bool deleteImageData=true, bool downloaded=false) |
Returns a functional image with size, the image is loaded in background. More... | |
static void | setCompressedFolder (std::string folder) |
Adds a compressed folder. More... | |
static void | clearCompressedFolders () |
Clears all compressed folders. | |
Public Attributes | |
int | width |
int | height |
int | pixelFormat |
GLuint | name |
GLubyte * | bytes |
![]() | |
State | state |
Current state. | |
std::string | resourceName |
Resource unique name. Usually the file name. | |
int | memorySize |
Size of the Resource in memory measured in bytes. | |
Static Public Attributes | |
static int | s_memorySize = 0 |
Friends | |
class | ImageLoaderJPG |
Additional Inherited Members | |
![]() | |
enum | State { Enqueued = 0, LoadingInBackground, BackgroundLoaded, Ready } |
List of possible states for a Resource. | |
Image object.
An image represents a 2D texture, usually readed from a specific file on disk. Images can be drawn by Bitmap instances. Image raw data can be read and/or manipulated.
Image::Image | ( | const std::string & | path = "" , |
int | textureWrapMode = GL_CLAMP_TO_EDGE , |
||
bool | deleteImageData = true , |
||
bool | downloaded = false |
||
) |
Returns a functional image with size, the image is loaded in background.
If you want direct access to image in raw format, you need to specify deleteImageData = false, otherwise image data is deleted.
|
static |
Returns a functional image with size, the image is loaded in background.
Asks resource manager for the image, create it if not exists.
|
static |
Adds a compressed folder.
All pngs and jpgs loaded inside a compressed folder are converted to 16bpp images in memory.