#pragma once

#ifndef _MISCELLANEOUS_
#define _MISCELLANEOUS_

struct SPLIT {int w; int h;};

#include <macros.h>

#include <FaceClassifier/WholeSVMFaceClassifier.h>
#include <FaceClassifier/LBPSVMFaceClassifier.h>
#include <utils/configuration.h>
#include <utils/stringutils.h>
#include <utils/fsutils.h>

#include <opencv/cvaux.h>
#include <opencv/highgui.h>

#include <list>

namespace misc {

void FACE_API appendFile(const std::string filename, const std::string text);
double FACE_API roundPrec(double number, const int precision);
void FACE_API mtxToString(const std::string name, const CvMat * const mtx);
void FACE_API imgToString(const std::string name, const IplImage * const img);
void FACE_API drawRect(IplImage * const img, const CvRect * const rect);
IplImage FACE_API *clipSubImg(const IplImage * const img, const CvRect * const rect);
IplImage FACE_API *cpyImg(const IplImage * const img);
void FACE_API setOriginTL(IplImage * const img);
void FACE_API getLines(const std::string filename, std::list<std::string> * const list);

class FACE_API FaceDetector {
	std::string cascadeFile;
	CvHaarClassifierCascade *cascade;
	CvMemStorage *storage;
public:
	FaceDetector();
	~FaceDetector();
	FaceDetector(const std::string cascadeFile);
	void Load(const std::string cascadeFile);
	CvSeq *DetectFaces(const IplImage *img);
};

}

#endif
