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
420737e0
Commit
420737e0
authored
Oct 17, 2014
by
Maksim Shabunin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing iOS clang warnings, part 1
parent
630eddf2
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
29 additions
and
16 deletions
+29
-16
ios_conversions.mm
modules/imgcodecs/src/ios_conversions.mm
+3
-0
demosaicing.cpp
modules/imgproc/src/demosaicing.cpp
+2
-1
pyramids.cpp
modules/imgproc/src/pyramids.cpp
+11
-4
cap_avfoundation.mm
modules/videoio/src/cap_avfoundation.mm
+7
-6
cap_ios_abstract_camera.mm
modules/videoio/src/cap_ios_abstract_camera.mm
+2
-2
cap_ios_video_camera.mm
modules/videoio/src/cap_ios_video_camera.mm
+3
-2
iOS.cmake
platforms/ios/cmake/Modules/Platform/iOS.cmake
+1
-1
No files found.
modules/imgcodecs/src/ios_conversions.mm
View file @
420737e0
...
...
@@ -47,6 +47,9 @@
#include "opencv2/core.hpp"
#include "precomp.hpp"
UIImage* MatToUIImage(const cv::Mat& image);
void UIImageToMat(const UIImage* image, cv::Mat& m, bool alphaExist);
UIImage* MatToUIImage(const cv::Mat& image) {
NSData *data = [NSData dataWithBytes:image.data
...
...
modules/imgproc/src/demosaicing.cpp
View file @
420737e0
...
...
@@ -368,7 +368,8 @@ public:
uint16x8_t
g0
=
vaddq_u16
(
vshrq_n_u16
(
r0
,
8
),
vshrq_n_u16
(
r2
,
8
));
uint16x8_t
g1
=
vandq_u16
(
r1
,
masklo
);
g0
=
vaddq_u16
(
g0
,
vaddq_u16
(
g1
,
vextq_u16
(
g1
,
g1
,
1
)));
g1
=
vshlq_n_u16
(
vextq_u16
(
g1
,
g1
,
1
),
2
);
uint16x8_t
rot
=
vextq_u16
(
g1
,
g1
,
1
)
g1
=
vshlq_n_u16
(
rot
,
2
);
// g0 = b0 b2 b4 ...
// g1 = b1 b3 b5 ...
...
...
modules/imgproc/src/pyramids.cpp
View file @
420737e0
...
...
@@ -240,14 +240,18 @@ struct PyrDownVec_32s16u
int32x4_t
v_r20
=
vld1q_s32
(
row2
+
x
),
v_r21
=
vld1q_s32
(
row2
+
x
+
4
);
int32x4_t
v_r30
=
vld1q_s32
(
row3
+
x
),
v_r31
=
vld1q_s32
(
row3
+
x
+
4
);
int32x4_t
v_r40
=
vld1q_s32
(
row4
+
x
),
v_r41
=
vld1q_s32
(
row4
+
x
+
4
);
int32x4_t
shifted
;
v_r00
=
vaddq_s32
(
vqaddq_s32
(
v_r00
,
v_r40
),
vqaddq_s32
(
v_r20
,
v_r20
));
v_r10
=
vaddq_s32
(
vqaddq_s32
(
v_r10
,
v_r20
),
v_r30
);
int32x4_t
v_dst0
=
vshrq_n_s32
(
vaddq_s32
(
vqaddq_s32
(
v_r00
,
vshlq_n_s32
(
v_r10
,
2
)),
v_delta
),
8
);
shifted
=
vshlq_n_s32
(
v_r10
,
2
);
int32x4_t
v_dst0
=
vshrq_n_s32
(
vaddq_s32
(
vqaddq_s32
(
v_r00
,
shifted
),
v_delta
),
8
);
v_r01
=
vaddq_s32
(
vqaddq_s32
(
v_r01
,
v_r41
),
vqaddq_s32
(
v_r21
,
v_r21
));
v_r11
=
vaddq_s32
(
vqaddq_s32
(
v_r11
,
v_r21
),
v_r31
);
int32x4_t
v_dst1
=
vshrq_n_s32
(
vaddq_s32
(
vqaddq_s32
(
v_r01
,
vshlq_n_s32
(
v_r11
,
2
)),
v_delta
),
8
);
shifted
=
vshlq_n_s32
(
v_r11
,
2
)
int32x4_t
v_dst1
=
vshrq_n_s32
(
vaddq_s32
(
vqaddq_s32
(
v_r01
,
shifted
),
v_delta
),
8
);
vst1q_u16
(
dst
+
x
,
vcombine_u16
(
vqmovun_s32
(
v_dst0
),
vqmovun_s32
(
v_dst1
)));
}
...
...
@@ -271,14 +275,17 @@ struct PyrDownVec_32s16s
int32x4_t
v_r20
=
vld1q_s32
(
row2
+
x
),
v_r21
=
vld1q_s32
(
row2
+
x
+
4
);
int32x4_t
v_r30
=
vld1q_s32
(
row3
+
x
),
v_r31
=
vld1q_s32
(
row3
+
x
+
4
);
int32x4_t
v_r40
=
vld1q_s32
(
row4
+
x
),
v_r41
=
vld1q_s32
(
row4
+
x
+
4
);
int32x4_t
shifted
;
v_r00
=
vaddq_s32
(
vqaddq_s32
(
v_r00
,
v_r40
),
vqaddq_s32
(
v_r20
,
v_r20
));
v_r10
=
vaddq_s32
(
vqaddq_s32
(
v_r10
,
v_r20
),
v_r30
);
int32x4_t
v_dst0
=
vshrq_n_s32
(
vaddq_s32
(
vqaddq_s32
(
v_r00
,
vshlq_n_s32
(
v_r10
,
2
)),
v_delta
),
8
);
shifted
=
vshlq_n_s32
(
v_r10
,
2
);
int32x4_t
v_dst0
=
vshrq_n_s32
(
vaddq_s32
(
vqaddq_s32
(
v_r00
,
shifted
),
v_delta
),
8
);
v_r01
=
vaddq_s32
(
vqaddq_s32
(
v_r01
,
v_r41
),
vqaddq_s32
(
v_r21
,
v_r21
));
v_r11
=
vaddq_s32
(
vqaddq_s32
(
v_r11
,
v_r21
),
v_r31
);
int32x4_t
v_dst1
=
vshrq_n_s32
(
vaddq_s32
(
vqaddq_s32
(
v_r01
,
vshlq_n_s32
(
v_r11
,
2
)),
v_delta
),
8
);
shifted
=
vshlq_n_s32
(
v_r11
,
2
);
int32x4_t
v_dst1
=
vshrq_n_s32
(
vaddq_s32
(
vqaddq_s32
(
v_r01
,
shifted
),
v_delta
),
8
);
vst1q_s16
(
dst
+
x
,
vcombine_s16
(
vqmovn_s32
(
v_dst0
),
vqmovn_s32
(
v_dst1
)));
}
...
...
modules/videoio/src/cap_avfoundation.mm
View file @
420737e0
...
...
@@ -181,7 +181,6 @@ class CvVideoWriter_AVFoundation : public CvVideoWriter{
AVAssetWriterInput* mMovieWriterInput;
AVAssetWriterInputPixelBufferAdaptor* mMovieWriterAdaptor;
unsigned char* imagedata;
NSString* path;
NSString* codec;
NSString* fileType;
...
...
@@ -490,15 +489,15 @@ double CvCaptureCAM::getProperty(int property_id){
CMFormatDescriptionRef format = [[ports objectAtIndex:0] formatDescription];
CGSize s1 = CMVideoFormatDescriptionGetPresentationDimensions(format, YES, YES);
int w
idth=(int)s1.width, height
=(int)s1.height;
int w
=(int)s1.width, h
=(int)s1.height;
[localpool drain];
switch (property_id) {
case CV_CAP_PROP_FRAME_WIDTH:
return w
idth
;
return w;
case CV_CAP_PROP_FRAME_HEIGHT:
return h
eight
;
return h;
case CV_CAP_PROP_IOS_DEVICE_FOCUS:
return mCaptureDevice.focusMode;
...
...
@@ -659,6 +658,8 @@ fromConnection:(AVCaptureConnection *)connection{
// Failed
// connection.videoOrientation = AVCaptureVideoOrientationPortrait;
(void)captureOutput;
(void)connection;
CVImageBufferRef imageBuffer = CMSampleBufferGetImageBuffer(sampleBuffer);
...
...
@@ -1009,7 +1010,7 @@ double CvCaptureFile::getFPS() {
return 30.0; //TODO: Debugging
}
double CvCaptureFile::getProperty(int
property_id
){
double CvCaptureFile::getProperty(int
/*property_id*/
){
/*
if (mCaptureSession == nil) return 0;
...
...
@@ -1050,7 +1051,7 @@ double CvCaptureFile::getProperty(int property_id){
return 1.0; //Debugging
}
bool CvCaptureFile::setProperty(int
property_id, double value
) {
bool CvCaptureFile::setProperty(int
/*property_id*/, double /*value*/
) {
/*
if (mCaptureSession == nil) return false;
...
...
modules/videoio/src/cap_ios_abstract_camera.mm
View file @
420737e0
...
...
@@ -308,7 +308,7 @@
if ([device position] == desiredPosition) {
[self.captureSession beginConfiguration];
NSError* error;
NSError* error
= nil
;
AVCaptureDeviceInput *input = [AVCaptureDeviceInput deviceInputWithDevice:device error:&error];
if (!input) {
NSLog(@"error creating input %@", [error localizedDescription]);
...
...
@@ -316,7 +316,7 @@
// support for autofocus
if ([device isFocusModeSupported:AVCaptureFocusModeContinuousAutoFocus]) {
NSError *
error = nil;
error = nil;
if ([device lockForConfiguration:&error]) {
device.focusMode = AVCaptureFocusModeContinuousAutoFocus;
[device unlockForConfiguration];
...
...
modules/videoio/src/cap_ios_video_camera.mm
View file @
420737e0
...
...
@@ -101,7 +101,7 @@ static CGFloat DegreesToRadians(CGFloat degrees) {return degrees * M_PI / 180;}
[super start];
if (self.recordVideo == YES) {
NSError* error;
NSError* error
= nil
;
if ([[NSFileManager defaultManager] fileExistsAtPath:[self videoFileString]]) {
[[NSFileManager defaultManager] removeItemAtPath:[self videoFileString] error:&error];
}
...
...
@@ -424,6 +424,8 @@ static CGFloat DegreesToRadians(CGFloat degrees) {return degrees * M_PI / 180;}
- (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection
{
(void)captureOutput;
(void)connection;
if (self.delegate) {
// convert from Core Media to Core Video
...
...
@@ -464,7 +466,6 @@ static CGFloat DegreesToRadians(CGFloat degrees) {return degrees * M_PI / 180;}
// delegate image processing to the delegate
cv::Mat image(height, width, format_opencv, bufferAddress, bytesPerRow);
cv::Mat* result = NULL;
CGImage* dstImage;
if ([self.delegate respondsToSelector:@selector(processImage:)]) {
...
...
platforms/ios/cmake/Modules/Platform/iOS.cmake
View file @
420737e0
...
...
@@ -44,7 +44,7 @@ set (CMAKE_CXX_FLAGS "-stdlib=libc++ -fvisibility=hidden -fvisibility-inlines-hi
set
(
CMAKE_CXX_FLAGS_RELEASE
"-DNDEBUG -O3 -fomit-frame-pointer -ffast-math"
)
# Silence some warnings
set
(
no_warn
"-Wno-unused-function -Wno-unused-parameter -Wno-strict-prototypes -Wno-missing-prototypes -Wno-missing-declarations -Wno-unused-const-variable -Wno-overloaded-virtual"
)
set
(
no_warn
"-Wno-
semicolon-before-method-body -Wno-
unused-function -Wno-unused-parameter -Wno-strict-prototypes -Wno-missing-prototypes -Wno-missing-declarations -Wno-unused-const-variable -Wno-overloaded-virtual"
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
${
no_warn
}
"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
${
no_warn
}
"
)
# Additional linker flag
...
...
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