react-native-camera-vision-pixel-colors 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CameraVisionPixelColors.podspec +32 -0
- package/LICENSE +21 -0
- package/README.md +190 -0
- package/android/CMakeLists.txt +32 -0
- package/android/build.gradle +151 -0
- package/android/fix-prefab.gradle +51 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/cpp/cpp-adapter.cpp +6 -0
- package/android/src/main/java/com/cameravisionpixelcolors/CameraVisionPixelColorsPackage.kt +24 -0
- package/android/src/main/java/com/cameravisionpixelcolors/PixelAnalyzerEngine.kt +256 -0
- package/android/src/main/java/com/cameravisionpixelcolors/PixelColorsFrameProcessor.kt +40 -0
- package/android/src/main/java/com/cameravisionpixelcolors/YuvToBitmapConverter.kt +33 -0
- package/android/src/main/java/com/margelo/nitro/cameravisionpixelcolors/HybridCameraVisionPixelColors.kt +50 -0
- package/app.plugin.js +1 -0
- package/ios/Bridge.h +8 -0
- package/ios/HybridCameraVisionPixelColors.swift +53 -0
- package/ios/PixelAnalyzerEngine.swift +346 -0
- package/ios/PixelColorsFrameProcessor.m +5 -0
- package/ios/PixelColorsFrameProcessor.swift +50 -0
- package/lib/commonjs/index.js +28 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/specs/camera-vision-pixel-colors.nitro.js +6 -0
- package/lib/commonjs/specs/camera-vision-pixel-colors.nitro.js.map +1 -0
- package/lib/module/index.js +23 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/specs/camera-vision-pixel-colors.nitro.js +4 -0
- package/lib/module/specs/camera-vision-pixel-colors.nitro.js.map +1 -0
- package/lib/typescript/src/index.d.ts +6 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/specs/camera-vision-pixel-colors.nitro.d.ts +40 -0
- package/lib/typescript/src/specs/camera-vision-pixel-colors.nitro.d.ts.map +1 -0
- package/nitro.json +25 -0
- package/nitrogen/generated/.gitattributes +1 -0
- package/nitrogen/generated/android/CameraVisionPixelColors+autolinking.cmake +81 -0
- package/nitrogen/generated/android/CameraVisionPixelColors+autolinking.gradle +27 -0
- package/nitrogen/generated/android/CameraVisionPixelColorsOnLoad.cpp +44 -0
- package/nitrogen/generated/android/CameraVisionPixelColorsOnLoad.hpp +25 -0
- package/nitrogen/generated/android/c++/JHybridCameraVisionPixelColorsSpec.cpp +90 -0
- package/nitrogen/generated/android/c++/JHybridCameraVisionPixelColorsSpec.hpp +66 -0
- package/nitrogen/generated/android/c++/JImageData.hpp +66 -0
- package/nitrogen/generated/android/c++/JMotionResult.hpp +61 -0
- package/nitrogen/generated/android/c++/JPixelColorsResult.hpp +114 -0
- package/nitrogen/generated/android/c++/JRGBColor.hpp +65 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cameravisionpixelcolors/CameraVisionPixelColorsOnLoad.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cameravisionpixelcolors/HybridCameraVisionPixelColorsSpec.kt +58 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cameravisionpixelcolors/ImageData.kt +44 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cameravisionpixelcolors/MotionResult.kt +41 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cameravisionpixelcolors/PixelColorsResult.kt +50 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/cameravisionpixelcolors/RGBColor.kt +44 -0
- package/nitrogen/generated/ios/CameraVisionPixelColors+autolinking.rb +60 -0
- package/nitrogen/generated/ios/CameraVisionPixelColors-Swift-Cxx-Bridge.cpp +49 -0
- package/nitrogen/generated/ios/CameraVisionPixelColors-Swift-Cxx-Bridge.hpp +162 -0
- package/nitrogen/generated/ios/CameraVisionPixelColors-Swift-Cxx-Umbrella.hpp +59 -0
- package/nitrogen/generated/ios/CameraVisionPixelColorsAutolinking.mm +33 -0
- package/nitrogen/generated/ios/CameraVisionPixelColorsAutolinking.swift +26 -0
- package/nitrogen/generated/ios/c++/HybridCameraVisionPixelColorsSpecSwift.cpp +11 -0
- package/nitrogen/generated/ios/c++/HybridCameraVisionPixelColorsSpecSwift.hpp +99 -0
- package/nitrogen/generated/ios/swift/Func_void_PixelColorsResult.swift +47 -0
- package/nitrogen/generated/ios/swift/Func_void_std__exception_ptr.swift +47 -0
- package/nitrogen/generated/ios/swift/HybridCameraVisionPixelColorsSpec.swift +56 -0
- package/nitrogen/generated/ios/swift/HybridCameraVisionPixelColorsSpec_cxx.swift +146 -0
- package/nitrogen/generated/ios/swift/ImageData.swift +40 -0
- package/nitrogen/generated/ios/swift/MotionResult.swift +35 -0
- package/nitrogen/generated/ios/swift/PixelColorsResult.swift +81 -0
- package/nitrogen/generated/ios/swift/RGBColor.swift +40 -0
- package/nitrogen/generated/shared/c++/HybridCameraVisionPixelColorsSpec.cpp +21 -0
- package/nitrogen/generated/shared/c++/HybridCameraVisionPixelColorsSpec.hpp +67 -0
- package/nitrogen/generated/shared/c++/ImageData.hpp +91 -0
- package/nitrogen/generated/shared/c++/MotionResult.hpp +87 -0
- package/nitrogen/generated/shared/c++/PixelColorsResult.hpp +105 -0
- package/nitrogen/generated/shared/c++/RGBColor.hpp +91 -0
- package/package.json +143 -0
- package/plugin/withPixelColors.js +12 -0
- package/plugin/withPixelColorsAndroid.js +11 -0
- package/plugin/withPixelColorsIOS.js +11 -0
- package/src/index.ts +42 -0
- package/src/specs/camera-vision-pixel-colors.nitro.ts +40 -0
package/nitrogen/generated/android/kotlin/com/margelo/nitro/cameravisionpixelcolors/ImageData.kt
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// ImageData.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.cameravisionpixelcolors
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
import com.margelo.nitro.core.ArrayBuffer
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Represents the JavaScript object/struct "ImageData".
|
|
16
|
+
*/
|
|
17
|
+
@DoNotStrip
|
|
18
|
+
@Keep
|
|
19
|
+
data class ImageData(
|
|
20
|
+
@DoNotStrip
|
|
21
|
+
@Keep
|
|
22
|
+
val width: Double,
|
|
23
|
+
@DoNotStrip
|
|
24
|
+
@Keep
|
|
25
|
+
val height: Double,
|
|
26
|
+
@DoNotStrip
|
|
27
|
+
@Keep
|
|
28
|
+
val data: ArrayBuffer
|
|
29
|
+
) {
|
|
30
|
+
/* primary constructor */
|
|
31
|
+
|
|
32
|
+
companion object {
|
|
33
|
+
/**
|
|
34
|
+
* Constructor called from C++
|
|
35
|
+
*/
|
|
36
|
+
@DoNotStrip
|
|
37
|
+
@Keep
|
|
38
|
+
@Suppress("unused")
|
|
39
|
+
@JvmStatic
|
|
40
|
+
private fun fromCpp(width: Double, height: Double, data: ArrayBuffer): ImageData {
|
|
41
|
+
return ImageData(width, height, data)
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/cameravisionpixelcolors/MotionResult.kt
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// MotionResult.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.cameravisionpixelcolors
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Represents the JavaScript object/struct "MotionResult".
|
|
16
|
+
*/
|
|
17
|
+
@DoNotStrip
|
|
18
|
+
@Keep
|
|
19
|
+
data class MotionResult(
|
|
20
|
+
@DoNotStrip
|
|
21
|
+
@Keep
|
|
22
|
+
val score: Double,
|
|
23
|
+
@DoNotStrip
|
|
24
|
+
@Keep
|
|
25
|
+
val hasMotion: Boolean
|
|
26
|
+
) {
|
|
27
|
+
/* primary constructor */
|
|
28
|
+
|
|
29
|
+
companion object {
|
|
30
|
+
/**
|
|
31
|
+
* Constructor called from C++
|
|
32
|
+
*/
|
|
33
|
+
@DoNotStrip
|
|
34
|
+
@Keep
|
|
35
|
+
@Suppress("unused")
|
|
36
|
+
@JvmStatic
|
|
37
|
+
private fun fromCpp(score: Double, hasMotion: Boolean): MotionResult {
|
|
38
|
+
return MotionResult(score, hasMotion)
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// PixelColorsResult.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.cameravisionpixelcolors
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Represents the JavaScript object/struct "PixelColorsResult".
|
|
16
|
+
*/
|
|
17
|
+
@DoNotStrip
|
|
18
|
+
@Keep
|
|
19
|
+
data class PixelColorsResult(
|
|
20
|
+
@DoNotStrip
|
|
21
|
+
@Keep
|
|
22
|
+
val uniqueColorCount: Double,
|
|
23
|
+
@DoNotStrip
|
|
24
|
+
@Keep
|
|
25
|
+
val topColors: Array<RGBColor>,
|
|
26
|
+
@DoNotStrip
|
|
27
|
+
@Keep
|
|
28
|
+
val brightestColors: Array<RGBColor>,
|
|
29
|
+
@DoNotStrip
|
|
30
|
+
@Keep
|
|
31
|
+
val motion: MotionResult?,
|
|
32
|
+
@DoNotStrip
|
|
33
|
+
@Keep
|
|
34
|
+
val roiApplied: Boolean?
|
|
35
|
+
) {
|
|
36
|
+
/* primary constructor */
|
|
37
|
+
|
|
38
|
+
companion object {
|
|
39
|
+
/**
|
|
40
|
+
* Constructor called from C++
|
|
41
|
+
*/
|
|
42
|
+
@DoNotStrip
|
|
43
|
+
@Keep
|
|
44
|
+
@Suppress("unused")
|
|
45
|
+
@JvmStatic
|
|
46
|
+
private fun fromCpp(uniqueColorCount: Double, topColors: Array<RGBColor>, brightestColors: Array<RGBColor>, motion: MotionResult?, roiApplied: Boolean?): PixelColorsResult {
|
|
47
|
+
return PixelColorsResult(uniqueColorCount, topColors, brightestColors, motion, roiApplied)
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
package/nitrogen/generated/android/kotlin/com/margelo/nitro/cameravisionpixelcolors/RGBColor.kt
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// RGBColor.kt
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
package com.margelo.nitro.cameravisionpixelcolors
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Keep
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Represents the JavaScript object/struct "RGBColor".
|
|
16
|
+
*/
|
|
17
|
+
@DoNotStrip
|
|
18
|
+
@Keep
|
|
19
|
+
data class RGBColor(
|
|
20
|
+
@DoNotStrip
|
|
21
|
+
@Keep
|
|
22
|
+
val r: Double,
|
|
23
|
+
@DoNotStrip
|
|
24
|
+
@Keep
|
|
25
|
+
val g: Double,
|
|
26
|
+
@DoNotStrip
|
|
27
|
+
@Keep
|
|
28
|
+
val b: Double
|
|
29
|
+
) {
|
|
30
|
+
/* primary constructor */
|
|
31
|
+
|
|
32
|
+
companion object {
|
|
33
|
+
/**
|
|
34
|
+
* Constructor called from C++
|
|
35
|
+
*/
|
|
36
|
+
@DoNotStrip
|
|
37
|
+
@Keep
|
|
38
|
+
@Suppress("unused")
|
|
39
|
+
@JvmStatic
|
|
40
|
+
private fun fromCpp(r: Double, g: Double, b: Double): RGBColor {
|
|
41
|
+
return RGBColor(r, g, b)
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#
|
|
2
|
+
# CameraVisionPixelColors+autolinking.rb
|
|
3
|
+
# This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
# https://github.com/mrousavy/nitro
|
|
5
|
+
# Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
#
|
|
7
|
+
|
|
8
|
+
# This is a Ruby script that adds all files generated by Nitrogen
|
|
9
|
+
# to the given podspec.
|
|
10
|
+
#
|
|
11
|
+
# To use it, add this to your .podspec:
|
|
12
|
+
# ```ruby
|
|
13
|
+
# Pod::Spec.new do |spec|
|
|
14
|
+
# # ...
|
|
15
|
+
#
|
|
16
|
+
# # Add all files generated by Nitrogen
|
|
17
|
+
# load 'nitrogen/generated/ios/CameraVisionPixelColors+autolinking.rb'
|
|
18
|
+
# add_nitrogen_files(spec)
|
|
19
|
+
# end
|
|
20
|
+
# ```
|
|
21
|
+
|
|
22
|
+
def add_nitrogen_files(spec)
|
|
23
|
+
Pod::UI.puts "[NitroModules] 🔥 CameraVisionPixelColors is boosted by nitro!"
|
|
24
|
+
|
|
25
|
+
spec.dependency "NitroModules"
|
|
26
|
+
|
|
27
|
+
current_source_files = Array(spec.attributes_hash['source_files'])
|
|
28
|
+
spec.source_files = current_source_files + [
|
|
29
|
+
# Generated cross-platform specs
|
|
30
|
+
"nitrogen/generated/shared/**/*.{h,hpp,c,cpp,swift}",
|
|
31
|
+
# Generated bridges for the cross-platform specs
|
|
32
|
+
"nitrogen/generated/ios/**/*.{h,hpp,c,cpp,mm,swift}",
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
current_public_header_files = Array(spec.attributes_hash['public_header_files'])
|
|
36
|
+
spec.public_header_files = current_public_header_files + [
|
|
37
|
+
# Generated specs
|
|
38
|
+
"nitrogen/generated/shared/**/*.{h,hpp}",
|
|
39
|
+
# Swift to C++ bridging helpers
|
|
40
|
+
"nitrogen/generated/ios/CameraVisionPixelColors-Swift-Cxx-Bridge.hpp"
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
current_private_header_files = Array(spec.attributes_hash['private_header_files'])
|
|
44
|
+
spec.private_header_files = current_private_header_files + [
|
|
45
|
+
# iOS specific specs
|
|
46
|
+
"nitrogen/generated/ios/c++/**/*.{h,hpp}",
|
|
47
|
+
# Views are framework-specific and should be private
|
|
48
|
+
"nitrogen/generated/shared/**/views/**/*"
|
|
49
|
+
]
|
|
50
|
+
|
|
51
|
+
current_pod_target_xcconfig = spec.attributes_hash['pod_target_xcconfig'] || {}
|
|
52
|
+
spec.pod_target_xcconfig = current_pod_target_xcconfig.merge({
|
|
53
|
+
# Use C++ 20
|
|
54
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
|
|
55
|
+
# Enables C++ <-> Swift interop (by default it's only ObjC)
|
|
56
|
+
"SWIFT_OBJC_INTEROP_MODE" => "objcxx",
|
|
57
|
+
# Enables stricter modular headers
|
|
58
|
+
"DEFINES_MODULE" => "YES",
|
|
59
|
+
})
|
|
60
|
+
end
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// CameraVisionPixelColors-Swift-Cxx-Bridge.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "CameraVisionPixelColors-Swift-Cxx-Bridge.hpp"
|
|
9
|
+
|
|
10
|
+
// Include C++ implementation defined types
|
|
11
|
+
#include "CameraVisionPixelColors-Swift-Cxx-Umbrella.hpp"
|
|
12
|
+
#include "HybridCameraVisionPixelColorsSpecSwift.hpp"
|
|
13
|
+
#include <NitroModules/NitroDefines.hpp>
|
|
14
|
+
|
|
15
|
+
namespace margelo::nitro::cameravisionpixelcolors::bridge::swift {
|
|
16
|
+
|
|
17
|
+
// pragma MARK: std::function<void(const PixelColorsResult& /* result */)>
|
|
18
|
+
Func_void_PixelColorsResult create_Func_void_PixelColorsResult(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
19
|
+
auto swiftClosure = CameraVisionPixelColors::Func_void_PixelColorsResult::fromUnsafe(swiftClosureWrapper);
|
|
20
|
+
return [swiftClosure = std::move(swiftClosure)](const PixelColorsResult& result) mutable -> void {
|
|
21
|
+
swiftClosure.call(result);
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
|
|
26
|
+
Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept {
|
|
27
|
+
auto swiftClosure = CameraVisionPixelColors::Func_void_std__exception_ptr::fromUnsafe(swiftClosureWrapper);
|
|
28
|
+
return [swiftClosure = std::move(swiftClosure)](const std::exception_ptr& error) mutable -> void {
|
|
29
|
+
swiftClosure.call(error);
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// pragma MARK: std::shared_ptr<HybridCameraVisionPixelColorsSpec>
|
|
34
|
+
std::shared_ptr<HybridCameraVisionPixelColorsSpec> create_std__shared_ptr_HybridCameraVisionPixelColorsSpec_(void* NON_NULL swiftUnsafePointer) noexcept {
|
|
35
|
+
CameraVisionPixelColors::HybridCameraVisionPixelColorsSpec_cxx swiftPart = CameraVisionPixelColors::HybridCameraVisionPixelColorsSpec_cxx::fromUnsafe(swiftUnsafePointer);
|
|
36
|
+
return std::make_shared<margelo::nitro::cameravisionpixelcolors::HybridCameraVisionPixelColorsSpecSwift>(swiftPart);
|
|
37
|
+
}
|
|
38
|
+
void* NON_NULL get_std__shared_ptr_HybridCameraVisionPixelColorsSpec_(std__shared_ptr_HybridCameraVisionPixelColorsSpec_ cppType) {
|
|
39
|
+
std::shared_ptr<margelo::nitro::cameravisionpixelcolors::HybridCameraVisionPixelColorsSpecSwift> swiftWrapper = std::dynamic_pointer_cast<margelo::nitro::cameravisionpixelcolors::HybridCameraVisionPixelColorsSpecSwift>(cppType);
|
|
40
|
+
#ifdef NITRO_DEBUG
|
|
41
|
+
if (swiftWrapper == nullptr) [[unlikely]] {
|
|
42
|
+
throw std::runtime_error("Class \"HybridCameraVisionPixelColorsSpec\" is not implemented in Swift!");
|
|
43
|
+
}
|
|
44
|
+
#endif
|
|
45
|
+
CameraVisionPixelColors::HybridCameraVisionPixelColorsSpec_cxx& swiftPart = swiftWrapper->getSwiftPart();
|
|
46
|
+
return swiftPart.toUnsafe();
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
} // namespace margelo::nitro::cameravisionpixelcolors::bridge::swift
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// CameraVisionPixelColors-Swift-Cxx-Bridge.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
// Forward declarations of C++ defined types
|
|
11
|
+
// Forward declaration of `HybridCameraVisionPixelColorsSpec` to properly resolve imports.
|
|
12
|
+
namespace margelo::nitro::cameravisionpixelcolors { class HybridCameraVisionPixelColorsSpec; }
|
|
13
|
+
// Forward declaration of `MotionResult` to properly resolve imports.
|
|
14
|
+
namespace margelo::nitro::cameravisionpixelcolors { struct MotionResult; }
|
|
15
|
+
// Forward declaration of `PixelColorsResult` to properly resolve imports.
|
|
16
|
+
namespace margelo::nitro::cameravisionpixelcolors { struct PixelColorsResult; }
|
|
17
|
+
// Forward declaration of `RGBColor` to properly resolve imports.
|
|
18
|
+
namespace margelo::nitro::cameravisionpixelcolors { struct RGBColor; }
|
|
19
|
+
|
|
20
|
+
// Forward declarations of Swift defined types
|
|
21
|
+
// Forward declaration of `HybridCameraVisionPixelColorsSpec_cxx` to properly resolve imports.
|
|
22
|
+
namespace CameraVisionPixelColors { class HybridCameraVisionPixelColorsSpec_cxx; }
|
|
23
|
+
|
|
24
|
+
// Include C++ defined types
|
|
25
|
+
#include "HybridCameraVisionPixelColorsSpec.hpp"
|
|
26
|
+
#include "MotionResult.hpp"
|
|
27
|
+
#include "PixelColorsResult.hpp"
|
|
28
|
+
#include "RGBColor.hpp"
|
|
29
|
+
#include <NitroModules/Promise.hpp>
|
|
30
|
+
#include <NitroModules/PromiseHolder.hpp>
|
|
31
|
+
#include <NitroModules/Result.hpp>
|
|
32
|
+
#include <exception>
|
|
33
|
+
#include <functional>
|
|
34
|
+
#include <memory>
|
|
35
|
+
#include <optional>
|
|
36
|
+
#include <vector>
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Contains specialized versions of C++ templated types so they can be accessed from Swift,
|
|
40
|
+
* as well as helper functions to interact with those C++ types from Swift.
|
|
41
|
+
*/
|
|
42
|
+
namespace margelo::nitro::cameravisionpixelcolors::bridge::swift {
|
|
43
|
+
|
|
44
|
+
// pragma MARK: std::vector<RGBColor>
|
|
45
|
+
/**
|
|
46
|
+
* Specialized version of `std::vector<RGBColor>`.
|
|
47
|
+
*/
|
|
48
|
+
using std__vector_RGBColor_ = std::vector<RGBColor>;
|
|
49
|
+
inline std::vector<RGBColor> create_std__vector_RGBColor_(size_t size) noexcept {
|
|
50
|
+
std::vector<RGBColor> vector;
|
|
51
|
+
vector.reserve(size);
|
|
52
|
+
return vector;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// pragma MARK: std::optional<MotionResult>
|
|
56
|
+
/**
|
|
57
|
+
* Specialized version of `std::optional<MotionResult>`.
|
|
58
|
+
*/
|
|
59
|
+
using std__optional_MotionResult_ = std::optional<MotionResult>;
|
|
60
|
+
inline std::optional<MotionResult> create_std__optional_MotionResult_(const MotionResult& value) noexcept {
|
|
61
|
+
return std::optional<MotionResult>(value);
|
|
62
|
+
}
|
|
63
|
+
inline bool has_value_std__optional_MotionResult_(const std::optional<MotionResult>& optional) noexcept {
|
|
64
|
+
return optional.has_value();
|
|
65
|
+
}
|
|
66
|
+
inline MotionResult get_std__optional_MotionResult_(const std::optional<MotionResult>& optional) noexcept {
|
|
67
|
+
return *optional;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// pragma MARK: std::optional<bool>
|
|
71
|
+
/**
|
|
72
|
+
* Specialized version of `std::optional<bool>`.
|
|
73
|
+
*/
|
|
74
|
+
using std__optional_bool_ = std::optional<bool>;
|
|
75
|
+
inline std::optional<bool> create_std__optional_bool_(const bool& value) noexcept {
|
|
76
|
+
return std::optional<bool>(value);
|
|
77
|
+
}
|
|
78
|
+
inline bool has_value_std__optional_bool_(const std::optional<bool>& optional) noexcept {
|
|
79
|
+
return optional.has_value();
|
|
80
|
+
}
|
|
81
|
+
inline bool get_std__optional_bool_(const std::optional<bool>& optional) noexcept {
|
|
82
|
+
return *optional;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// pragma MARK: std::shared_ptr<Promise<PixelColorsResult>>
|
|
86
|
+
/**
|
|
87
|
+
* Specialized version of `std::shared_ptr<Promise<PixelColorsResult>>`.
|
|
88
|
+
*/
|
|
89
|
+
using std__shared_ptr_Promise_PixelColorsResult__ = std::shared_ptr<Promise<PixelColorsResult>>;
|
|
90
|
+
inline std::shared_ptr<Promise<PixelColorsResult>> create_std__shared_ptr_Promise_PixelColorsResult__() noexcept {
|
|
91
|
+
return Promise<PixelColorsResult>::create();
|
|
92
|
+
}
|
|
93
|
+
inline PromiseHolder<PixelColorsResult> wrap_std__shared_ptr_Promise_PixelColorsResult__(std::shared_ptr<Promise<PixelColorsResult>> promise) noexcept {
|
|
94
|
+
return PromiseHolder<PixelColorsResult>(std::move(promise));
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// pragma MARK: std::function<void(const PixelColorsResult& /* result */)>
|
|
98
|
+
/**
|
|
99
|
+
* Specialized version of `std::function<void(const PixelColorsResult&)>`.
|
|
100
|
+
*/
|
|
101
|
+
using Func_void_PixelColorsResult = std::function<void(const PixelColorsResult& /* result */)>;
|
|
102
|
+
/**
|
|
103
|
+
* Wrapper class for a `std::function<void(const PixelColorsResult& / * result * /)>`, this can be used from Swift.
|
|
104
|
+
*/
|
|
105
|
+
class Func_void_PixelColorsResult_Wrapper final {
|
|
106
|
+
public:
|
|
107
|
+
explicit Func_void_PixelColorsResult_Wrapper(std::function<void(const PixelColorsResult& /* result */)>&& func): _function(std::make_unique<std::function<void(const PixelColorsResult& /* result */)>>(std::move(func))) {}
|
|
108
|
+
inline void call(PixelColorsResult result) const noexcept {
|
|
109
|
+
_function->operator()(result);
|
|
110
|
+
}
|
|
111
|
+
private:
|
|
112
|
+
std::unique_ptr<std::function<void(const PixelColorsResult& /* result */)>> _function;
|
|
113
|
+
} SWIFT_NONCOPYABLE;
|
|
114
|
+
Func_void_PixelColorsResult create_Func_void_PixelColorsResult(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
115
|
+
inline Func_void_PixelColorsResult_Wrapper wrap_Func_void_PixelColorsResult(Func_void_PixelColorsResult value) noexcept {
|
|
116
|
+
return Func_void_PixelColorsResult_Wrapper(std::move(value));
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// pragma MARK: std::function<void(const std::exception_ptr& /* error */)>
|
|
120
|
+
/**
|
|
121
|
+
* Specialized version of `std::function<void(const std::exception_ptr&)>`.
|
|
122
|
+
*/
|
|
123
|
+
using Func_void_std__exception_ptr = std::function<void(const std::exception_ptr& /* error */)>;
|
|
124
|
+
/**
|
|
125
|
+
* Wrapper class for a `std::function<void(const std::exception_ptr& / * error * /)>`, this can be used from Swift.
|
|
126
|
+
*/
|
|
127
|
+
class Func_void_std__exception_ptr_Wrapper final {
|
|
128
|
+
public:
|
|
129
|
+
explicit Func_void_std__exception_ptr_Wrapper(std::function<void(const std::exception_ptr& /* error */)>&& func): _function(std::make_unique<std::function<void(const std::exception_ptr& /* error */)>>(std::move(func))) {}
|
|
130
|
+
inline void call(std::exception_ptr error) const noexcept {
|
|
131
|
+
_function->operator()(error);
|
|
132
|
+
}
|
|
133
|
+
private:
|
|
134
|
+
std::unique_ptr<std::function<void(const std::exception_ptr& /* error */)>> _function;
|
|
135
|
+
} SWIFT_NONCOPYABLE;
|
|
136
|
+
Func_void_std__exception_ptr create_Func_void_std__exception_ptr(void* NON_NULL swiftClosureWrapper) noexcept;
|
|
137
|
+
inline Func_void_std__exception_ptr_Wrapper wrap_Func_void_std__exception_ptr(Func_void_std__exception_ptr value) noexcept {
|
|
138
|
+
return Func_void_std__exception_ptr_Wrapper(std::move(value));
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// pragma MARK: std::shared_ptr<HybridCameraVisionPixelColorsSpec>
|
|
142
|
+
/**
|
|
143
|
+
* Specialized version of `std::shared_ptr<HybridCameraVisionPixelColorsSpec>`.
|
|
144
|
+
*/
|
|
145
|
+
using std__shared_ptr_HybridCameraVisionPixelColorsSpec_ = std::shared_ptr<HybridCameraVisionPixelColorsSpec>;
|
|
146
|
+
std::shared_ptr<HybridCameraVisionPixelColorsSpec> create_std__shared_ptr_HybridCameraVisionPixelColorsSpec_(void* NON_NULL swiftUnsafePointer) noexcept;
|
|
147
|
+
void* NON_NULL get_std__shared_ptr_HybridCameraVisionPixelColorsSpec_(std__shared_ptr_HybridCameraVisionPixelColorsSpec_ cppType);
|
|
148
|
+
|
|
149
|
+
// pragma MARK: std::weak_ptr<HybridCameraVisionPixelColorsSpec>
|
|
150
|
+
using std__weak_ptr_HybridCameraVisionPixelColorsSpec_ = std::weak_ptr<HybridCameraVisionPixelColorsSpec>;
|
|
151
|
+
inline std__weak_ptr_HybridCameraVisionPixelColorsSpec_ weakify_std__shared_ptr_HybridCameraVisionPixelColorsSpec_(const std::shared_ptr<HybridCameraVisionPixelColorsSpec>& strong) noexcept { return strong; }
|
|
152
|
+
|
|
153
|
+
// pragma MARK: Result<std::shared_ptr<Promise<PixelColorsResult>>>
|
|
154
|
+
using Result_std__shared_ptr_Promise_PixelColorsResult___ = Result<std::shared_ptr<Promise<PixelColorsResult>>>;
|
|
155
|
+
inline Result_std__shared_ptr_Promise_PixelColorsResult___ create_Result_std__shared_ptr_Promise_PixelColorsResult___(const std::shared_ptr<Promise<PixelColorsResult>>& value) noexcept {
|
|
156
|
+
return Result<std::shared_ptr<Promise<PixelColorsResult>>>::withValue(value);
|
|
157
|
+
}
|
|
158
|
+
inline Result_std__shared_ptr_Promise_PixelColorsResult___ create_Result_std__shared_ptr_Promise_PixelColorsResult___(const std::exception_ptr& error) noexcept {
|
|
159
|
+
return Result<std::shared_ptr<Promise<PixelColorsResult>>>::withError(error);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
} // namespace margelo::nitro::cameravisionpixelcolors::bridge::swift
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// CameraVisionPixelColors-Swift-Cxx-Umbrella.hpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#pragma once
|
|
9
|
+
|
|
10
|
+
// Forward declarations of C++ defined types
|
|
11
|
+
// Forward declaration of `HybridCameraVisionPixelColorsSpec` to properly resolve imports.
|
|
12
|
+
namespace margelo::nitro::cameravisionpixelcolors { class HybridCameraVisionPixelColorsSpec; }
|
|
13
|
+
// Forward declaration of `ImageData` to properly resolve imports.
|
|
14
|
+
namespace margelo::nitro::cameravisionpixelcolors { struct ImageData; }
|
|
15
|
+
// Forward declaration of `MotionResult` to properly resolve imports.
|
|
16
|
+
namespace margelo::nitro::cameravisionpixelcolors { struct MotionResult; }
|
|
17
|
+
// Forward declaration of `PixelColorsResult` to properly resolve imports.
|
|
18
|
+
namespace margelo::nitro::cameravisionpixelcolors { struct PixelColorsResult; }
|
|
19
|
+
// Forward declaration of `RGBColor` to properly resolve imports.
|
|
20
|
+
namespace margelo::nitro::cameravisionpixelcolors { struct RGBColor; }
|
|
21
|
+
|
|
22
|
+
// Include C++ defined types
|
|
23
|
+
#include "HybridCameraVisionPixelColorsSpec.hpp"
|
|
24
|
+
#include "ImageData.hpp"
|
|
25
|
+
#include "MotionResult.hpp"
|
|
26
|
+
#include "PixelColorsResult.hpp"
|
|
27
|
+
#include "RGBColor.hpp"
|
|
28
|
+
#include <NitroModules/ArrayBuffer.hpp>
|
|
29
|
+
#include <NitroModules/Promise.hpp>
|
|
30
|
+
#include <NitroModules/Result.hpp>
|
|
31
|
+
#include <exception>
|
|
32
|
+
#include <memory>
|
|
33
|
+
#include <optional>
|
|
34
|
+
#include <vector>
|
|
35
|
+
|
|
36
|
+
// C++ helpers for Swift
|
|
37
|
+
#include "CameraVisionPixelColors-Swift-Cxx-Bridge.hpp"
|
|
38
|
+
|
|
39
|
+
// Common C++ types used in Swift
|
|
40
|
+
#include <NitroModules/ArrayBufferHolder.hpp>
|
|
41
|
+
#include <NitroModules/AnyMapUtils.hpp>
|
|
42
|
+
#include <NitroModules/RuntimeError.hpp>
|
|
43
|
+
#include <NitroModules/DateToChronoDate.hpp>
|
|
44
|
+
|
|
45
|
+
// Forward declarations of Swift defined types
|
|
46
|
+
// Forward declaration of `HybridCameraVisionPixelColorsSpec_cxx` to properly resolve imports.
|
|
47
|
+
namespace CameraVisionPixelColors { class HybridCameraVisionPixelColorsSpec_cxx; }
|
|
48
|
+
|
|
49
|
+
// Include Swift defined types
|
|
50
|
+
#if __has_include("CameraVisionPixelColors-Swift.h")
|
|
51
|
+
// This header is generated by Xcode/Swift on every app build.
|
|
52
|
+
// If it cannot be found, make sure the Swift module's name (= podspec name) is actually "CameraVisionPixelColors".
|
|
53
|
+
#include "CameraVisionPixelColors-Swift.h"
|
|
54
|
+
// Same as above, but used when building with frameworks (`use_frameworks`)
|
|
55
|
+
#elif __has_include(<CameraVisionPixelColors/CameraVisionPixelColors-Swift.h>)
|
|
56
|
+
#include <CameraVisionPixelColors/CameraVisionPixelColors-Swift.h>
|
|
57
|
+
#else
|
|
58
|
+
#error CameraVisionPixelColors's autogenerated Swift header cannot be found! Make sure the Swift module's name (= podspec name) is actually "CameraVisionPixelColors", and try building the app first.
|
|
59
|
+
#endif
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// CameraVisionPixelColorsAutolinking.mm
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
#import <NitroModules/HybridObjectRegistry.hpp>
|
|
10
|
+
#import "CameraVisionPixelColors-Swift-Cxx-Umbrella.hpp"
|
|
11
|
+
#import <type_traits>
|
|
12
|
+
|
|
13
|
+
#include "HybridCameraVisionPixelColorsSpecSwift.hpp"
|
|
14
|
+
|
|
15
|
+
@interface CameraVisionPixelColorsAutolinking : NSObject
|
|
16
|
+
@end
|
|
17
|
+
|
|
18
|
+
@implementation CameraVisionPixelColorsAutolinking
|
|
19
|
+
|
|
20
|
+
+ (void) load {
|
|
21
|
+
using namespace margelo::nitro;
|
|
22
|
+
using namespace margelo::nitro::cameravisionpixelcolors;
|
|
23
|
+
|
|
24
|
+
HybridObjectRegistry::registerHybridObjectConstructor(
|
|
25
|
+
"CameraVisionPixelColors",
|
|
26
|
+
[]() -> std::shared_ptr<HybridObject> {
|
|
27
|
+
std::shared_ptr<HybridCameraVisionPixelColorsSpec> hybridObject = CameraVisionPixelColors::CameraVisionPixelColorsAutolinking::createCameraVisionPixelColors();
|
|
28
|
+
return hybridObject;
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// CameraVisionPixelColorsAutolinking.swift
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
import NitroModules
|
|
9
|
+
|
|
10
|
+
// TODO: Use empty enums once Swift supports exporting them as namespaces
|
|
11
|
+
// See: https://github.com/swiftlang/swift/pull/83616
|
|
12
|
+
public final class CameraVisionPixelColorsAutolinking {
|
|
13
|
+
public typealias bridge = margelo.nitro.cameravisionpixelcolors.bridge.swift
|
|
14
|
+
|
|
15
|
+
public static func createCameraVisionPixelColors() -> bridge.std__shared_ptr_HybridCameraVisionPixelColorsSpec_ {
|
|
16
|
+
let hybridObject = HybridCameraVisionPixelColors()
|
|
17
|
+
return { () -> bridge.std__shared_ptr_HybridCameraVisionPixelColorsSpec_ in
|
|
18
|
+
let __cxxWrapped = hybridObject.getCxxWrapper()
|
|
19
|
+
return __cxxWrapped.getCxxPart()
|
|
20
|
+
}()
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
public static func isCameraVisionPixelColorsRecyclable() -> Bool {
|
|
24
|
+
return HybridCameraVisionPixelColors.self is any RecyclableView.Type
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
///
|
|
2
|
+
/// HybridCameraVisionPixelColorsSpecSwift.cpp
|
|
3
|
+
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
|
|
4
|
+
/// https://github.com/mrousavy/nitro
|
|
5
|
+
/// Copyright © Marc Rousavy @ Margelo
|
|
6
|
+
///
|
|
7
|
+
|
|
8
|
+
#include "HybridCameraVisionPixelColorsSpecSwift.hpp"
|
|
9
|
+
|
|
10
|
+
namespace margelo::nitro::cameravisionpixelcolors {
|
|
11
|
+
} // namespace margelo::nitro::cameravisionpixelcolors
|