2013-05-14 23:36:16 +02:00
|
|
|
|
// opencv_classes.cpp: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> DLL.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
#include "stdafx.h"
|
2013-05-21 01:35:54 +02:00
|
|
|
|
#define ICLASS_EXPORTS 1
|
2013-05-14 23:36:16 +02:00
|
|
|
|
#include "opencv_classes.h"
|
2013-05-15 17:55:06 +02:00
|
|
|
|
|
|
|
|
|
#include "Ihighgui.h"
|
2013-05-21 01:35:54 +02:00
|
|
|
|
#include "Thighgui.h"
|
|
|
|
|
|
|
|
|
|
#include "Icore.types.h"
|
|
|
|
|
#include "Tcore.types.h"
|
|
|
|
|
|
|
|
|
|
#include "IString.h"
|
|
|
|
|
#include "TString.h"
|
|
|
|
|
|
2013-05-15 17:55:06 +02:00
|
|
|
|
|
2013-05-14 23:36:16 +02:00
|
|
|
|
|
2013-05-15 17:55:06 +02:00
|
|
|
|
// mat.hpp
|
2013-05-21 01:35:54 +02:00
|
|
|
|
HRESULT ICLASS_API CreateMat(LPMat *_Mat)
|
2013-05-14 23:36:16 +02:00
|
|
|
|
{
|
2013-05-29 21:46:38 +02:00
|
|
|
|
*_Mat = new TMatInputArray();
|
2013-05-14 23:36:16 +02:00
|
|
|
|
if (*_Mat)
|
|
|
|
|
{
|
|
|
|
|
(*_Mat)->AddRef();
|
|
|
|
|
return S_OK;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
|
}
|
|
|
|
|
|
2013-05-21 01:35:54 +02:00
|
|
|
|
HRESULT ICLASS_API CreateMat_rct(int rows, int cols, int type, LPMat *_Mat)
|
2013-05-14 23:36:16 +02:00
|
|
|
|
{
|
2013-05-29 21:46:38 +02:00
|
|
|
|
*_Mat = new TMatInputArray(rows,cols,type);
|
2013-05-14 23:36:16 +02:00
|
|
|
|
if (*_Mat)
|
|
|
|
|
{
|
|
|
|
|
(*_Mat)->AddRef();
|
|
|
|
|
return S_OK;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
|
}
|
2013-05-15 17:55:06 +02:00
|
|
|
|
|
2013-05-21 01:35:54 +02:00
|
|
|
|
HRESULT ICLASS_API CreateMat_Mat(cv::Mat& m, LPMat *_Mat)
|
|
|
|
|
{
|
2013-05-29 21:46:38 +02:00
|
|
|
|
*_Mat = new TMatInputArray(m);
|
2013-05-21 01:35:54 +02:00
|
|
|
|
if (*_Mat)
|
|
|
|
|
{
|
|
|
|
|
(*_Mat)->AddRef();
|
|
|
|
|
return S_OK;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
|
}
|
|
|
|
|
|
2013-05-15 17:55:06 +02:00
|
|
|
|
// highgui.hpp
|
|
|
|
|
|
2013-05-21 01:35:54 +02:00
|
|
|
|
HRESULT ICLASS_API CreateVideoCapture(LPVideoCapture *_VideoCapture)
|
2013-05-15 17:55:06 +02:00
|
|
|
|
{
|
|
|
|
|
*_VideoCapture = new TVideoCapture();
|
|
|
|
|
if (*_VideoCapture)
|
|
|
|
|
{
|
|
|
|
|
(*_VideoCapture)->AddRef();
|
|
|
|
|
return S_OK;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
|
}
|
|
|
|
|
|
2013-05-21 01:35:54 +02:00
|
|
|
|
HRESULT ICLASS_API CreateVideoCapture_dvc(int device, LPVideoCapture *_VideoCapture)
|
2013-05-15 17:55:06 +02:00
|
|
|
|
{
|
|
|
|
|
*_VideoCapture = new TVideoCapture(device);
|
|
|
|
|
if (*_VideoCapture)
|
|
|
|
|
{
|
|
|
|
|
(*_VideoCapture)->AddRef();
|
|
|
|
|
return S_OK;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return E_NOINTERFACE;
|
2013-05-21 01:35:54 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//core/types.hpp
|
|
|
|
|
HRESULT ICLASS_API CreatePoint(LPPoint *_Point)
|
|
|
|
|
{
|
|
|
|
|
*_Point = new TPoint();
|
|
|
|
|
if (*_Point)
|
|
|
|
|
{
|
|
|
|
|
(*_Point)->AddRef();
|
|
|
|
|
return S_OK;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
HRESULT ICLASS_API CreatePoint_xy(int x,int y, LPPoint *_Point)
|
|
|
|
|
{
|
|
|
|
|
*_Point = new TPoint(x,y);
|
|
|
|
|
if (*_Point)
|
|
|
|
|
{
|
|
|
|
|
(*_Point)->AddRef();
|
|
|
|
|
return S_OK;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
HRESULT ICLASS_API CreateScalar(LPScalar *_Scalar)
|
|
|
|
|
{
|
|
|
|
|
*_Scalar = new TScalar();
|
|
|
|
|
if (*_Scalar)
|
|
|
|
|
{
|
|
|
|
|
(*_Scalar)->AddRef();
|
|
|
|
|
return S_OK;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
|
}
|
|
|
|
|
HRESULT ICLASS_API CreateScalar_v03(int v0,int v1, int v2, int v3, LPScalar *_Scalar)
|
|
|
|
|
{
|
|
|
|
|
*_Scalar = new TScalar(v0,v1,v2,v3);
|
|
|
|
|
if (*_Scalar)
|
|
|
|
|
{
|
|
|
|
|
(*_Scalar)->AddRef();
|
|
|
|
|
return S_OK;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
|
}
|
|
|
|
|
HRESULT ICLASS_API CreateScalar_v0(int v0, LPScalar *_Scalar)
|
|
|
|
|
{
|
|
|
|
|
*_Scalar = new TScalar(v0);
|
|
|
|
|
if (*_Scalar)
|
|
|
|
|
{
|
|
|
|
|
(*_Scalar)->AddRef();
|
|
|
|
|
return S_OK;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
HRESULT ICLASS_API CString(const char* s, LPString *_String)
|
|
|
|
|
{
|
|
|
|
|
*_String = new TString(s);
|
|
|
|
|
if (*_String)
|
|
|
|
|
{
|
|
|
|
|
(*_String)->AddRef();
|
|
|
|
|
return S_OK;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return E_NOINTERFACE;
|
2013-05-29 21:46:38 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
HRESULT ICLASS_API CreateSize2i(LPSize * _Size2i)
|
|
|
|
|
{
|
|
|
|
|
*_Size2i = new TSize2i();
|
|
|
|
|
if (*_Size2i)
|
|
|
|
|
{
|
|
|
|
|
(*_Size2i)->AddRef();
|
|
|
|
|
return S_OK;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
|
}
|
|
|
|
|
HRESULT ICLASS_API CreateSize2i_wh(int _width, int _height, LPSize * _Size2i)
|
|
|
|
|
{
|
|
|
|
|
*_Size2i = new TSize2i(_width,_height);
|
|
|
|
|
if (*_Size2i)
|
|
|
|
|
{
|
|
|
|
|
(*_Size2i)->AddRef();
|
|
|
|
|
return S_OK;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
HRESULT ICLASS_API CreateOutputArray(cv::_OutputArray& o, LPOutputArray * _OutputArray)
|
|
|
|
|
{
|
|
|
|
|
*_OutputArray = new TOutputArray(o);
|
|
|
|
|
if (*_OutputArray)
|
|
|
|
|
{
|
|
|
|
|
(*_OutputArray)->AddRef();
|
|
|
|
|
return S_OK;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return E_NOINTERFACE;
|
2013-05-15 17:55:06 +02:00
|
|
|
|
}
|