Skip to content

Commit c57536b

Browse files
Merge pull request #30 from lukaszkurantdev/chore/pod-update
OpenCV iOS update
2 parents 2ec851a + 44e188f commit c57536b

File tree

4 files changed

+12
-15
lines changed

4 files changed

+12
-15
lines changed

cpp/ConvertImage.cpp

+4-7
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,10 @@ std::string ImageConverter::base64_decode(std::string const& encoded_string)
141141

142142
string ImageConverter::mat2str(const Mat& m)
143143
{
144-
int params[3] = {0};
145-
params[0] = IMWRITE_JPEG_QUALITY;
146-
params[1] = 100;
147-
148144
vector<uchar> buf;
149-
bool code = cv::imencode(".jpg", m, buf, std::vector<int>(params, params+2));
150-
uchar* result = reinterpret_cast<uchar*> (&buf[0]);
151-
145+
cv::imencode(".jpeg", m, buf);
146+
auto result = reinterpret_cast<const unsigned char*>(buf.data());
147+
152148
return base64_encode(result, buf.size());
153149

154150
}
@@ -160,5 +156,6 @@ Mat ImageConverter::str2mat(const string& s)
160156
vector<uchar> data(decoded_string.begin(), decoded_string.end());
161157

162158
cv::Mat img = imdecode(data, IMREAD_UNCHANGED);
159+
163160
return img;
164161
}

cpp/FOCV_Function.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55
// Created by Łukasz Kurant on 06/08/2024.
66
//
7-
7+
#include <iostream>
88
#include "FOCV_Function.hpp"
99
#include "FOCV_Storage.hpp"
1010
#include "FOCV_Ids.hpp"

example/ios/Podfile.lock

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
PODS:
22
- boost (1.83.0)
33
- DoubleConversion (1.1.6)
4+
- FastOpenCV-iOS (1.0.4)
45
- FBLazyVector (0.74.4)
56
- fmt (9.1.0)
67
- glog (0.3.5)
78
- hermes-engine (0.74.4):
89
- hermes-engine/Pre-built (= 0.74.4)
910
- hermes-engine/Pre-built (0.74.4)
10-
- OpenCV (4.3.0)
1111
- RCT-Folly (2024.01.01.00):
1212
- boost
1313
- DoubleConversion
@@ -936,11 +936,11 @@ PODS:
936936
- React-Mapbuffer (0.74.4):
937937
- glog
938938
- React-debug
939-
- react-native-fast-opencv (0.2.9):
939+
- react-native-fast-opencv (0.2.13):
940940
- DoubleConversion
941+
- FastOpenCV-iOS (= 1.0.4)
941942
- glog
942943
- hermes-engine
943-
- OpenCV (~> 4.3.0)
944944
- RCT-Folly (= 2024.01.01.00)
945945
- RCTRequired
946946
- RCTTypeSafety
@@ -1430,7 +1430,7 @@ DEPENDENCIES:
14301430

14311431
SPEC REPOS:
14321432
trunk:
1433-
- OpenCV
1433+
- FastOpenCV-iOS
14341434
- SocketRocket
14351435

14361436
EXTERNAL SOURCES:
@@ -1565,11 +1565,11 @@ EXTERNAL SOURCES:
15651565
SPEC CHECKSUMS:
15661566
boost: d3f49c53809116a5d38da093a8aa78bf551aed09
15671567
DoubleConversion: 76ab83afb40bddeeee456813d9c04f67f78771b5
1568+
FastOpenCV-iOS: 2057f306db3ad068577e6fca38411f1b1920d71e
15681569
FBLazyVector: 4c674c2d53de79c145d6a723910543d7b57ed74c
15691570
fmt: 4c2741a687cc09f0634a2e2c72a838b99f1ff120
15701571
glog: fdfdfe5479092de0c4bdbebedd9056951f092c4f
15711572
hermes-engine: 6312f669c895e05f0f6029554061593711770ea6
1572-
OpenCV: 681e0451c1e54c5930a8922277f817ed5d5ab459
15731573
RCT-Folly: 02617c592a293bd6d418e0a88ff4ee1f88329b47
15741574
RCTDeprecation: d83da85890d5bb18efd2809a733865c1c5c11487
15751575
RCTRequired: e109419eacfb10fbb79a3ecb57ebcad198593d8a
@@ -1594,7 +1594,7 @@ SPEC CHECKSUMS:
15941594
React-jsitracing: 4e9c99e73a6269b27b0d4cbab277dd90df3e5ac0
15951595
React-logger: fbfb50e2a2b1b46ee087f0a52739fadecc5e81a4
15961596
React-Mapbuffer: d39610dff659d8cf1fea485abae08bbf6f9c8279
1597-
react-native-fast-opencv: dd72ca1a7a247326ffd83daa46a9c17487c3948b
1597+
react-native-fast-opencv: 42e907a906c94bd081a62de430ce3938865af7e9
15981598
react-native-image-picker: c3afe5472ef870d98a4b28415fc0b928161ee5f7
15991599
react-native-safe-area-context: 851c62c48dce80ccaa5637b6aa5991a1bc36eca9
16001600
react-native-skia: 8da84ea9410504bf27f0db229539a43f6caabb6a

react-native-fast-opencv.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
1616

1717
s.source_files = "ios/**/*.{h,m,mm}", "cpp/**/*.{hpp,cpp,c,h}"
1818

19-
s.dependency "OpenCV", "~> 4.3.0"
19+
s.dependency 'FastOpenCV-iOS', '1.0.4'
2020

2121
# Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
2222
# See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.

0 commit comments

Comments
 (0)