#ifndef INCLUDED_RENDERER_PNGIMAGE
#define INCLUDED_RENDERER_PNGIMAGE

#include <Math/Point.h>

#include <vector>
#include <memory>

//////////////////////////////////////////////////////////////
namespace Dubious {
namespace Utility {
class NativeAssetFile;
typedef std::shared_ptr<NativeAssetFile> NativeAssetFilePtr;
}
namespace Renderer {

/// @brief A png image
///
/// This class provides access to a png image.  It only supports
/// read access to RGBA pngs.  It's really intended to allow for
/// reading png textures suitable for OpenGL rendering.
class PngImage
{
public:
	/// @brief Constructor
	/// @param pFile - [in] Pointer to a native asset file
	PngImage( Utility::NativeAssetFilePtr pFile );

	/// @brief Destructor
	~PngImage();

	/// @brief Dimensions accessor
	/// @returns A read only copy of the dimensions
	const Math::Size	Dimensions() const { return m_Dimensions; }

	/// @brief Data accessor
	///
	/// This function provides read only access to the underlying
	/// data.  This is in RGBA format.  It is means to be easily
	/// consumed by the glTexImage2D function
	/// @returns The image data in RGBA format
	const unsigned long* Data() const { return &m_Data[0]; }

private:
	PngImage( const PngImage& );
	PngImage& operator=( const PngImage& );

	std::vector<unsigned long> m_Data;
	Math::Size			m_Dimensions;
};

}
}

#endif
