//	ImageLoader.h - Class responsible for loading images to use in a Drawer.
//  ----------------------------------------------------------------------------
//	This file is part of 'The Future Will Only Be Dystopian if Capitalism
//	Remains Undefeated', a game.
//	Copyright (C) 2009  Niall Moody
//	
//	This program is free software: you can redistribute it and/or modify
//	it under the terms of the GNU General Public License as published by
//	the Free Software Foundation, either version 3 of the License, or
//	(at your option) any later version.
//
//	This program is distributed in the hope that it will be useful,
//	but WITHOUT ANY WARRANTY; without even the implied warranty of
//	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//	GNU General Public License for more details.
//
//	You should have received a copy of the GNU General Public License
//	along with this program.  If not, see <http://www.gnu.org/licenses/>.
//	----------------------------------------------------------------------------

#ifndef IMAGELOADER_H_
#define IMAGELOADER_H_

#include <string>
#include <stdint.h>

//------------------------------------------------------------------------------
///	Struct representing some image data.
struct ImageData
{
	///	The actual data (in 32-bit RGBA format).
	uint8_t *data;
	///	The width (in pixels) of the image.
	uint32_t width;
	///	The height (in pixels) of the image.
	uint32_t height;
};

//------------------------------------------------------------------------------
///	Class responsible for loading images to use in a Drawer.
class ImageLoader
{
  public:
	///	Constructor.
	ImageLoader();
	///	Destructor.
	~ImageLoader();

	///	Loads an image from memory.
	/*!
		The caller is responsible for deleting the ImageData::data pointer.
	 */
	ImageData loadImage(const char *data, uint32_t size);
	///	Loads an image from a file.
	/*!
		The caller is responsible for deleting the ImageData::data pointer.
	 */
	ImageData loadImage(const std::string& path);
};

#endif
