Delphi-OpenCV/opencv_classes/opencv_classes.cpp
Laex 07de4424fe cvBoundingRect work correctly)
Signed-off-by: Laex <laex@bk.ru>
2013-05-15 19:55:06 +04:00

65 lines
1.2 KiB
C++

// opencv_classes.cpp: îïðåäåëÿåò ýêñïîðòèðîâàííûå ôóíêöèè äëÿ ïðèëîæåíèÿ DLL.
//
#include "stdafx.h"
#define IMAT_EXPORTS 1
#include "opencv_classes.h"
#include "TMat.h"
#include "imat.h"
//#include "opencv2\core\mat.hpp"
#include "Thighgui.h"
#include "Ihighgui.h"
// mat.hpp
HRESULT IMAT_API CreateMat(LPMat *_Mat)
{
*_Mat = new TMat();
if (*_Mat)
{
(*_Mat)->AddRef();
return S_OK;
}
else
return E_NOINTERFACE;
}
HRESULT IMAT_API CreateMat_rct(int rows, int cols, int type, LPMat *_Mat)
{
*_Mat = new TMat(rows,cols,type);
if (*_Mat)
{
(*_Mat)->AddRef();
return S_OK;
}
else
return E_NOINTERFACE;
}
// highgui.hpp
HRESULT IMAT_API CreateVideoCapture(LPVideoCapture *_VideoCapture)
{
*_VideoCapture = new TVideoCapture();
if (*_VideoCapture)
{
(*_VideoCapture)->AddRef();
return S_OK;
}
else
return E_NOINTERFACE;
}
HRESULT IMAT_API CreateVideoCapture_dvc(int device, LPVideoCapture *_VideoCapture)
{
*_VideoCapture = new TVideoCapture(device);
if (*_VideoCapture)
{
(*_VideoCapture)->AddRef();
return S_OK;
}
else
return E_NOINTERFACE;
}