libgui 2.01
libgui is a GUI library for the GameCube, Wii, and Wii U
 
Loading...
Searching...
No Matches
GuiImageData.h
1/****************************************************************************
2 * libgui
3 * Daryl Borth 2009-2026
4 * GuiImageData.h
5 ***************************************************************************/
6#pragma once
7
8#include "../drivers/Mutex.h"
9
14{
15 public:
24 GuiImageData(const uint8_t * i, int w=0, int h=0);
32 GuiImageData(const uint8_t * i, uint8_t * dst, int maxw=0, int maxh=0);
41 GuiImageData(void * t, int w, int h, bool takeOwnership = true);
51 bool reload(const uint8_t * pngData, int maxw = 0, int maxh = 0);
54 void * getTexture() { return texture; }
57 int getWidth() { return width; }
60 int getHeight() { return height; }
66 static void setDecodeScratch(void * buffer, unsigned int size);
70 static Mutex & scratchLock();
71 protected:
72 void * texture;
73 int height;
74 int width;
75 private:
76 bool ownsTexture;
77 int capWidth;
78 int capHeight;
81 bool decodeImage(const uint8_t * pngData, int * width, int * height, int maxw, int maxh);
82};
int width
Width of image.
~GuiImageData()
Destructor.
GuiImageData()
Constructor.
void * texture
Attached platform-native texture.
bool reload(const uint8_t *pngData, int maxw=0, int maxh=0)
Decodes new PNG data into this object's own texture, reusing the existing allocation whenever it's al...
static void setDecodeScratch(void *buffer, unsigned int size)
Sets the scratch buffer that every decode (the PNG-decoding constructors, and reload()) will stage it...
void * getTexture()
Gets the attached platform-native texture.
int getWidth()
Gets the image width.
int height
Height of image.
int getHeight()
Gets the image height.
static Mutex & scratchLock()
A simple mutual-exclusion lock.
Definition Mutex.h:14