/* -*- C++ -*- */
#ifndef __Image_header_file__
#define __Image_header_file__

#include "types.h"
#include "Array2D.h"

namespace fft
{
   /**
    * Class representing image.
    */
   class Image
   {
      public:
	 /**
	  * Format of Image data
	  */
	 enum Format
	 {
	    /// Unknown format
	    Unknown = 0, 
	    /// Grey scale format
	    GreyScale = 1, 
	    /// True-color RGB format
	    RGB = 3, 
	    /// True-color RGB with alpha channel format
	    RGBA = 4
	 };

	 /**
	  * Creates new image from file.
	  * 
	  * @param fileName Path to image.
	  */
	 Image(const char* fileName);

	 /**
	  * Copy constructor. Creates deep copy of image.
	  * 
	  * @param src Source of data to by copied.
	  */
	 Image(const Image& src);

	 /**
	  * Deletes all image data
	  */
	 virtual ~Image();

	 /**
	  * Assign operator, creates deep copy of image object.
	  * 
	  * @param rhs Right hand side of operator.
	  */
	 Image& operator=(const Image& rhs);

	 /**
	  * Gets width of image (in pixels).
	  * @return Width of image.
	  */
	 u32 getWidth() const { return width; }

	 /**
	  * Gets height of image (in pixels).
	  * @return Height of image.
	  */
	 u32 getHeight() const { return height; }

	 const u8* getData(){ return const_cast<const u8*>(data); }

	 u32 stride() const { return static_cast<u32>(format); }


 
      private:
	 u32 width;
	 u32 height;
	 Format format;
	 u8* data;

	 static bool initialized;

   };
}


#endif //__Image_header_file__

