common.h 1.15 KB
#ifndef COMMON_H_
#define COMMON_H_
#include <functional>
#include "header.h"
#define IMG_CHANNELS 3
struct OBJ_KEY {
	int videoID;
	int objID;

	bool operator< (OBJ_KEY const& _A) const
	{
		if (videoID < _A.videoID)  return true;
		if (videoID == _A.videoID) return objID < _A.objID;

		return false;
	}
	bool operator== (OBJ_KEY const& _A) const
	{
		if (videoID == _A.videoID && objID == _A.objID)
			return true;
		else
			return false;
	}
};


struct FRAME_KEY {
	int videoID;
	unsigned int objID;

	bool operator< (FRAME_KEY const& _A) const
	{
		if (videoID < _A.videoID)  return true;
		if (videoID == _A.videoID) return objID < _A.objID;

		return false;
	}
	bool operator== (FRAME_KEY const& _A) const
	{
		if (videoID == _A.videoID && objID == _A.objID)
			return true;
		else
			return false;
	}
};

using SNAPSHOT_CALLBACK = std::function<void(video_object_snapshot *)>;
using REALTIME_CALLBACK = std::function<void(unsigned char *img_data, int img_height, int img_width)>;
using FINISH_CALLBACK = std::function<void( const int )>;
using OBJECT_INFO_CALLBACK = std::function<void(video_object_info *)>;
#endif