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
e45cf217
Commit
e45cf217
authored
Jan 12, 2014
by
Adi Shavit
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[HighGUI] Updated mouse wheel delta to reside within the 'flags' variable. Updated C++ API.
parent
fecd5c99
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
5 deletions
+12
-5
highgui.hpp
modules/highgui/include/opencv2/highgui.hpp
+5
-1
highgui_c.h
modules/highgui/include/opencv2/highgui/highgui_c.h
+1
-3
window.cpp
modules/highgui/src/window.cpp
+5
-0
window_w32.cpp
modules/highgui/src/window_w32.cpp
+1
-1
No files found.
modules/highgui/include/opencv2/highgui.hpp
View file @
e45cf217
...
...
@@ -76,7 +76,9 @@ enum { EVENT_MOUSEMOVE = 0,
EVENT_MBUTTONUP
=
6
,
EVENT_LBUTTONDBLCLK
=
7
,
EVENT_RBUTTONDBLCLK
=
8
,
EVENT_MBUTTONDBLCLK
=
9
EVENT_MBUTTONDBLCLK
=
9
,
EVENT_MOUSEWHEEL
=
10
,
EVENT_MOUSEHWHEEL
=
11
};
enum
{
EVENT_FLAG_LBUTTON
=
1
,
...
...
@@ -137,6 +139,8 @@ CV_EXPORTS_W double getWindowProperty(const String& winname, int prop_id);
//! assigns callback for mouse events
CV_EXPORTS
void
setMouseCallback
(
const
String
&
winname
,
MouseCallback
onMouse
,
void
*
userdata
=
0
);
CV_EXPORTS
int
getMouseWheelDelta
(
int
flags
);
CV_EXPORTS
int
createTrackbar
(
const
String
&
trackbarname
,
const
String
&
winname
,
int
*
value
,
int
count
,
TrackbarCallback
onChange
=
0
,
...
...
modules/highgui/include/opencv2/highgui/highgui_c.h
View file @
e45cf217
...
...
@@ -186,9 +186,7 @@ enum
};
#define CV_GET_WHEEL_DELTA(event) ((short)((event >> 16) & 0xffff)) // upper 16 bits
#define CV_GET_MOUSEWHEEL_EVENT(event) (event & 0xffff) // lower 16 bits
#define CV_GET_WHEEL_DELTA(flags) ((short)((flags >> 16) & 0xffff)) // upper 16 bits
typedef
void
(
CV_CDECL
*
CvMouseCallback
)(
int
event
,
int
x
,
int
y
,
int
flags
,
void
*
param
);
...
...
modules/highgui/src/window.cpp
View file @
e45cf217
...
...
@@ -216,6 +216,11 @@ void cv::setMouseCallback( const String& windowName, MouseCallback onMouse, void
cvSetMouseCallback
(
windowName
.
c_str
(),
onMouse
,
param
);
}
int
cv
::
getMouseWheelDelta
(
int
flags
)
{
return
CV_GET_WHEEL_DELTA
(
flags
);
}
int
cv
::
startWindowThread
()
{
return
cvStartWindowThread
();
...
...
modules/highgui/src/window_w32.cpp
View file @
e45cf217
...
...
@@ -1392,7 +1392,7 @@ MainWindowProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
// Set the wheel delta of mouse wheel to be in the upper word of 'event'
int
delta
=
GET_WHEEL_DELTA_WPARAM
(
wParam
);
event
|=
(
delta
<<
16
);
flags
|=
(
delta
<<
16
);
POINT
pt
;
{
...
...
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