Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
bb2fe87b
Commit
bb2fe87b
authored
Jul 26, 2010
by
Yannick Verdie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
769564c1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
28 deletions
+22
-28
CMakeLists.txt
CMakeLists.txt
+8
-5
window.cpp
modules/highgui/src/window.cpp
+0
-10
window_QT.cpp
modules/highgui/src/window_QT.cpp
+10
-9
window_QT.h
modules/highgui/src/window_QT.h
+4
-4
No files found.
CMakeLists.txt
View file @
bb2fe87b
...
@@ -516,11 +516,14 @@ if (WITH_QT)
...
@@ -516,11 +516,14 @@ if (WITH_QT)
find_package
(
Qt4
)
find_package
(
Qt4
)
if
(
QT4_FOUND
)
if
(
QT4_FOUND
)
set
(
HAVE_QT 1
)
set
(
HAVE_QT 1
)
find_package
(
OpenGL QUIET
)
#add_definitions(-DHAVE_QT)
if
(
QT_QTOPENGL_FOUND AND OPENGL_FOUND
)
set_property
(
DIRECTORY PROPERTY COMPILE_DEFINITIONS
"HAVE_QT"
)
set
(
HAVE_QT_OPENGL 1
)
add_definitions
(
-DHAVE_QT_OPENGL
)
#find_package (OpenGL QUIET)
endif
()
#if (QT_QTOPENGL_FOUND AND OPENGL_FOUND)
# set(HAVE_QT_OPENGL 1)
# add_definitions(-DHAVE_QT_OPENGL)
#endif()
endif
()
endif
()
endif
()
endif
()
...
...
modules/highgui/src/window.cpp
View file @
bb2fe87b
...
@@ -368,61 +368,51 @@ CV_IMPL int cvStartWindowThread()
...
@@ -368,61 +368,51 @@ CV_IMPL int cvStartWindowThread()
CV_IMPL
void
cvAddText
(
const
CvArr
*
,
const
char
*
,
CvPoint
org
,
CvFont
font
)
CV_IMPL
void
cvAddText
(
const
CvArr
*
,
const
char
*
,
CvPoint
org
,
CvFont
font
)
{
{
CV_NO_GUI_ERROR
(
"cvAddText"
);
CV_NO_GUI_ERROR
(
"cvAddText"
);
return
-
1
;
}
}
CV_IMPL
void
cvDisplayStatusBar
(
const
char
*
name
,
const
char
*
arg2
,
int
arg3
)
CV_IMPL
void
cvDisplayStatusBar
(
const
char
*
name
,
const
char
*
arg2
,
int
arg3
)
{
{
CV_NO_GUI_ERROR
(
"cvDisplayStatusBar"
);
CV_NO_GUI_ERROR
(
"cvDisplayStatusBar"
);
return
-
1
;
}
}
CV_IMPL
void
cvDisplayStatusBar
(
const
char
*
name
,
const
char
*
arg2
,
int
arg3
)
CV_IMPL
void
cvDisplayStatusBar
(
const
char
*
name
,
const
char
*
arg2
,
int
arg3
)
{
{
CV_NO_GUI_ERROR
(
"cvDisplayStatusBar"
);
CV_NO_GUI_ERROR
(
"cvDisplayStatusBar"
);
return
-
1
;
}
}
CV_IMPL
void
cvCreateOpenGLCallback
(
const
char
*
name
,
cvOpenGLCallback
callback
,
void
*
param
)
CV_IMPL
void
cvCreateOpenGLCallback
(
const
char
*
name
,
cvOpenGLCallback
callback
,
void
*
param
)
{
{
CV_NO_GUI_ERROR
(
"createOpenGLCallback"
);
CV_NO_GUI_ERROR
(
"createOpenGLCallback"
);
return
-
1
;
}
}
CV_IMPL
void
cvDisplayOverlay
(
const
char
*
name
,
const
char
*
text
,
int
delayms
)
CV_IMPL
void
cvDisplayOverlay
(
const
char
*
name
,
const
char
*
text
,
int
delayms
)
{
{
CV_NO_GUI_ERROR
(
"cvNamedWindow"
);
CV_NO_GUI_ERROR
(
"cvNamedWindow"
);
return
-
1
;
}
}
CV_IMPL
void
cvStartLoop
(
int
(
*
pt2Func
)(
int
argc
,
char
*
argv
[]),
int
argc
,
char
*
argv
[])
CV_IMPL
void
cvStartLoop
(
int
(
*
pt2Func
)(
int
argc
,
char
*
argv
[]),
int
argc
,
char
*
argv
[])
{
{
CV_NO_GUI_ERROR
(
"cvStartLoop"
);
CV_NO_GUI_ERROR
(
"cvStartLoop"
);
return
-
1
;
}
}
CV_IMPL
void
cvStopLoop
()
CV_IMPL
void
cvStopLoop
()
{
{
CV_NO_GUI_ERROR
(
"cvStopLoop"
);
CV_NO_GUI_ERROR
(
"cvStopLoop"
);
return
-
1
;
}
}
CV_IMPL
void
cvSaveWindowParameters
(
const
char
*
name
)
CV_IMPL
void
cvSaveWindowParameters
(
const
char
*
name
)
{
{
CV_NO_GUI_ERROR
(
"cvSaveWindowParameters"
);
CV_NO_GUI_ERROR
(
"cvSaveWindowParameters"
);
return
-
1
;
}
}
CV_IMPL
void
cvLoadWindowParameterss
(
const
char
*
name
)
CV_IMPL
void
cvLoadWindowParameterss
(
const
char
*
name
)
{
{
CV_NO_GUI_ERROR
(
"cvLoadWindowParameters"
);
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_IMPL
void
cvCreateButton
(
const
char
*
arg1
,
const
char
*
arg2
,
cvButtonCallback
on_change
,
const
char
*
name
,
void
*
userdata
)
{
{
CV_NO_GUI_ERROR
(
"cvCreateButton"
);
CV_NO_GUI_ERROR
(
"cvCreateButton"
);
return
-
1
;
}
}
...
...
modules/highgui/src/window_QT.cpp
View file @
bb2fe87b
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
//--------------------Google Code 2010 -- Yannick Verdie--------------------//
//--------------------Google Code 2010 -- Yannick Verdie--------------------//
#if
def HAVE_QT
#if
defined(HAVE_QT)
#include <window_QT.h>
#include <window_QT.h>
...
@@ -266,7 +266,7 @@ CV_IMPL int cvWaitKey( int arg )
...
@@ -266,7 +266,7 @@ CV_IMPL int cvWaitKey( int arg )
*/
*/
#if defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64
#if defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64
s
leep
(
2
);
S
leep
(
2
);
#else
#else
usleep
(
2
);
//to decrease CPU usage
usleep
(
2
);
//to decrease CPU usage
#endif
#endif
...
@@ -394,7 +394,7 @@ int icvInitSystem()
...
@@ -394,7 +394,7 @@ int icvInitSystem()
wasInitialized
=
1
;
wasInitialized
=
1
;
qDebug
()
<<
"init done"
;
qDebug
()
<<
"init done"
;
#if defined(
HAVE_QT_OPENGL
)//OK tested !
#if defined(
HAVE_QT_OPENGL
)//OK tested !
qDebug
()
<<
"opengl support available"
;
qDebug
()
<<
"opengl support available"
;
#endif
#endif
}
}
...
@@ -1255,7 +1255,7 @@ CvWindow::CvWindow(QString arg, int arg2)
...
@@ -1255,7 +1255,7 @@ CvWindow::CvWindow(QString arg, int arg2)
//2: my view
//2: my view
int
mode_display
=
CV_MODE_NORMAL
;
int
mode_display
=
CV_MODE_NORMAL
;
#if defined(
HAVE_QT_OPENGL
)
#if defined(
HAVE_QT_OPENGL
)
mode_display
=
CV_MODE_OPENGL
;
mode_display
=
CV_MODE_OPENGL
;
#endif
#endif
createView
(
mode_display
);
createView
(
mode_display
);
...
@@ -1718,7 +1718,7 @@ ViewPort::ViewPort(CvWindow* arg, int arg2, int arg3)
...
@@ -1718,7 +1718,7 @@ ViewPort::ViewPort(CvWindow* arg, int arg2, int arg3)
on_openGL_draw3D
=
NULL
;
on_openGL_draw3D
=
NULL
;
#if defined(
HAVE_QT_OPENGL
)
#if defined(
HAVE_QT_OPENGL
)
if
(
mode_display
==
CV_MODE_OPENGL
)
if
(
mode_display
==
CV_MODE_OPENGL
)
{
{
//QGLWidget* wGL = new QGLWidget(QGLFormat(QGL::SampleBuffers));
//QGLWidget* wGL = new QGLWidget(QGLFormat(QGL::SampleBuffers));
...
@@ -1777,7 +1777,7 @@ void ViewPort::saveView()
...
@@ -1777,7 +1777,7 @@ void ViewPort::saveView()
{
{
QString
extension
=
fileName
.
right
(
3
);
QString
extension
=
fileName
.
right
(
3
);
#if defined(
HAVE_QT_OPENGL
)
#if defined(
HAVE_QT_OPENGL
)
image2Draw_qt_resized
=
((
QGLWidget
*
)
viewport
())
->
grabFrameBuffer
();
image2Draw_qt_resized
=
((
QGLWidget
*
)
viewport
())
->
grabFrameBuffer
();
#else
#else
QPainter
saveimage
(
&
image2Draw_qt_resized
);
QPainter
saveimage
(
&
image2Draw_qt_resized
);
...
@@ -1928,6 +1928,7 @@ void ViewPort::setMouseCallBack(CvMouseCallback m, void* param)
...
@@ -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
)
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_draw3D
=
func
;
on_openGL_param
=
userdata
;
on_openGL_param
=
userdata
;
...
@@ -1947,7 +1948,7 @@ void ViewPort::setOpenGLCallback(CvOpenGLCallback func,void* userdata, double an
...
@@ -1947,7 +1948,7 @@ void ViewPort::setOpenGLCallback(CvOpenGLCallback func,void* userdata, double an
zmax
=
zmax_arg
;
zmax
=
zmax_arg
;
else
else
zmax
=
DEFAULT_ZMAX
;
zmax
=
DEFAULT_ZMAX
;
#endif
}
}
void
ViewPort
::
controlImagePosition
()
void
ViewPort
::
controlImagePosition
()
...
@@ -2219,7 +2220,7 @@ void ViewPort::paintEvent(QPaintEvent* event)
...
@@ -2219,7 +2220,7 @@ void ViewPort::paintEvent(QPaintEvent* event)
draw2D
(
&
myPainter
);
draw2D
(
&
myPainter
);
#if defined(
HAVE_QT_OPENGL
)
#if defined(
HAVE_QT_OPENGL
)
if
(
mode_display
==
CV_MODE_OPENGL
&&
on_openGL_draw3D
)
if
(
mode_display
==
CV_MODE_OPENGL
&&
on_openGL_draw3D
)
{
{
myPainter
.
save
();
// Needed when using the GL1 engine
myPainter
.
save
();
// Needed when using the GL1 engine
...
@@ -2423,7 +2424,7 @@ void ViewPort::drawInstructions(QPainter *painter)
...
@@ -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
()
void
ViewPort
::
initGL
()
{
{
...
...
modules/highgui/src/window_QT.h
View file @
bb2fe87b
...
@@ -43,9 +43,9 @@
...
@@ -43,9 +43,9 @@
#include "precomp.hpp"
#include "precomp.hpp"
#if defined(
HAVE_QT_OPENGL)//OPENCV_GL
)
#if defined(
HAVE_QT_OPENGL
)
#include <QtOpenGL>
#include <QtOpenGL>
#include <QGLWidget>
#include <QGLWidget>
#endif
#endif
#include <QAbstractEventDispatcher>
#include <QAbstractEventDispatcher>
...
@@ -411,7 +411,7 @@ private:
...
@@ -411,7 +411,7 @@ private:
void
icvmouseHandler
(
QMouseEvent
*
event
,
type_mouse_event
category
,
int
&
cv_event
,
int
&
flags
);
void
icvmouseHandler
(
QMouseEvent
*
event
,
type_mouse_event
category
,
int
&
cv_event
,
int
&
flags
);
void
icvmouseProcessing
(
QPointF
pt
,
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
angle
;
double
zmin
;
double
zmin
;
double
zmax
;
double
zmax
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment