/******************************************************************************
*	File		-	Image.h
*	Author		-	Joey Pollack
*	Date		-	2019/07/17 (y/m/d)
*	Mod Date	-	2019/07/18 (y/m/d)
*	Description	-	Manage image data that can be rendered with OpenGL.
*					Use the Graphics class to create instances of Image.
******************************************************************************/

#ifndef IMAGE_H_
#define IMAGE_H_

#include "asset.h"

namespace lunarium
{

	enum ImageFormat
	{
		RGB,
		RGBA,
		BGR,
		BGRA
	};

	class Image : public Asset
	{
	public:
		Image();
		Image(unsigned char* data, int width, int height, ImageFormat format);
		~Image();

		unsigned int GetGLTextureID() const;
		unsigned long long GetGLTextureID64() const;
		int GetWidth() const;
		int GetHeight() const;
		ImageFormat GetFormat() const;
		const unsigned char* GetData() const;

		void SetData(unsigned char* data);
		void SetGLTextureID(unsigned int id);
		void SetWidth(int width);
		void SetHeight(int height);
		void SetFormat(ImageFormat format);

		void FreeRawData();

	private:

		Image(const Image& rhs);
		const Image& operator=(const Image& rhs);
		
		unsigned char* mRawData;
		int mRawDataSize;
		int mWidth;
		int mHeight;
		ImageFormat mFormat;

		unsigned int mGLTextureID;
	};
}

#endif // IMAGE_H_