#ifndef VIDEOCAPTURE_H_
#define VIDEOCAPTURE_H_

#include "framework.h"
#include "MyEnum.h"

namespace thermoCamera {

	/**
	* @class abstract class VideoCapture
	* @brief VideoCapture for process data from thermal Camera
	* libirimager is used from url:
	* http://documentation.evocortex.com/libirimager2/html/index.html
	* @author Matej Roman (student of BUT)
	*/
	class VideoCapture {

	public:

		/**
		* Flag for video: play = 0, pause = 1, stop = 2, record = 3, detect = 4
		*/
		StateFlag eFlag;

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

		/**
		* Standard constructor
		*/
		VideoCapture() :

			eFlag(StateFlag::stop),
			thermalImage(NULL),
			_sizeInputImage{0,0}
		{}

		/**
		* Virtual destructor
		*/
		virtual ~VideoCapture()
		{
			if (thermalImage) { delete[] thermalImage, thermalImage = NULL; }
		}

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

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

		/**
		* Flag for video: play = 0, pause = 1, stop = 2, record = 3, playback = 4, detect = 5
		*/
		int getFlag() { return (int)eFlag; }

		unsigned short** getThermalData() { return &thermalImage; }

		/**
		* get size of input image from camera
		* @param[out] cx is width, cy is height
		*/
		SIZE getSizeOfImage();
		

		int getWidth() { return _sizeInputImage.cx; }

		int getHeight() { return _sizeInputImage.cy; }

		/**
		* Get temperature in position x, y
		*/
		float GetTemperature(int x, int y);

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

		void setWidth(int width);

		void setHeight(int height);

		/////////////////////////////// Virtual methods ////////////////////////////

		/**
		* Virtual method for initializing camera, depends on the camera type
		* Method must call setWidth() and setHeight() 
		*/
		virtual bool Initialize() = 0;

		/**
		* Virtual method for launching streaming
		*/
		virtual bool StartStreaming() = 0;

		/**
		* Virtual method for stopping streaming
		*/
		virtual bool StopStreaming() = 0;


	protected:

		unsigned short* thermalImage;

	private:

		SIZE _sizeInputImage;

	};

}

#endif