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
77f54e0f
Commit
77f54e0f
authored
Mar 02, 2016
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6161 from mshabunin:fix-mac-sliders
parents
5e631d5c
3cc23458
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
5 deletions
+26
-5
utility.hpp
modules/core/include/opencv2/core/utility.hpp
+4
-0
window_cocoa.mm
modules/highgui/src/window_cocoa.mm
+14
-5
blenders.hpp
...s/stitching/include/opencv2/stitching/detail/blenders.hpp
+4
-0
exposure_compensate.hpp
.../include/opencv2/stitching/detail/exposure_compensate.hpp
+4
-0
No files found.
modules/core/include/opencv2/core/utility.hpp
View file @
77f54e0f
...
@@ -49,6 +49,10 @@
...
@@ -49,6 +49,10 @@
# error utility.hpp header must be compiled as C++
# error utility.hpp header must be compiled as C++
#endif
#endif
#if defined(check)
# warning Detected Apple 'check' macro definition, it can cause build conflicts. Please, include this header before any Apple headers.
#endif
#include "opencv2/core.hpp"
#include "opencv2/core.hpp"
namespace
cv
namespace
cv
...
...
modules/highgui/src/window_cocoa.mm
View file @
77f54e0f
...
@@ -230,9 +230,11 @@ CV_IMPL void cvShowImage( const char* name, const CvArr* arr)
...
@@ -230,9 +230,11 @@ CV_IMPL void cvShowImage( const char* name, const CvArr* arr)
//Set new view size considering sliders (reserve height and min width)
//Set new view size considering sliders (reserve height and min width)
NSRect vrectNew = vrectOld;
NSRect vrectNew = vrectOld;
int slider_height = 0;
int slider_height = 0;
if ([window respondsToSelector:@selector(sliders)]) {
for(NSString *key in [window sliders]) {
for(NSString *key in [window sliders]) {
slider_height += [[[window sliders] valueForKey:key] frame].size.height;
slider_height += [[[window sliders] valueForKey:key] frame].size.height;
}
}
}
vrectNew.size.height = [[[window contentView] image] size].height + slider_height;
vrectNew.size.height = [[[window contentView] image] size].height + slider_height;
vrectNew.size.width = std::max<int>([[[window contentView] image] size].width, MIN_SLIDER_WIDTH);
vrectNew.size.width = std::max<int>([[[window contentView] image] size].width, MIN_SLIDER_WIDTH);
[[window contentView] setFrameSize:vrectNew.size]; //adjust sliders to fit new window size
[[window contentView] setFrameSize:vrectNew.size]; //adjust sliders to fit new window size
...
@@ -331,10 +333,13 @@ CV_IMPL int cvCreateTrackbar2(const char* trackbar_name,
...
@@ -331,10 +333,13 @@ CV_IMPL int cvCreateTrackbar2(const char* trackbar_name,
NSAutoreleasePool* localpool = [[NSAutoreleasePool alloc] init];
NSAutoreleasePool* localpool = [[NSAutoreleasePool alloc] init];
int res = cvCreateTrackbar(trackbar_name, window_name, val, count, NULL);
int res = cvCreateTrackbar(trackbar_name, window_name, val, count, NULL);
if(res) {
if(res) {
CVSlider *slider = [[cvGetWindow(window_name) sliders] valueForKey:[NSString stringWithFormat:@"%s", trackbar_name]];
CVWindow *window = cvGetWindow(window_name);
if (window && [window respondsToSelector:@selector(sliders)]) {
CVSlider *slider = [[window sliders] valueForKey:[NSString stringWithFormat:@"%s", trackbar_name]];
[slider setCallback2:on_notify2];
[slider setCallback2:on_notify2];
[slider setUserData:userdata];
[slider setUserData:userdata];
}
}
}
[localpool drain];
[localpool drain];
return res;
return res;
}
}
...
@@ -383,7 +388,7 @@ cvSetMouseCallback( const char* name, CvMouseCallback function, void* info)
...
@@ -383,7 +388,7 @@ cvSetMouseCallback( const char* name, CvMouseCallback function, void* info)
localpool4 = [[NSAutoreleasePool alloc] init];
localpool4 = [[NSAutoreleasePool alloc] init];
window = cvGetWindow(window_name);
window = cvGetWindow(window_name);
if(window) {
if(window
&& [window respondsToSelector:@selector(sliders)]
) {
CVSlider *slider = [[window sliders] valueForKey:[NSString stringWithFormat:@"%s", trackbar_name]];
CVSlider *slider = [[window sliders] valueForKey:[NSString stringWithFormat:@"%s", trackbar_name]];
if(slider) {
if(slider) {
pos = [[slider slider] intValue];
pos = [[slider slider] intValue];
...
@@ -414,7 +419,7 @@ CV_IMPL void cvSetTrackbarPos(const char* trackbar_name, const char* window_name
...
@@ -414,7 +419,7 @@ CV_IMPL void cvSetTrackbarPos(const char* trackbar_name, const char* window_name
localpool5 = [[NSAutoreleasePool alloc] init];
localpool5 = [[NSAutoreleasePool alloc] init];
window = cvGetWindow(window_name);
window = cvGetWindow(window_name);
if(window) {
if(window
&& [window respondsToSelector:@selector(sliders)]
) {
slider = [[window sliders] valueForKey:[NSString stringWithFormat:@"%s", trackbar_name]];
slider = [[window sliders] valueForKey:[NSString stringWithFormat:@"%s", trackbar_name]];
if(slider) {
if(slider) {
[[slider slider] setIntValue:pos];
[[slider slider] setIntValue:pos];
...
@@ -442,7 +447,7 @@ CV_IMPL void cvSetTrackbarMax(const char* trackbar_name, const char* window_name
...
@@ -442,7 +447,7 @@ CV_IMPL void cvSetTrackbarMax(const char* trackbar_name, const char* window_name
localpool5 = [[NSAutoreleasePool alloc] init];
localpool5 = [[NSAutoreleasePool alloc] init];
window = cvGetWindow(window_name);
window = cvGetWindow(window_name);
if(window) {
if(window
&& [window respondsToSelector:@selector(sliders)]
) {
slider = [[window sliders] valueForKey:[NSString stringWithFormat:@"%s", trackbar_name]];
slider = [[window sliders] valueForKey:[NSString stringWithFormat:@"%s", trackbar_name]];
if(slider) {
if(slider) {
if(maxval >= 0) {
if(maxval >= 0) {
...
@@ -473,7 +478,7 @@ CV_IMPL void cvSetTrackbarMin(const char* trackbar_name, const char* window_name
...
@@ -473,7 +478,7 @@ CV_IMPL void cvSetTrackbarMin(const char* trackbar_name, const char* window_name
localpool5 = [[NSAutoreleasePool alloc] init];
localpool5 = [[NSAutoreleasePool alloc] init];
window = cvGetWindow(window_name);
window = cvGetWindow(window_name);
if(window) {
if(window
&& [window respondsToSelector:@selector(sliders)]
) {
slider = [[window sliders] valueForKey:[NSString stringWithFormat:@"%s", trackbar_name]];
slider = [[window sliders] valueForKey:[NSString stringWithFormat:@"%s", trackbar_name]];
if(slider) {
if(slider) {
if(minval >= 0) {
if(minval >= 0) {
...
@@ -709,10 +714,12 @@ void cv::setWindowTitle(const String& winname, const String& title)
...
@@ -709,10 +714,12 @@ void cv::setWindowTitle(const String& winname, const String& title)
double viewHeight = [self contentView].frame.size.height;
double viewHeight = [self contentView].frame.size.height;
double viewWidth = [self contentView].frame.size.width;
double viewWidth = [self contentView].frame.size.width;
CVWindow *window = (CVWindow *)[[self contentView] window];
CVWindow *window = (CVWindow *)[[self contentView] window];
if ([window respondsToSelector:@selector(sliders)]) {
for(NSString *key in [window sliders]) {
for(NSString *key in [window sliders]) {
NSSlider *slider = [[window sliders] valueForKey:key];
NSSlider *slider = [[window sliders] valueForKey:key];
viewHeight = std::min(viewHeight, (double)([slider frame].origin.y));
viewHeight = std::min(viewHeight, (double)([slider frame].origin.y));
}
}
}
viewHeight -= TOP_BORDER;
viewHeight -= TOP_BORDER;
mp.y = viewHeight - mp.y;
mp.y = viewHeight - mp.y;
...
@@ -929,6 +936,7 @@ void cv::setWindowTitle(const String& winname, const String& title)
...
@@ -929,6 +936,7 @@ void cv::setWindowTitle(const String& winname, const String& title)
int height = size.height;
int height = size.height;
CVWindow *cvwindow = (CVWindow *)[self window];
CVWindow *cvwindow = (CVWindow *)[self window];
if ([cvwindow respondsToSelector:@selector(sliders)]) {
for(NSString *key in [cvwindow sliders]) {
for(NSString *key in [cvwindow sliders]) {
NSSlider *slider = [[cvwindow sliders] valueForKey:key];
NSSlider *slider = [[cvwindow sliders] valueForKey:key];
NSRect r = [slider frame];
NSRect r = [slider frame];
...
@@ -937,6 +945,7 @@ void cv::setWindowTitle(const String& winname, const String& title)
...
@@ -937,6 +945,7 @@ void cv::setWindowTitle(const String& winname, const String& title)
[slider setFrame:r];
[slider setFrame:r];
height -= r.size.height;
height -= r.size.height;
}
}
}
[localpool drain];
[localpool drain];
}
}
...
...
modules/stitching/include/opencv2/stitching/detail/blenders.hpp
View file @
77f54e0f
...
@@ -43,6 +43,10 @@
...
@@ -43,6 +43,10 @@
#ifndef __OPENCV_STITCHING_BLENDERS_HPP__
#ifndef __OPENCV_STITCHING_BLENDERS_HPP__
#define __OPENCV_STITCHING_BLENDERS_HPP__
#define __OPENCV_STITCHING_BLENDERS_HPP__
#if defined(NO)
# warning Detected Apple 'NO' macro definition, it can cause build conflicts. Please, include this header before any Apple headers.
#endif
#include "opencv2/core.hpp"
#include "opencv2/core.hpp"
namespace
cv
{
namespace
cv
{
...
...
modules/stitching/include/opencv2/stitching/detail/exposure_compensate.hpp
View file @
77f54e0f
...
@@ -43,6 +43,10 @@
...
@@ -43,6 +43,10 @@
#ifndef __OPENCV_STITCHING_EXPOSURE_COMPENSATE_HPP__
#ifndef __OPENCV_STITCHING_EXPOSURE_COMPENSATE_HPP__
#define __OPENCV_STITCHING_EXPOSURE_COMPENSATE_HPP__
#define __OPENCV_STITCHING_EXPOSURE_COMPENSATE_HPP__
#if defined(NO)
# warning Detected Apple 'NO' macro definition, it can cause build conflicts. Please, include this header before any Apple headers.
#endif
#include "opencv2/core.hpp"
#include "opencv2/core.hpp"
namespace
cv
{
namespace
cv
{
...
...
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