Repository navigation
fix for #4990: correct calculation of image coordinates from window coordinates - #13453
Conversation
mshabunin
left a comment
There was a problem hiding this comment.
Please rebase this PR to the 3.4 branch.
| SIZE size = {0,0}; | ||
| icvGetBitmapData( window, &size, 0, 0 ); | ||
| #ifdef HAVE_OPENGL | ||
| if (window->useGl) |
There was a problem hiding this comment.
What about moving this if-block into icvGetBitmapData?
There was a problem hiding this comment.
not my call either way. I chose not to because I don't fully comprehend the naming convention of icvGetBitmapData and related functions and they seem to not deal with OpenGL at all.
I would suggest not querying whatever bitmap is stored for whatever mode, but storing the size in window explicitly when bitmap data is set. then, none of these case distinctions have to be made.
|
This patch should go into 3.4 branch first. We will merge changes from 3.4 into master regularly (weekly/bi-weekly). So, please:
Note: no needs to re-open PR or delete branch, apply changes "inplace". |
…ordinates from window coordinates
2aeb733 to
deb8ba2
Compare
mshabunin
left a comment
There was a problem hiding this comment.
Let's postpone refactoring for now, the whole class should be separated into two.
resolves #4990
This pullrequest changes
in
HighGUIProccaseWM_MOUSEMOVEas well as inMainWindowProccaseWM_MOUSEWHEEL, window coordinates are turned into image coordinates. Unfortunately, the size of the image is stored nowhere explicitly and generally. It is determined by querying (icvGetBitmapData) the GDI bitmap object associated with the window. In the standard GDI case, that's the original image.In the OpenGL case, that is instead the whole window (including chrome). The actual image is only stored in
window->glDrawData, which is a pointer tocv::ogl::Texture2Dand to be used by the drawing callback to OpenGL.I've added code to determine image size according to situation.