#ifndef PIXELFORMAT_H
#define PIXELFORMAT_H

namespace Salamander
{

/*
** BlendMode stores the source and destination effects used when rendering geometry. When pixels
** are drawn, their values are adjusted using the effects before being added together.
*/
class PixelFormat
{
public:
	/*
	** These formats are common across most rendering platforms and fixed-function pipelines. If
	** formats are not available, then the client should fall back to the closest alternative.
	*/
	enum contentType
	{
		Colour,
		ColourAlpha,
		Alpha,
		Luminance,
		LuminanceAlpha,
		Intensity
	};

	/*
	** These are the most common byte masks, but may not represent all possible combinations supported
	** in hardware. If any of these masks are unsupported, then the client should fall back to the closest
	** alternative.
	*/
	enum byteMask
	{
		Unsigned8,
		Signed8,
		Unsigned16,
		Signed16,

		R3G3B2,
		B2G3R3,
		R5G6B5,
		B5G6R5,
		R8G8B8,
		B8G8R8,

		R4G4B4A4,
		B4G4R4A4,
		R5G5B5A1,
		B5G5R5A1,
		R8G8B8A8,
		B8G8R8A8,
		R10G10B10A2,
		B10G10R10A2
	};

public:
	/*
	** BlendModes must be created with a valid source and destination effect. The default
	** specifies standard blending where the source data completely replaces the destination
	** data.
	*/
	PixelFormat(contentType content = Colour, 
				byteMask mask = R8G8B8A8);

	/*
	** Basic destructor.
	*/
	virtual ~PixelFormat();

public:
	/*
	** Helper method that returns the number of bytes per pixel for each of the byte masks.
	*/
	unsigned int bytesPerPixel() const;

public:
	/*
	** The specified texture should hold data for each the channels specified in format.
	*/
	contentType contentType_;
	
	/*
	** The byte mask specifies how each channel in 'format' is spread across a number of bytes.
	*/	
	byteMask byteMask_;

};

}

#endif // BLENDMODE_H