mirror of
https://github.com/opencv/opencv.git
synced 2025-01-21 00:20:59 +08:00
This commit is contained in:
parent
769564c130
commit
bb2fe87b32
@ -516,11 +516,14 @@ if (WITH_QT)
|
||||
find_package(Qt4)
|
||||
if (QT4_FOUND)
|
||||
set(HAVE_QT 1)
|
||||
find_package (OpenGL QUIET)
|
||||
if (QT_QTOPENGL_FOUND AND OPENGL_FOUND)
|
||||
set(HAVE_QT_OPENGL 1)
|
||||
add_definitions(-DHAVE_QT_OPENGL)
|
||||
endif()
|
||||
#add_definitions(-DHAVE_QT)
|
||||
set_property(DIRECTORY PROPERTY COMPILE_DEFINITIONS "HAVE_QT")
|
||||
|
||||
#find_package (OpenGL QUIET)
|
||||
#if (QT_QTOPENGL_FOUND AND OPENGL_FOUND)
|
||||
# set(HAVE_QT_OPENGL 1)
|
||||
# add_definitions(-DHAVE_QT_OPENGL)
|
||||
#endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
@ -368,61 +368,51 @@ CV_IMPL int cvStartWindowThread()
|
||||
CV_IMPL void cvAddText( const CvArr*, const char*, CvPoint org, CvFont font)
|
||||
{
|
||||
CV_NO_GUI_ERROR("cvAddText");
|
||||
return -1;
|
||||
}
|
||||
|
||||
CV_IMPL void cvDisplayStatusBar(const char* name, const char* arg2, int arg3)
|
||||
{
|
||||
CV_NO_GUI_ERROR("cvDisplayStatusBar");
|
||||
return -1;
|
||||
}
|
||||
|
||||
CV_IMPL void cvDisplayStatusBar(const char* name, const char* arg2, int arg3)
|
||||
{
|
||||
CV_NO_GUI_ERROR("cvDisplayStatusBar");
|
||||
return -1;
|
||||
}
|
||||
|
||||
CV_IMPL void cvCreateOpenGLCallback(const char* name, cvOpenGLCallback callback, void* param)
|
||||
{
|
||||
CV_NO_GUI_ERROR("createOpenGLCallback");
|
||||
return -1;
|
||||
}
|
||||
|
||||
CV_IMPL void cvDisplayOverlay(const char* name, const char* text, int delayms)
|
||||
{
|
||||
CV_NO_GUI_ERROR("cvNamedWindow");
|
||||
return -1;
|
||||
}
|
||||
|
||||
CV_IMPL void cvStartLoop(int (*pt2Func)(int argc, char *argv[]), int argc, char* argv[])
|
||||
{
|
||||
CV_NO_GUI_ERROR("cvStartLoop");
|
||||
return -1;
|
||||
}
|
||||
|
||||
CV_IMPL void cvStopLoop()
|
||||
{
|
||||
CV_NO_GUI_ERROR("cvStopLoop");
|
||||
return -1;
|
||||
}
|
||||
|
||||
CV_IMPL void cvSaveWindowParameters(const char* name)
|
||||
{
|
||||
CV_NO_GUI_ERROR("cvSaveWindowParameters");
|
||||
return -1;
|
||||
}
|
||||
|
||||
CV_IMPL void cvLoadWindowParameterss(const char* name)
|
||||
{
|
||||
CV_NO_GUI_ERROR("cvLoadWindowParameters");
|
||||
return -1;
|
||||
}
|
||||
|
||||
CV_IMPL void cvCreateButton(const char* arg1, const char* arg2, cvButtonCallback on_change, const char* name, void* userdata)
|
||||
{
|
||||
CV_NO_GUI_ERROR("cvCreateButton");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
|
@ -39,7 +39,7 @@
|
||||
//--------------------Google Code 2010 -- Yannick Verdie--------------------//
|
||||
|
||||
|
||||
#ifdef HAVE_QT
|
||||
#if defined(HAVE_QT)
|
||||
|
||||
#include <window_QT.h>
|
||||
|
||||
@ -266,7 +266,7 @@ CV_IMPL int cvWaitKey( int arg )
|
||||
*/
|
||||
|
||||
#if defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64
|
||||
sleep(2);
|
||||
Sleep(2);
|
||||
#else
|
||||
usleep(2);//to decrease CPU usage
|
||||
#endif
|
||||
@ -394,7 +394,7 @@ int icvInitSystem()
|
||||
wasInitialized = 1;
|
||||
qDebug()<<"init done";
|
||||
|
||||
#if defined(HAVE_QT_OPENGL)//OK tested !
|
||||
#if defined( HAVE_QT_OPENGL )//OK tested !
|
||||
qDebug()<<"opengl support available";
|
||||
#endif
|
||||
}
|
||||
@ -1255,7 +1255,7 @@ CvWindow::CvWindow(QString arg, int arg2)
|
||||
|
||||
//2: my view
|
||||
int mode_display = CV_MODE_NORMAL;
|
||||
#if defined(HAVE_QT_OPENGL)
|
||||
#if defined( HAVE_QT_OPENGL )
|
||||
mode_display = CV_MODE_OPENGL;
|
||||
#endif
|
||||
createView(mode_display);
|
||||
@ -1718,7 +1718,7 @@ ViewPort::ViewPort(CvWindow* arg, int arg2, int arg3)
|
||||
on_openGL_draw3D = NULL;
|
||||
|
||||
|
||||
#if defined(HAVE_QT_OPENGL)
|
||||
#if defined( HAVE_QT_OPENGL )
|
||||
if ( mode_display == CV_MODE_OPENGL)
|
||||
{
|
||||
//QGLWidget* wGL = new QGLWidget(QGLFormat(QGL::SampleBuffers));
|
||||
@ -1777,7 +1777,7 @@ void ViewPort::saveView()
|
||||
{
|
||||
QString extension = fileName.right(3);
|
||||
|
||||
#if defined(HAVE_QT_OPENGL)
|
||||
#if defined( HAVE_QT_OPENGL )
|
||||
image2Draw_qt_resized = ((QGLWidget*)viewport())->grabFrameBuffer();
|
||||
#else
|
||||
QPainter saveimage(&image2Draw_qt_resized);
|
||||
@ -1928,6 +1928,7 @@ void ViewPort::setMouseCallBack(CvMouseCallback m, void* param)
|
||||
|
||||
void ViewPort::setOpenGLCallback(CvOpenGLCallback func,void* userdata, double angle_arg, double zmin_arg, double zmax_arg)
|
||||
{
|
||||
#if defined( HAVE_QT_OPENGL )//all this section -> not tested
|
||||
on_openGL_draw3D = func;
|
||||
on_openGL_param = userdata;
|
||||
|
||||
@ -1947,7 +1948,7 @@ void ViewPort::setOpenGLCallback(CvOpenGLCallback func,void* userdata, double an
|
||||
zmax = zmax_arg;
|
||||
else
|
||||
zmax = DEFAULT_ZMAX;
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
void ViewPort::controlImagePosition()
|
||||
@ -2219,7 +2220,7 @@ void ViewPort::paintEvent(QPaintEvent* event)
|
||||
|
||||
draw2D(&myPainter);
|
||||
|
||||
#if defined(HAVE_QT_OPENGL)
|
||||
#if defined( HAVE_QT_OPENGL )
|
||||
if ( mode_display == CV_MODE_OPENGL && on_openGL_draw3D)
|
||||
{
|
||||
myPainter.save(); // Needed when using the GL1 engine
|
||||
@ -2423,7 +2424,7 @@ void ViewPort::drawInstructions(QPainter *painter)
|
||||
|
||||
|
||||
|
||||
#if defined(HAVE_QT_OPENGL)//all this section -> not tested
|
||||
#if defined( HAVE_QT_OPENGL )//all this section -> not tested
|
||||
|
||||
void ViewPort::initGL()
|
||||
{
|
||||
|
@ -43,9 +43,9 @@
|
||||
|
||||
#include "precomp.hpp"
|
||||
|
||||
#if defined(HAVE_QT_OPENGL)//OPENCV_GL)
|
||||
#include <QtOpenGL>
|
||||
#include <QGLWidget>
|
||||
#if defined( HAVE_QT_OPENGL )
|
||||
#include <QtOpenGL>
|
||||
#include <QGLWidget>
|
||||
#endif
|
||||
|
||||
#include <QAbstractEventDispatcher>
|
||||
@ -411,7 +411,7 @@ private:
|
||||
void icvmouseHandler(QMouseEvent *event, type_mouse_event category, int &cv_event, int &flags);
|
||||
void icvmouseProcessing(QPointF pt, int cv_event, int flags);
|
||||
|
||||
#if defined(HAVE_QT_OPENGL)
|
||||
#if defined( HAVE_QT_OPENGL )
|
||||
double angle;
|
||||
double zmin;
|
||||
double zmax;
|
||||
|
Loading…
Reference in New Issue
Block a user