vbagx/source/gui/gui_imagedata.cpp

52 lines
804 B
C++
Raw Normal View History

/****************************************************************************
2009-04-10 09:51:55 +02:00
* libwiigui
*
2009-04-10 09:51:55 +02:00
* Tantric 2009
*
* gui_imagedata.cpp
*
* GUI class definitions
***************************************************************************/
#include "gui.h"
/**
* Constructor for the GuiImageData class.
*/
GuiImageData::GuiImageData(const u8 * i, int maxw, int maxh)
{
2009-04-07 04:57:49 +02:00
data = NULL;
width = 0;
height = 0;
2009-10-17 02:16:06 +02:00
if(i)
data = DecodePNG(i, &width, &height, maxw, maxh);
}
/**
* Destructor for the GuiImageData class.
*/
GuiImageData::~GuiImageData()
{
if(data)
{
free(data);
data = NULL;
}
}
u8 * GuiImageData::GetImage()
{
return data;
}
int GuiImageData::GetWidth()
{
return width;
}
int GuiImageData::GetHeight()
{
return height;
}