/** SGX

The   sss    gggg x   x   
     s      g      x x    Engine
      sss   g  gg   x
         s  g   g  x x          Copyright 1995-2008.
     ssss    gggg x   x         Steven Goodwin. All Rights Reserved.
    
This version has been released under the GNU Public License v2.0.

Please see the license files for details.

File: include/domains/graphics/surface/imagecanvas.hpp

*/

#ifndef SGX_UTILS_IMAGECANVAS_HPP
#define SGX_UTILS_IMAGECANVAS_HPP		1

// An CImageCanvas draws basic primitives into the image data provided.
// It is also possible to combine multiple canvases together into one
// larger one, and draw to that. This is a composite canvas. One example
// usage would be with the NDS.

class CImageCanvas {
public:

	CImageCanvas(CImageData *pImage);
	~CImageCanvas();

	void setDrawColor(sgxColorRGBA &col);
	void setFillColor(sgxColorRGBA &col);	// TODO TODOC: Note draw/fill naming to imply which functions

	sgxColorRGBA	getDrawColor() const;
	sgxColorRGBA	getFillColor() const;

	void setCrop();
	void setCrop(sgxRect2i &cropRect);
	void setCrop(tINT32 x, tINT32 y, tINT32 x2, tINT32 y2);

	void drawLine(tINT32 x, tINT32 y, tINT32 x2, tINT32 y2);
	void drawRect(tINT32 x, tINT32 y, tINT32 x2, tINT32 y2);
	void drawCircle(tINT32 x, tINT32 y, tINT32 r);
	void drawEllipse(tINT32 x, tINT32 y, tINT32 rx, tINT32 ry);

	void fillRect(tINT32 x, tINT32 y, tINT32 x2, tINT32 y2);
	void fillCircle(tINT32 x, tINT32 y, tINT32 r);
	void fillEllipse(tINT32 x, tINT32 y, tINT32 rx, tINT32 ry);

private:
	CImageCanvas() { /*"Must construct with imagedata into which the canvas can draw"*/ }

	CImageData		*m_pImage;
	sgxColorRGBA	m_DrawColor;
	sgxColorRGBA	m_FillColor;
};


#endif /* SGX_UTILS_IMAGECANVAS_HPP */
