#ifndef BMPRECORD_H_
#define BMPRECORD_H_

#include "Record.h"
#include <atlimage.h>

namespace thermoCamera {

	/**
	* @class BMPRecord
	* @brief Read write bmp files
	* @author Matej Roman (student of BUT)
	*/
	class BMPRecord : public Record {

	public:

		/////////////////////////////////// Constructors /////////////////////////////

		/**
		* Standard constructor, setMode must be init first, default is 0 for read
		*/
		BMPRecord();

		/**
		* Standard constructor
		* @param[in] mode: 0 for read, 1 for write
		*/
		BMPRecord(int mode);

		/**
		* Standard constructor
		* @param[in] mode: 0 for read, 1 for write
		* @param[in] path of the folder
		*/
		BMPRecord(int mode, const TCHAR* path);

		/////////////////////////////////// Destructor /////////////////////////////

		/**
		* Destructor
		*/
		virtual  ~BMPRecord() {}

		/////////////////////////////////// Methods ///////////////////////////////////

		/**
		* Save bitmap to the selected folder
		*/
		void Save(HBITMAP hBitMap);

		/**
		* Load image, only update the name of image path
		*/
		void Load();

		/////////////////////////////////// Setters ///////////////////////////////////

		void SetPath(const TCHAR* path);

		/**
		* Set mode
		* * @param[in] mode: 0 for read, 1 for write
		*/
		void SetMetod(int mode);

		/////////////////////////////////// Getters ///////////////////////////////////

		/**
		* Get mode
		* * @param[out] mode: 0 for read, 1 for write
		*/
		int GetMode() { return (int)getState(); }

	private:

		void _Init();

		CImage _image;

		/////////////////////////////////// Virtual Methods ///////////////////////////////////
		virtual void SetFormat();

	};

}

#endif
