a big patch; use special proxy types (Input/OutputArray, Input/OutputArrayOfArrays) for passing in vectors, matrices etc.
This commit is contained in:
@@ -66,7 +66,9 @@ CV_EXPORTS_W double getWindowProperty(const string& winname, int prop_id);//YV
|
||||
|
||||
//Only for Qt
|
||||
//------------------------
|
||||
CV_EXPORTS CvFont fontQt(const string& nameFont, int pointSize CV_DEFAULT(-1), Scalar color CV_DEFAULT(Scalar::all(0)), int weight CV_DEFAULT(CV_FONT_NORMAL), int style CV_DEFAULT(CV_STYLE_NORMAL), int spacing CV_DEFAULT(0));
|
||||
CV_EXPORTS CvFont fontQt(const string& nameFont, int pointSize CV_DEFAULT(-1),
|
||||
Scalar color CV_DEFAULT(Scalar::all(0)), int weight CV_DEFAULT(CV_FONT_NORMAL),
|
||||
int style CV_DEFAULT(CV_STYLE_NORMAL), int spacing CV_DEFAULT(0));
|
||||
CV_EXPORTS void addText( const Mat& img, const string& text, Point org, CvFont font);
|
||||
|
||||
CV_EXPORTS void displayOverlay(const string& winname, const string& text, int delayms);
|
||||
@@ -81,10 +83,12 @@ CV_EXPORTS int startLoop(int (*pt2Func)(int argc, char *argv[]), int argc, char
|
||||
CV_EXPORTS void stopLoop();
|
||||
|
||||
typedef void (CV_CDECL *ButtonCallback)(int state, void* userdata);
|
||||
CV_EXPORTS int createButton( const string& bar_name, ButtonCallback on_change , void* userdata CV_DEFAULT(NULL), int type CV_DEFAULT(CV_PUSH_BUTTON), bool initial_button_state CV_DEFAULT(0));
|
||||
CV_EXPORTS int createButton( const string& bar_name, ButtonCallback on_change,
|
||||
void* userdata CV_DEFAULT(NULL), int type CV_DEFAULT(CV_PUSH_BUTTON),
|
||||
bool initial_button_state CV_DEFAULT(0));
|
||||
//-------------------------
|
||||
|
||||
CV_EXPORTS_W void imshow( const string& winname, const Mat& mat );
|
||||
CV_EXPORTS_W void imshow( const string& winname, const InputArray& mat );
|
||||
|
||||
typedef void (CV_CDECL *TrackbarCallback)(int pos, void* userdata);
|
||||
|
||||
@@ -102,12 +106,12 @@ typedef void (*MouseCallback )(int event, int x, int y, int flags, void* param);
|
||||
CV_EXPORTS void setMouseCallback( const string& windowName, MouseCallback onMouse, void* param=0);
|
||||
|
||||
CV_EXPORTS_W Mat imread( const string& filename, int flags=1 );
|
||||
CV_EXPORTS_W bool imwrite( const string& filename, const Mat& img,
|
||||
CV_EXPORTS_W bool imwrite( const string& filename, const InputArray& img,
|
||||
const vector<int>& params=vector<int>());
|
||||
CV_EXPORTS_W Mat imdecode( const Mat& buf, int flags );
|
||||
CV_EXPORTS_W bool imencode( const string& ext, const Mat& img,
|
||||
CV_OUT vector<uchar>& buf,
|
||||
const vector<int>& params=vector<int>());
|
||||
CV_EXPORTS_W Mat imdecode( const InputArray& buf, int flags );
|
||||
CV_EXPORTS_W bool imencode( const string& ext, const InputArray& img,
|
||||
vector<uchar>& buf,
|
||||
const vector<int>& params=vector<int>());
|
||||
|
||||
CV_EXPORTS_W int waitKey(int delay=0);
|
||||
|
||||
|
||||
@@ -295,9 +295,10 @@ static bool imwrite_( const string& filename, const Mat& image,
|
||||
return code;
|
||||
}
|
||||
|
||||
bool imwrite( const string& filename, const Mat& img,
|
||||
bool imwrite( const string& filename, const InputArray& _img,
|
||||
const vector<int>& params )
|
||||
{
|
||||
Mat img = _img.getMat();
|
||||
return imwrite_(filename, img, params, false);
|
||||
}
|
||||
|
||||
@@ -388,17 +389,17 @@ imdecode_( const Mat& buf, int flags, int hdrtype, Mat* mat=0 )
|
||||
}
|
||||
|
||||
|
||||
Mat imdecode( const Mat& buf, int flags )
|
||||
Mat imdecode( const InputArray& _buf, int flags )
|
||||
{
|
||||
Mat img;
|
||||
Mat buf = _buf.getMat(), img;
|
||||
imdecode_( buf, flags, LOAD_MAT, &img );
|
||||
return img;
|
||||
}
|
||||
|
||||
bool imencode( const string& ext, const Mat& image,
|
||||
bool imencode( const string& ext, const InputArray& _image,
|
||||
vector<uchar>& buf, const vector<int>& params )
|
||||
{
|
||||
Mat temp;
|
||||
Mat temp, image = _image.getMat();
|
||||
const Mat* pimage = ℑ
|
||||
|
||||
int channels = image.channels();
|
||||
|
||||
@@ -126,41 +126,38 @@ CV_IMPL double cvGetWindowProperty(const char* name, int prop_id)
|
||||
}
|
||||
}
|
||||
|
||||
namespace cv
|
||||
{
|
||||
|
||||
void namedWindow( const string& winname, int flags )
|
||||
void cv::namedWindow( const string& winname, int flags )
|
||||
{
|
||||
cvNamedWindow( winname.c_str(), flags );
|
||||
}
|
||||
|
||||
void destroyWindow( const string& winname )
|
||||
void cv::destroyWindow( const string& winname )
|
||||
{
|
||||
cvDestroyWindow( winname.c_str() );
|
||||
}
|
||||
|
||||
void setWindowProperty(const string& winname, int prop_id, double prop_value)
|
||||
void cv::setWindowProperty(const string& winname, int prop_id, double prop_value)
|
||||
{
|
||||
cvSetWindowProperty( winname.c_str(),prop_id,prop_value);
|
||||
}
|
||||
|
||||
double getWindowProperty(const string& winname, int prop_id)
|
||||
double cv::getWindowProperty(const string& winname, int prop_id)
|
||||
{
|
||||
return cvGetWindowProperty(winname.c_str(),prop_id);
|
||||
}
|
||||
|
||||
void imshow( const string& winname, const Mat& img )
|
||||
void cv::imshow( const string& winname, const InputArray& img )
|
||||
{
|
||||
CvMat _img = img;
|
||||
cvShowImage( winname.c_str(), &_img );
|
||||
CvMat c_img = img.getMat();
|
||||
cvShowImage( winname.c_str(), &c_img );
|
||||
}
|
||||
|
||||
int waitKey(int delay)
|
||||
int cv::waitKey(int delay)
|
||||
{
|
||||
return cvWaitKey(delay);
|
||||
}
|
||||
|
||||
int createTrackbar(const string& trackbarName, const string& winName,
|
||||
int cv::createTrackbar(const string& trackbarName, const string& winName,
|
||||
int* value, int count, TrackbarCallback callback,
|
||||
void* userdata)
|
||||
{
|
||||
@@ -168,83 +165,81 @@ int createTrackbar(const string& trackbarName, const string& winName,
|
||||
value, count, callback, userdata);
|
||||
}
|
||||
|
||||
void setTrackbarPos( const string& trackbarName, const string& winName, int value )
|
||||
void cv::setTrackbarPos( const string& trackbarName, const string& winName, int value )
|
||||
{
|
||||
cvSetTrackbarPos(trackbarName.c_str(), winName.c_str(), value );
|
||||
}
|
||||
|
||||
int getTrackbarPos( const string& trackbarName, const string& winName )
|
||||
int cv::getTrackbarPos( const string& trackbarName, const string& winName )
|
||||
{
|
||||
return cvGetTrackbarPos(trackbarName.c_str(), winName.c_str());
|
||||
}
|
||||
|
||||
void setMouseCallback( const string& windowName, MouseCallback onMouse, void* param)
|
||||
void cv::setMouseCallback( const string& windowName, MouseCallback onMouse, void* param)
|
||||
{
|
||||
cvSetMouseCallback(windowName.c_str(), onMouse, param);
|
||||
}
|
||||
|
||||
int startWindowThread()
|
||||
int cv::startWindowThread()
|
||||
{
|
||||
return cvStartWindowThread();
|
||||
}
|
||||
|
||||
#if defined (HAVE_QT)
|
||||
|
||||
CvFont fontQt(const string& nameFont, int pointSize, Scalar color, int weight, int style, int spacing)
|
||||
CvFont cv::fontQt(const string& nameFont, int pointSize, Scalar color, int weight, int style, int spacing)
|
||||
{
|
||||
return cvFontQt(nameFont.c_str(), pointSize,color,weight, style);
|
||||
}
|
||||
|
||||
void addText( const Mat& img, const string& text, Point org, CvFont font)
|
||||
void cv::addText( const Mat& img, const string& text, Point org, CvFont font)
|
||||
{
|
||||
CvMat _img = img;
|
||||
cvAddText( &_img, text.c_str(), org,&font);
|
||||
}
|
||||
|
||||
void displayStatusBar(const string& name, const string& text, int delayms)
|
||||
void cv::displayStatusBar(const string& name, const string& text, int delayms)
|
||||
{
|
||||
cvDisplayStatusBar(name.c_str(),text.c_str(), delayms);
|
||||
}
|
||||
|
||||
void createOpenGLCallback(const string& name, OpenGLCallback callback, void* param)
|
||||
void cv::createOpenGLCallback(const string& name, OpenGLCallback callback, void* param)
|
||||
{
|
||||
cvCreateOpenGLCallback(name.c_str(),callback, param);
|
||||
}
|
||||
|
||||
void displayOverlay(const string& name, const string& text, int delayms)
|
||||
void cv::displayOverlay(const string& name, const string& text, int delayms)
|
||||
{
|
||||
cvDisplayOverlay(name.c_str(),text.c_str(), delayms);
|
||||
}
|
||||
|
||||
int startLoop(int (*pt2Func)(int argc, char *argv[]), int argc, char* argv[])
|
||||
int cv::startLoop(int (*pt2Func)(int argc, char *argv[]), int argc, char* argv[])
|
||||
{
|
||||
return cvStartLoop(pt2Func, argc, argv);
|
||||
}
|
||||
|
||||
void stopLoop()
|
||||
void cv::stopLoop()
|
||||
{
|
||||
cvStopLoop();
|
||||
}
|
||||
|
||||
void saveWindowParameters(const string& windowName)
|
||||
void cv::saveWindowParameters(const string& windowName)
|
||||
{
|
||||
cvSaveWindowParameters(windowName.c_str());
|
||||
}
|
||||
|
||||
void loadWindowParameters(const string& windowName)
|
||||
void cv::loadWindowParameters(const string& windowName)
|
||||
{
|
||||
cvLoadWindowParameters(windowName.c_str());
|
||||
}
|
||||
|
||||
int createButton(const string& button_name, ButtonCallback on_change, void* userdata, int button_type , bool initial_button_state )
|
||||
int cv::createButton(const string& button_name, ButtonCallback on_change, void* userdata, int button_type , bool initial_button_state )
|
||||
{
|
||||
return cvCreateButton(button_name.c_str(), on_change, userdata, button_type , initial_button_state );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#if defined WIN32 || defined _WIN32 // see window_w32.cpp
|
||||
#elif defined (HAVE_GTK) // see window_gtk.cpp
|
||||
#elif defined (HAVE_COCOA) // see window_carbon.cpp
|
||||
|
||||
Reference in New Issue
Block a user