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
3afc97e6
Commit
3afc97e6
authored
Dec 12, 2011
by
Vladislav Vinogradov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed new OpenGL functionality under Qt
parent
f1efd955
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
18 additions
and
26 deletions
+18
-26
CMakeLists.txt
CMakeLists.txt
+3
-6
highgui.hpp
modules/highgui/include/opencv2/highgui/highgui.hpp
+1
-7
highgui_c.h
modules/highgui/include/opencv2/highgui/highgui_c.h
+2
-2
precomp.hpp
modules/highgui/src/precomp.hpp
+4
-0
window.cpp
modules/highgui/src/window.cpp
+4
-7
window_QT.cpp
modules/highgui/src/window_QT.cpp
+0
-0
window_QT.h
modules/highgui/src/window_QT.h
+0
-0
window_gtk.cpp
modules/highgui/src/window_gtk.cpp
+2
-2
window_w32.cpp
modules/highgui/src/window_w32.cpp
+2
-2
No files found.
CMakeLists.txt
View file @
3afc97e6
...
@@ -894,20 +894,17 @@ if (WITH_QT)
...
@@ -894,20 +894,17 @@ if (WITH_QT)
find_package
(
Qt4
)
find_package
(
Qt4
)
if
(
QT4_FOUND
)
if
(
QT4_FOUND
)
set
(
HAVE_QT 1
)
set
(
HAVE_QT 1
)
add_definitions
(
-DHAVE_QT
)
#We need to define te macro this way, using cvconfig.h.cmake does not work
add_definitions
(
-DHAVE_QT
)
#We need to define te macro this way, using cvconfig.h.cmake does not work
find_package
(
OpenGL QUIET
)
#if (NOT WIN32)
if
(
WITH_OPENGL
)
if
(
WITH_OPENGL
)
find_package
(
OpenGL QUIET
)
if
(
QT_QTOPENGL_FOUND AND OPENGL_FOUND
)
if
(
QT_QTOPENGL_FOUND AND OPENGL_FOUND
)
#
set(HAVE_OPENGL 1)
set
(
HAVE_OPENGL 1
)
set
(
HAVE_QT_OPENGL 1
)
set
(
HAVE_QT_OPENGL 1
)
add_definitions
(
-DHAVE_QT_OPENGL
)
add_definitions
(
-DHAVE_QT_OPENGL
)
#link_directories("${OPENGL_LIBRARIES}")
set
(
OPENCV_LINKER_LIBS
${
OPENCV_LINKER_LIBS
}
${
OPENGL_LIBRARIES
}
)
set
(
OPENCV_LINKER_LIBS
${
OPENCV_LINKER_LIBS
}
${
OPENGL_LIBRARIES
}
)
endif
()
endif
()
endif
()
endif
()
#endif()
endif
()
endif
()
endif
()
endif
()
...
...
modules/highgui/include/opencv2/highgui/highgui.hpp
View file @
3afc97e6
...
@@ -125,14 +125,8 @@ CV_EXPORTS_W void setTrackbarPos(const string& trackbarname, const string& winna
...
@@ -125,14 +125,8 @@ CV_EXPORTS_W void setTrackbarPos(const string& trackbarname, const string& winna
// OpenGL support
// OpenGL support
typedef
void
(
CV_CDECL
*
OpenGLCallback
)(
void
*
userdata
);
CV_EXPORTS
void
createOpenGLCallback
(
const
string
&
winname
,
OpenGLCallback
onOpenGlDraw
,
void
*
userdata
=
0
);
typedef
void
(
*
OpenGlDrawCallback
)(
void
*
userdata
);
typedef
void
(
*
OpenGlDrawCallback
)(
void
*
userdata
);
static
inline
void
setOpenGlDrawCallback
(
const
string
&
winname
,
OpenGlDrawCallback
onOpenGlDraw
,
void
*
userdata
=
0
)
CV_EXPORTS
void
setOpenGlDrawCallback
(
const
string
&
winname
,
OpenGlDrawCallback
onOpenGlDraw
,
void
*
userdata
=
0
);
{
createOpenGLCallback
(
winname
,
onOpenGlDraw
,
userdata
);
}
CV_EXPORTS
void
setOpenGlContext
(
const
string
&
winname
);
CV_EXPORTS
void
setOpenGlContext
(
const
string
&
winname
);
...
...
modules/highgui/include/opencv2/highgui/highgui_c.h
View file @
3afc97e6
...
@@ -251,8 +251,8 @@ CVAPI(int) cvWaitKey(int delay CV_DEFAULT(0));
...
@@ -251,8 +251,8 @@ CVAPI(int) cvWaitKey(int delay CV_DEFAULT(0));
// OpenGL support
// OpenGL support
typedef
void
(
CV_CDECL
*
CvOpenG
L
Callback
)(
void
*
userdata
);
typedef
void
(
CV_CDECL
*
CvOpenG
lDraw
Callback
)(
void
*
userdata
);
CVAPI
(
void
)
cv
CreateOpenGLCallback
(
const
char
*
window_name
,
CvOpenGLCallback
callbackOpenGL
,
void
*
userdata
CV_DEFAULT
(
NULL
),
double
angle
CV_DEFAULT
(
-
1
),
double
zmin
CV_DEFAULT
(
-
1
),
double
zmax
CV_DEFAULT
(
-
1
));
CVAPI
(
void
)
cv
SetOpenGlDrawCallback
(
const
char
*
window_name
,
CvOpenGlDrawCallback
callback
,
void
*
userdata
CV_DEFAULT
(
NULL
));
CVAPI
(
void
)
cvSetOpenGlContext
(
const
char
*
window_name
);
CVAPI
(
void
)
cvSetOpenGlContext
(
const
char
*
window_name
);
CVAPI
(
void
)
cvUpdateWindow
(
const
char
*
window_name
);
CVAPI
(
void
)
cvUpdateWindow
(
const
char
*
window_name
);
...
...
modules/highgui/src/precomp.hpp
View file @
3afc97e6
...
@@ -198,10 +198,14 @@ double cvGetOpenGlProp_GTK(const char* name);
...
@@ -198,10 +198,14 @@ double cvGetOpenGlProp_GTK(const char* name);
#if defined (HAVE_QT)
#if defined (HAVE_QT)
double
cvGetModeWindow_QT
(
const
char
*
name
);
double
cvGetModeWindow_QT
(
const
char
*
name
);
void
cvSetModeWindow_QT
(
const
char
*
name
,
double
prop_value
);
void
cvSetModeWindow_QT
(
const
char
*
name
,
double
prop_value
);
double
cvGetPropWindow_QT
(
const
char
*
name
);
double
cvGetPropWindow_QT
(
const
char
*
name
);
void
cvSetPropWindow_QT
(
const
char
*
name
,
double
prop_value
);
void
cvSetPropWindow_QT
(
const
char
*
name
,
double
prop_value
);
double
cvGetRatioWindow_QT
(
const
char
*
name
);
double
cvGetRatioWindow_QT
(
const
char
*
name
);
void
cvSetRatioWindow_QT
(
const
char
*
name
,
double
prop_value
);
void
cvSetRatioWindow_QT
(
const
char
*
name
,
double
prop_value
);
double
cvGetOpenGlProp_QT
(
const
char
*
name
);
#endif
#endif
// OpenGL
// OpenGL
...
...
modules/highgui/src/window.cpp
View file @
3afc97e6
...
@@ -133,6 +133,7 @@ CV_IMPL double cvGetWindowProperty(const char* name, int prop_id)
...
@@ -133,6 +133,7 @@ CV_IMPL double cvGetWindowProperty(const char* name, int prop_id)
case
CV_WND_PROP_OPENGL
:
case
CV_WND_PROP_OPENGL
:
#if defined (HAVE_QT)
#if defined (HAVE_QT)
return
cvGetOpenGlProp_QT
(
name
);
#elif defined WIN32 || defined _WIN32
#elif defined WIN32 || defined _WIN32
return
cvGetOpenGlProp_W32
(
name
);
return
cvGetOpenGlProp_W32
(
name
);
#elif defined (HAVE_GTK)
#elif defined (HAVE_GTK)
...
@@ -218,9 +219,9 @@ int cv::startWindowThread()
...
@@ -218,9 +219,9 @@ int cv::startWindowThread()
// OpenGL support
// OpenGL support
void
cv
::
createOpenGLCallback
(
const
string
&
name
,
OpenGL
Callback
callback
,
void
*
userdata
)
void
cv
::
setOpenGlDrawCallback
(
const
string
&
name
,
OpenGlDraw
Callback
callback
,
void
*
userdata
)
{
{
cv
CreateOpenGL
Callback
(
name
.
c_str
(),
callback
,
userdata
);
cv
SetOpenGlDraw
Callback
(
name
.
c_str
(),
callback
,
userdata
);
}
}
void
cv
::
setOpenGlContext
(
const
string
&
windowName
)
void
cv
::
setOpenGlContext
(
const
string
&
windowName
)
...
@@ -344,8 +345,6 @@ void cv::imshow( const string& winname, InputArray _img )
...
@@ -344,8 +345,6 @@ void cv::imshow( const string& winname, InputArray _img )
}
}
else
else
{
{
namedWindow
(
winname
,
WINDOW_OPENGL
|
WINDOW_AUTOSIZE
);
double
autoSize
=
getWindowProperty
(
winname
,
WND_PROP_AUTOSIZE
);
double
autoSize
=
getWindowProperty
(
winname
,
WND_PROP_AUTOSIZE
);
if
(
autoSize
>
0
)
if
(
autoSize
>
0
)
...
@@ -492,12 +491,10 @@ void cv::pointCloudShow(const std::string& winname, const cv::GlCamera& camera,
...
@@ -492,12 +491,10 @@ void cv::pointCloudShow(const std::string& winname, const cv::GlCamera& camera,
#ifndef HAVE_OPENGL
#ifndef HAVE_OPENGL
#ifndef HAVE_QT
CV_IMPL
void
cvSetOpenGlDrawCallback
(
const
char
*
,
CvOpenGlDrawCallback
,
void
*
)
CV_IMPL
void
cvCreateOpenGLCallback
(
const
char
*
,
CvOpenGLCallback
,
void
*
,
double
,
double
,
double
)
{
{
CV_Error
(
CV_OpenGlNotSupported
,
"The library is compiled without OpenGL support"
);
CV_Error
(
CV_OpenGlNotSupported
,
"The library is compiled without OpenGL support"
);
}
}
#endif
CV_IMPL
void
cvSetOpenGlContext
(
const
char
*
)
CV_IMPL
void
cvSetOpenGlContext
(
const
char
*
)
{
{
...
...
modules/highgui/src/window_QT.cpp
View file @
3afc97e6
This source diff could not be displayed because it is too large. You can
view the blob
instead.
modules/highgui/src/window_QT.h
View file @
3afc97e6
This diff is collapsed.
Click to expand it.
modules/highgui/src/window_gtk.cpp
View file @
3afc97e6
...
@@ -427,7 +427,7 @@ typedef struct CvWindow
...
@@ -427,7 +427,7 @@ typedef struct CvWindow
#ifdef HAVE_OPENGL
#ifdef HAVE_OPENGL
bool
useGl
;
bool
useGl
;
CvOpenG
L
Callback
glDrawCallback
;
CvOpenG
lDraw
Callback
glDrawCallback
;
void
*
glDrawData
;
void
*
glDrawData
;
CvOpenGlCleanCallback
glCleanCallback
;
CvOpenGlCleanCallback
glCleanCallback
;
...
@@ -1216,7 +1216,7 @@ CV_IMPL void cvUpdateWindow(const char* name)
...
@@ -1216,7 +1216,7 @@ CV_IMPL void cvUpdateWindow(const char* name)
__END__
;
__END__
;
}
}
CV_IMPL
void
cv
CreateOpenGLCallback
(
const
char
*
name
,
CvOpenGLCallback
callback
,
void
*
userdata
,
double
,
double
,
double
)
CV_IMPL
void
cv
SetOpenGlDrawCallback
(
const
char
*
name
,
CvOpenGlDrawCallback
callback
,
void
*
userdata
)
{
{
CvWindow
*
window
;
CvWindow
*
window
;
...
...
modules/highgui/src/window_w32.cpp
View file @
3afc97e6
...
@@ -174,7 +174,7 @@ typedef struct CvWindow
...
@@ -174,7 +174,7 @@ typedef struct CvWindow
bool
useGl
;
bool
useGl
;
HGLRC
hGLRC
;
HGLRC
hGLRC
;
CvOpenG
L
Callback
glDrawCallback
;
CvOpenG
lDraw
Callback
glDrawCallback
;
void
*
glDrawData
;
void
*
glDrawData
;
CvOpenGlCleanCallback
glCleanCallback
;
CvOpenGlCleanCallback
glCleanCallback
;
...
@@ -1121,7 +1121,7 @@ CV_IMPL void cvUpdateWindow(const char* name)
...
@@ -1121,7 +1121,7 @@ CV_IMPL void cvUpdateWindow(const char* name)
__END__
;
__END__
;
}
}
CV_IMPL
void
cv
CreateOpenGLCallback
(
const
char
*
name
,
CvOpenGLCallback
callback
,
void
*
userdata
,
double
,
double
,
double
)
CV_IMPL
void
cv
SetOpenGlDrawCallback
(
const
char
*
name
,
CvOpenGlDrawCallback
callback
,
void
*
userdata
)
{
{
CV_FUNCNAME
(
"cvCreateOpenGLCallback"
);
CV_FUNCNAME
(
"cvCreateOpenGLCallback"
);
...
...
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