ilabs-flir 1.0.2 → 1.0.4
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/Flir.podspec +31 -31
- package/README.md +1271 -1271
- package/android/Flir/build.gradle.kts +85 -80
- package/android/Flir/libs/flir-stubs.jar +0 -0
- package/android/Flir/src/main/AndroidManifest.xml +31 -31
- package/android/Flir/src/main/java/com/flir/thermalsdk/ErrorCode.java +13 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/ErrorCodeException.java +14 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/ThermalSdkAndroid.java +16 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/androidsdk/image/BitmapAndroid.java +20 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/image/ImageBuffer.java +11 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/image/JavaImageBuffer.java +35 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/image/Palette.java +15 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/image/PaletteManager.java +16 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/image/Point.java +11 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/image/ThermalImage.java +23 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/image/ThermalValue.java +9 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/live/Camera.java +26 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/live/CameraType.java +8 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/live/CommunicationInterface.java +16 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/live/ConnectParameters.java +16 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/live/Identity.java +23 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/live/IpSettings.java +9 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/live/RemoteControl.java +16 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/live/connectivity/ConnectionStatusListener.java +7 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/live/discovery/DiscoveryEventListener.java +14 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/live/discovery/DiscoveryFactory.java +33 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/live/remote/OnReceived.java +5 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/live/remote/OnRemoteError.java +7 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/live/streaming/Stream.java +8 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/live/streaming/ThermalStreamer.java +28 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/live/streaming/VisualStreamer.java +18 -0
- package/android/Flir/src/main/java/flir/android/FlirCommands.java +136 -0
- package/android/Flir/src/main/java/flir/android/FlirDownloadManager.kt +76 -75
- package/android/Flir/src/main/java/flir/android/FlirDownloadPackage.kt +16 -16
- package/android/Flir/src/main/java/flir/android/FlirFrameCache.kt +6 -6
- package/android/Flir/src/main/java/flir/android/FlirManager.kt +477 -248
- package/android/Flir/src/main/java/flir/android/FlirModule.kt +74 -74
- package/android/Flir/src/main/java/flir/android/FlirPackage.kt +19 -19
- package/android/Flir/src/main/java/flir/android/FlirSDKLoader.kt +165 -117
- package/android/Flir/src/main/java/flir/android/FlirSdkManager.java +1511 -0
- package/android/Flir/src/main/java/flir/android/FlirStatus.kt +12 -12
- package/android/Flir/src/main/java/flir/android/FlirView.kt +48 -48
- package/android/Flir/src/main/java/flir/android/FlirViewManager.kt +13 -13
- package/app.plugin.js +264 -264
- package/expo-module.config.json +5 -5
- package/ios/Flir/Framework/ThermalSDK/FLIRBattery.h +76 -76
- package/ios/Flir/Framework/ThermalSDK/FLIRCalibration.h +108 -108
- package/ios/Flir/Framework/ThermalSDK/FLIRCamera.h +156 -156
- package/ios/Flir/Framework/ThermalSDK/FLIRCameraDeviceInfo.h +53 -53
- package/ios/Flir/Framework/ThermalSDK/FLIRCameraEvent.h +132 -132
- package/ios/Flir/Framework/ThermalSDK/FLIRCameraImport.h +204 -204
- package/ios/Flir/Framework/ThermalSDK/FLIRColorDistributionSettings.h +204 -204
- package/ios/Flir/Framework/ThermalSDK/FLIRColorizer.h +82 -82
- package/ios/Flir/Framework/ThermalSDK/FLIRDiscoveredCamera.h +44 -44
- package/ios/Flir/Framework/ThermalSDK/FLIRDiscovery.h +132 -132
- package/ios/Flir/Framework/ThermalSDK/FLIRDisplaySettings.h +29 -29
- package/ios/Flir/Framework/ThermalSDK/FLIRFocus.h +70 -70
- package/ios/Flir/Framework/ThermalSDK/FLIRFusion.h +192 -192
- package/ios/Flir/Framework/ThermalSDK/FLIRFusionController.h +136 -136
- package/ios/Flir/Framework/ThermalSDK/FLIRFusionTransformation.h +35 -35
- package/ios/Flir/Framework/ThermalSDK/FLIRIdentity.h +264 -264
- package/ios/Flir/Framework/ThermalSDK/FLIRImageBase.h +196 -196
- package/ios/Flir/Framework/ThermalSDK/FLIRImageColorizer.h +26 -26
- package/ios/Flir/Framework/ThermalSDK/FLIRImageStatistics.h +61 -61
- package/ios/Flir/Framework/ThermalSDK/FLIRIsotherms.h +208 -208
- package/ios/Flir/Framework/ThermalSDK/FLIRMeasurementArea.h +38 -38
- package/ios/Flir/Framework/ThermalSDK/FLIRMeasurementCollection.h +147 -147
- package/ios/Flir/Framework/ThermalSDK/FLIRMeasurementDelta.h +62 -62
- package/ios/Flir/Framework/ThermalSDK/FLIRMeasurementDimensions.h +33 -33
- package/ios/Flir/Framework/ThermalSDK/FLIRMeasurementEllipse.h +49 -49
- package/ios/Flir/Framework/ThermalSDK/FLIRMeasurementLine.h +66 -66
- package/ios/Flir/Framework/ThermalSDK/FLIRMeasurementMarker.h +69 -69
- package/ios/Flir/Framework/ThermalSDK/FLIRMeasurementParameters.h +41 -41
- package/ios/Flir/Framework/ThermalSDK/FLIRMeasurementRectangle.h +36 -36
- package/ios/Flir/Framework/ThermalSDK/FLIRMeasurementReference.h +27 -27
- package/ios/Flir/Framework/ThermalSDK/FLIRMeasurementShape.h +46 -46
- package/ios/Flir/Framework/ThermalSDK/FLIRMeasurementSpot.h +33 -33
- package/ios/Flir/Framework/ThermalSDK/FLIRMeasurementsController.h +160 -160
- package/ios/Flir/Framework/ThermalSDK/FLIRMeterLinkSensorPoll.h +247 -247
- package/ios/Flir/Framework/ThermalSDK/FLIROverlayController.h +27 -27
- package/ios/Flir/Framework/ThermalSDK/FLIRPalette.h +60 -60
- package/ios/Flir/Framework/ThermalSDK/FLIRPaletteController.h +36 -36
- package/ios/Flir/Framework/ThermalSDK/FLIRPaletteManager.h +97 -97
- package/ios/Flir/Framework/ThermalSDK/FLIRQuantification.h +55 -55
- package/ios/Flir/Framework/ThermalSDK/FLIRRemoteControl.h +393 -393
- package/ios/Flir/Framework/ThermalSDK/FLIRRenderer.h +35 -35
- package/ios/Flir/Framework/ThermalSDK/FLIRRendererImpl.h +17 -17
- package/ios/Flir/Framework/ThermalSDK/FLIRScale.h +99 -99
- package/ios/Flir/Framework/ThermalSDK/FLIRScaleController.h +44 -44
- package/ios/Flir/Framework/ThermalSDK/FLIRStream.h +109 -109
- package/ios/Flir/Framework/ThermalSDK/FLIRStreamer.h +124 -124
- package/ios/Flir/Framework/ThermalSDK/FLIRSystem.h +40 -40
- package/ios/Flir/Framework/ThermalSDK/FLIRTemperatureRange.h +43 -43
- package/ios/Flir/Framework/ThermalSDK/FLIRThermalDelta.h +77 -77
- package/ios/Flir/Framework/ThermalSDK/FLIRThermalImage.h +331 -331
- package/ios/Flir/Framework/ThermalSDK/FLIRThermalImageFile.h +56 -56
- package/ios/Flir/Framework/ThermalSDK/FLIRThermalParameters.h +31 -31
- package/ios/Flir/Framework/ThermalSDK/FLIRThermalValue.h +92 -92
- package/ios/Flir/Framework/ThermalSDK/FLIRWirelessCameraDetails.h +88 -88
- package/ios/Flir/Framework/ThermalSDK/ThermalSDK.h +73 -73
- package/ios/Flir/SDKLoader/FlirSDKLoader.m +13 -13
- package/ios/Flir/SDKLoader/FlirSDKLoader.swift +175 -175
- package/ios/Flir/src/FlirEventEmitter.h +12 -12
- package/ios/Flir/src/FlirEventEmitter.m +33 -33
- package/ios/Flir/src/FlirModule.h +10 -10
- package/ios/Flir/src/FlirModule.m +381 -381
- package/ios/Flir/src/FlirPreviewView.h +13 -13
- package/ios/Flir/src/FlirPreviewView.m +24 -24
- package/ios/Flir/src/FlirState.h +20 -20
- package/ios/Flir/src/FlirState.m +79 -79
- package/ios/Flir/src/FlirViewManager.h +9 -9
- package/ios/Flir/src/FlirViewManager.m +16 -16
- package/package.json +60 -60
- package/react-native.config.js +14 -14
- package/scripts/copy_ios_libs.sh +32 -32
- package/scripts/create_stubs.py +174 -174
- package/scripts/download-sdk.js +62 -62
- package/scripts/prepare-binaries.sh +171 -171
- package/sdk-manifest.json +37 -30
- package/src/FlirDownload.ts +78 -78
- package/src/index.d.ts +17 -17
- package/src/index.js +7 -7
- package/src/index.ts +7 -7
- package/android/Flir/src/main/java/flir/android/CameraHandler.java +0 -194
- package/android/Flir/src/main/java/flir/android/FlirController.kt +0 -11
- package/android/Flir/src/main/java/flir/android/FrameDataHolder.java +0 -14
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
#import <UIKit/UIKit.h>
|
|
2
|
-
|
|
3
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
4
|
-
|
|
5
|
-
@interface FlirPreviewView : UIView
|
|
6
|
-
|
|
7
|
-
@property (nonatomic, assign) double lastTemperature;
|
|
8
|
-
|
|
9
|
-
- (void)updateWithFrameImage:(UIImage *)image temperature:(double)temperature;
|
|
10
|
-
|
|
11
|
-
@end
|
|
12
|
-
|
|
13
|
-
NS_ASSUME_NONNULL_END
|
|
1
|
+
#import <UIKit/UIKit.h>
|
|
2
|
+
|
|
3
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
4
|
+
|
|
5
|
+
@interface FlirPreviewView : UIView
|
|
6
|
+
|
|
7
|
+
@property (nonatomic, assign) double lastTemperature;
|
|
8
|
+
|
|
9
|
+
- (void)updateWithFrameImage:(UIImage *)image temperature:(double)temperature;
|
|
10
|
+
|
|
11
|
+
@end
|
|
12
|
+
|
|
13
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
#import "FlirPreviewView.h"
|
|
2
|
-
#import "FlirState.h"
|
|
3
|
-
|
|
4
|
-
@implementation FlirPreviewView
|
|
5
|
-
|
|
6
|
-
- (instancetype)initWithFrame:(CGRect)frame
|
|
7
|
-
{
|
|
8
|
-
if (self = [super initWithFrame:frame]) {
|
|
9
|
-
self.backgroundColor = [UIColor blackColor];
|
|
10
|
-
_lastTemperature = NAN;
|
|
11
|
-
}
|
|
12
|
-
return self;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
- (void)updateWithFrameImage:(UIImage *)image temperature:(double)temperature
|
|
16
|
-
{
|
|
17
|
-
dispatch_async(dispatch_get_main_queue(), ^{
|
|
18
|
-
self.layer.contents = (id)image.CGImage;
|
|
19
|
-
self.lastTemperature = temperature;
|
|
20
|
-
[FlirState shared].lastTemperature = temperature;
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
@end
|
|
1
|
+
#import "FlirPreviewView.h"
|
|
2
|
+
#import "FlirState.h"
|
|
3
|
+
|
|
4
|
+
@implementation FlirPreviewView
|
|
5
|
+
|
|
6
|
+
- (instancetype)initWithFrame:(CGRect)frame
|
|
7
|
+
{
|
|
8
|
+
if (self = [super initWithFrame:frame]) {
|
|
9
|
+
self.backgroundColor = [UIColor blackColor];
|
|
10
|
+
_lastTemperature = NAN;
|
|
11
|
+
}
|
|
12
|
+
return self;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
- (void)updateWithFrameImage:(UIImage *)image temperature:(double)temperature
|
|
16
|
+
{
|
|
17
|
+
dispatch_async(dispatch_get_main_queue(), ^{
|
|
18
|
+
self.layer.contents = (id)image.CGImage;
|
|
19
|
+
self.lastTemperature = temperature;
|
|
20
|
+
[FlirState shared].lastTemperature = temperature;
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@end
|
package/ios/Flir/src/FlirState.h
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
#import <Foundation/Foundation.h>
|
|
2
|
-
|
|
3
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
4
|
-
|
|
5
|
-
@interface FlirState : NSObject
|
|
6
|
-
|
|
7
|
-
@property (nonatomic, assign) double lastTemperature;
|
|
8
|
-
@property (nonatomic, copy, nullable) void (^onTemperatureUpdate)(double temperature, int x, int y);
|
|
9
|
-
@property (nonatomic, copy, nullable) void (^onTextureUpdate)(UIImage *_Nonnull image, int textureUnit);
|
|
10
|
-
@property (nonatomic, strong, nullable) UIImage *latestImage;
|
|
11
|
-
|
|
12
|
-
+ (instancetype)shared;
|
|
13
|
-
- (double)getTemperatureAt:(int)x y:(int)y;
|
|
14
|
-
- (void)updateFrame:(UIImage *_Nonnull)image;
|
|
15
|
-
- (void)updateFrame:(UIImage *_Nonnull)image withTemperatureData:(NSArray<NSNumber *> *_Nullable)tempData;
|
|
16
|
-
- (double)queryTemperatureAtPoint:(int)x y:(int)y;
|
|
17
|
-
|
|
18
|
-
@end
|
|
19
|
-
|
|
20
|
-
NS_ASSUME_NONNULL_END
|
|
1
|
+
#import <Foundation/Foundation.h>
|
|
2
|
+
|
|
3
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
4
|
+
|
|
5
|
+
@interface FlirState : NSObject
|
|
6
|
+
|
|
7
|
+
@property (nonatomic, assign) double lastTemperature;
|
|
8
|
+
@property (nonatomic, copy, nullable) void (^onTemperatureUpdate)(double temperature, int x, int y);
|
|
9
|
+
@property (nonatomic, copy, nullable) void (^onTextureUpdate)(UIImage *_Nonnull image, int textureUnit);
|
|
10
|
+
@property (nonatomic, strong, nullable) UIImage *latestImage;
|
|
11
|
+
|
|
12
|
+
+ (instancetype)shared;
|
|
13
|
+
- (double)getTemperatureAt:(int)x y:(int)y;
|
|
14
|
+
- (void)updateFrame:(UIImage *_Nonnull)image;
|
|
15
|
+
- (void)updateFrame:(UIImage *_Nonnull)image withTemperatureData:(NSArray<NSNumber *> *_Nullable)tempData;
|
|
16
|
+
- (double)queryTemperatureAtPoint:(int)x y:(int)y;
|
|
17
|
+
|
|
18
|
+
@end
|
|
19
|
+
|
|
20
|
+
NS_ASSUME_NONNULL_END
|
package/ios/Flir/src/FlirState.m
CHANGED
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
#import "FlirState.h"
|
|
2
|
-
|
|
3
|
-
static FlirState *_sharedState = nil;
|
|
4
|
-
|
|
5
|
-
@implementation FlirState {
|
|
6
|
-
NSArray<NSNumber *> *_temperatureData; // Flattened array of temperature values
|
|
7
|
-
int _imageWidth;
|
|
8
|
-
int _imageHeight;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
+ (instancetype)shared
|
|
12
|
-
{
|
|
13
|
-
static dispatch_once_t onceToken;
|
|
14
|
-
dispatch_once(&onceToken, ^{
|
|
15
|
-
_sharedState = [FlirState new];
|
|
16
|
-
_sharedState.lastTemperature = NAN;
|
|
17
|
-
_sharedState.latestImage = nil;
|
|
18
|
-
_sharedState->_temperatureData = nil;
|
|
19
|
-
_sharedState->_imageWidth = 0;
|
|
20
|
-
_sharedState->_imageHeight = 0;
|
|
21
|
-
});
|
|
22
|
-
return _sharedState;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
- (double)getTemperatureAt:(int)x y:(int)y
|
|
26
|
-
{
|
|
27
|
-
// Return cached temperature (will be updated by thermal SDK callbacks)
|
|
28
|
-
// In production, this would query the actual thermal image data at (x,y)
|
|
29
|
-
return self.lastTemperature;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
- (void)updateFrame:(UIImage *)image
|
|
33
|
-
{
|
|
34
|
-
[self updateFrame:image withTemperatureData:nil];
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
- (void)updateFrame:(UIImage *)image withTemperatureData:(NSArray<NSNumber *> *)tempData
|
|
38
|
-
{
|
|
39
|
-
self.latestImage = image;
|
|
40
|
-
|
|
41
|
-
if (tempData != nil) {
|
|
42
|
-
_temperatureData = tempData;
|
|
43
|
-
_imageWidth = (int)image.size.width;
|
|
44
|
-
_imageHeight = (int)image.size.height;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// Invoke texture callback for native Metal filters (texture unit 7)
|
|
48
|
-
if (self.onTextureUpdate) {
|
|
49
|
-
self.onTextureUpdate(image, 7);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// Sample temperature at center point and invoke callback
|
|
53
|
-
if (self.onTemperatureUpdate) {
|
|
54
|
-
double temp = [self getTemperatureAt:80 y:60];
|
|
55
|
-
self.onTemperatureUpdate(temp, 80, 60);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
- (double)queryTemperatureAtPoint:(int)x y:(int)y
|
|
60
|
-
{
|
|
61
|
-
if (_temperatureData == nil || _imageWidth == 0 || _imageHeight == 0) {
|
|
62
|
-
return NAN;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// Bounds check
|
|
66
|
-
if (x < 0 || x >= _imageWidth || y < 0 || y >= _imageHeight) {
|
|
67
|
-
return NAN;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// Access flattened array: index = y * width + x
|
|
71
|
-
NSInteger index = y * _imageWidth + x;
|
|
72
|
-
if (index < 0 || index >= (NSInteger)[_temperatureData count]) {
|
|
73
|
-
return NAN;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return [_temperatureData[index] doubleValue];
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
@end
|
|
1
|
+
#import "FlirState.h"
|
|
2
|
+
|
|
3
|
+
static FlirState *_sharedState = nil;
|
|
4
|
+
|
|
5
|
+
@implementation FlirState {
|
|
6
|
+
NSArray<NSNumber *> *_temperatureData; // Flattened array of temperature values
|
|
7
|
+
int _imageWidth;
|
|
8
|
+
int _imageHeight;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
+ (instancetype)shared
|
|
12
|
+
{
|
|
13
|
+
static dispatch_once_t onceToken;
|
|
14
|
+
dispatch_once(&onceToken, ^{
|
|
15
|
+
_sharedState = [FlirState new];
|
|
16
|
+
_sharedState.lastTemperature = NAN;
|
|
17
|
+
_sharedState.latestImage = nil;
|
|
18
|
+
_sharedState->_temperatureData = nil;
|
|
19
|
+
_sharedState->_imageWidth = 0;
|
|
20
|
+
_sharedState->_imageHeight = 0;
|
|
21
|
+
});
|
|
22
|
+
return _sharedState;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
- (double)getTemperatureAt:(int)x y:(int)y
|
|
26
|
+
{
|
|
27
|
+
// Return cached temperature (will be updated by thermal SDK callbacks)
|
|
28
|
+
// In production, this would query the actual thermal image data at (x,y)
|
|
29
|
+
return self.lastTemperature;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
- (void)updateFrame:(UIImage *)image
|
|
33
|
+
{
|
|
34
|
+
[self updateFrame:image withTemperatureData:nil];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
- (void)updateFrame:(UIImage *)image withTemperatureData:(NSArray<NSNumber *> *)tempData
|
|
38
|
+
{
|
|
39
|
+
self.latestImage = image;
|
|
40
|
+
|
|
41
|
+
if (tempData != nil) {
|
|
42
|
+
_temperatureData = tempData;
|
|
43
|
+
_imageWidth = (int)image.size.width;
|
|
44
|
+
_imageHeight = (int)image.size.height;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Invoke texture callback for native Metal filters (texture unit 7)
|
|
48
|
+
if (self.onTextureUpdate) {
|
|
49
|
+
self.onTextureUpdate(image, 7);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// Sample temperature at center point and invoke callback
|
|
53
|
+
if (self.onTemperatureUpdate) {
|
|
54
|
+
double temp = [self getTemperatureAt:80 y:60];
|
|
55
|
+
self.onTemperatureUpdate(temp, 80, 60);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
- (double)queryTemperatureAtPoint:(int)x y:(int)y
|
|
60
|
+
{
|
|
61
|
+
if (_temperatureData == nil || _imageWidth == 0 || _imageHeight == 0) {
|
|
62
|
+
return NAN;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Bounds check
|
|
66
|
+
if (x < 0 || x >= _imageWidth || y < 0 || y >= _imageHeight) {
|
|
67
|
+
return NAN;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Access flattened array: index = y * width + x
|
|
71
|
+
NSInteger index = y * _imageWidth + x;
|
|
72
|
+
if (index < 0 || index >= (NSInteger)[_temperatureData count]) {
|
|
73
|
+
return NAN;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return [_temperatureData[index] doubleValue];
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
@end
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
#import <React/RCTViewManager.h>
|
|
2
|
-
|
|
3
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
4
|
-
|
|
5
|
-
@interface FlirViewManager : RCTViewManager
|
|
6
|
-
|
|
7
|
-
@end
|
|
8
|
-
|
|
9
|
-
NS_ASSUME_NONNULL_END
|
|
1
|
+
#import <React/RCTViewManager.h>
|
|
2
|
+
|
|
3
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
4
|
+
|
|
5
|
+
@interface FlirViewManager : RCTViewManager
|
|
6
|
+
|
|
7
|
+
@end
|
|
8
|
+
|
|
9
|
+
NS_ASSUME_NONNULL_END
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
#import "FlirViewManager.h"
|
|
2
|
-
#import "FlirPreviewView.h"
|
|
3
|
-
#import <React/RCTBridge.h>
|
|
4
|
-
#import <React/RCTUIManager.h>
|
|
5
|
-
|
|
6
|
-
@implementation FlirViewManager
|
|
7
|
-
|
|
8
|
-
RCT_EXPORT_MODULE(FlirView)
|
|
9
|
-
|
|
10
|
-
- (UIView *)view
|
|
11
|
-
{
|
|
12
|
-
FlirPreviewView *v = [[FlirPreviewView alloc] initWithFrame:CGRectZero];
|
|
13
|
-
return v;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
@end
|
|
1
|
+
#import "FlirViewManager.h"
|
|
2
|
+
#import "FlirPreviewView.h"
|
|
3
|
+
#import <React/RCTBridge.h>
|
|
4
|
+
#import <React/RCTUIManager.h>
|
|
5
|
+
|
|
6
|
+
@implementation FlirViewManager
|
|
7
|
+
|
|
8
|
+
RCT_EXPORT_MODULE(FlirView)
|
|
9
|
+
|
|
10
|
+
- (UIView *)view
|
|
11
|
+
{
|
|
12
|
+
FlirPreviewView *v = [[FlirPreviewView alloc] initWithFrame:CGRectZero];
|
|
13
|
+
return v;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@end
|
package/package.json
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "ilabs-flir",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "FLIR Thermal SDK for React Native - On-Demand Download",
|
|
5
|
-
"main": "src/index.js",
|
|
6
|
-
"types": "src/index.d.ts",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"download-sdk": "node scripts/download-sdk.js",
|
|
9
|
-
"typecheck": "tsc --noEmit"
|
|
10
|
-
},
|
|
11
|
-
"files": [
|
|
12
|
-
"src/",
|
|
13
|
-
"android/Flir/src/",
|
|
14
|
-
"android/Flir/build.gradle.kts",
|
|
15
|
-
"android/Flir/libs/",
|
|
16
|
-
"ios/Flir/src/",
|
|
17
|
-
"ios/Flir/SDKLoader/",
|
|
18
|
-
"ios/Flir/libs/.gitkeep",
|
|
19
|
-
"ios/Flir/Framework/",
|
|
20
|
-
"app.plugin.js",
|
|
21
|
-
"Flir.podspec",
|
|
22
|
-
"sdk-manifest.json",
|
|
23
|
-
"scripts/",
|
|
24
|
-
"expo-module.config.json",
|
|
25
|
-
"react-native.config.js"
|
|
26
|
-
],
|
|
27
|
-
"keywords": [
|
|
28
|
-
"flir",
|
|
29
|
-
"thermal",
|
|
30
|
-
"thermal-camera",
|
|
31
|
-
"react-native",
|
|
32
|
-
"expo",
|
|
33
|
-
"expo-plugin",
|
|
34
|
-
"config-plugin",
|
|
35
|
-
"flir-one",
|
|
36
|
-
"thermal-imaging",
|
|
37
|
-
"infrared"
|
|
38
|
-
],
|
|
39
|
-
"repository": {
|
|
40
|
-
"type": "git",
|
|
41
|
-
"url": "https://github.com/PraveenOjha/flir.git"
|
|
42
|
-
},
|
|
43
|
-
"homepage": "https://github.com/PraveenOjha/flir#readme",
|
|
44
|
-
"bugs": {
|
|
45
|
-
"url": "https://github.com/PraveenOjha/flir/issues"
|
|
46
|
-
},
|
|
47
|
-
"author": "Praveen Ojha",
|
|
48
|
-
"license": "MIT",
|
|
49
|
-
"peerDependencies": {
|
|
50
|
-
"react": "*",
|
|
51
|
-
"react-native": ">=0.60.0"
|
|
52
|
-
},
|
|
53
|
-
"dependencies": {
|
|
54
|
-
"@expo/config-plugins": "^7.0.0"
|
|
55
|
-
},
|
|
56
|
-
"devDependencies": {
|
|
57
|
-
"typescript": "^5.0.0",
|
|
58
|
-
"@types/react": "*",
|
|
59
|
-
"@types/react-native": "*"
|
|
60
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "ilabs-flir",
|
|
3
|
+
"version": "1.0.4",
|
|
4
|
+
"description": "FLIR Thermal SDK for React Native - On-Demand Download",
|
|
5
|
+
"main": "src/index.js",
|
|
6
|
+
"types": "src/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"download-sdk": "node scripts/download-sdk.js",
|
|
9
|
+
"typecheck": "tsc --noEmit"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"src/",
|
|
13
|
+
"android/Flir/src/",
|
|
14
|
+
"android/Flir/build.gradle.kts",
|
|
15
|
+
"android/Flir/libs/",
|
|
16
|
+
"ios/Flir/src/",
|
|
17
|
+
"ios/Flir/SDKLoader/",
|
|
18
|
+
"ios/Flir/libs/.gitkeep",
|
|
19
|
+
"ios/Flir/Framework/",
|
|
20
|
+
"app.plugin.js",
|
|
21
|
+
"Flir.podspec",
|
|
22
|
+
"sdk-manifest.json",
|
|
23
|
+
"scripts/",
|
|
24
|
+
"expo-module.config.json",
|
|
25
|
+
"react-native.config.js"
|
|
26
|
+
],
|
|
27
|
+
"keywords": [
|
|
28
|
+
"flir",
|
|
29
|
+
"thermal",
|
|
30
|
+
"thermal-camera",
|
|
31
|
+
"react-native",
|
|
32
|
+
"expo",
|
|
33
|
+
"expo-plugin",
|
|
34
|
+
"config-plugin",
|
|
35
|
+
"flir-one",
|
|
36
|
+
"thermal-imaging",
|
|
37
|
+
"infrared"
|
|
38
|
+
],
|
|
39
|
+
"repository": {
|
|
40
|
+
"type": "git",
|
|
41
|
+
"url": "https://github.com/PraveenOjha/flir.git"
|
|
42
|
+
},
|
|
43
|
+
"homepage": "https://github.com/PraveenOjha/flir#readme",
|
|
44
|
+
"bugs": {
|
|
45
|
+
"url": "https://github.com/PraveenOjha/flir/issues"
|
|
46
|
+
},
|
|
47
|
+
"author": "Praveen Ojha",
|
|
48
|
+
"license": "MIT",
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"react": "*",
|
|
51
|
+
"react-native": ">=0.60.0"
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"@expo/config-plugins": "^7.0.0"
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"typescript": "^5.0.0",
|
|
58
|
+
"@types/react": "*",
|
|
59
|
+
"@types/react-native": "*"
|
|
60
|
+
}
|
|
61
61
|
}
|
package/react-native.config.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
dependency: {
|
|
3
|
-
platforms: {
|
|
4
|
-
android: {
|
|
5
|
-
sourceDir: './android/Flir',
|
|
6
|
-
packageImportPath: 'import flir.android.FlirPackage;',
|
|
7
|
-
packageInstance: 'new FlirPackage()',
|
|
8
|
-
},
|
|
9
|
-
ios: {
|
|
10
|
-
podspecPath: './Flir.podspec',
|
|
11
|
-
},
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
};
|
|
1
|
+
module.exports = {
|
|
2
|
+
dependency: {
|
|
3
|
+
platforms: {
|
|
4
|
+
android: {
|
|
5
|
+
sourceDir: './android/Flir',
|
|
6
|
+
packageImportPath: 'import flir.android.FlirPackage;',
|
|
7
|
+
packageInstance: 'new FlirPackage()',
|
|
8
|
+
},
|
|
9
|
+
ios: {
|
|
10
|
+
podspecPath: './Flir.podspec',
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
};
|
package/scripts/copy_ios_libs.sh
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
set -euo pipefail
|
|
3
|
-
|
|
4
|
-
# Script to copy necessary iOS frameworks into ios/Flir/libs
|
|
5
|
-
# by default ThermalSDK.framework is located under ios/Flir/
|
|
6
|
-
|
|
7
|
-
DEST_DIR="$(pwd)/ios/Flir/libs"
|
|
8
|
-
mkdir -p "$DEST_DIR"
|
|
9
|
-
|
|
10
|
-
# copy ThermalSDK.framework if it exists
|
|
11
|
-
SRC_THERMAL="$PWD/ios/Flir/ThermalSDK.framework"
|
|
12
|
-
if [ -d "$SRC_THERMAL" ]; then
|
|
13
|
-
echo "Copying ThermalSDK.framework -> $DEST_DIR"
|
|
14
|
-
rm -rf "$DEST_DIR/ThermalSDK.framework"
|
|
15
|
-
cp -R "$SRC_THERMAL" "$DEST_DIR/"
|
|
16
|
-
else
|
|
17
|
-
echo "Warning: $SRC_THERMAL not found. Please add ThermalSDK.framework to ios/Flir/libs manually or place it at ios/Flir/"
|
|
18
|
-
fi
|
|
19
|
-
|
|
20
|
-
# Optionally copy FFmpeg-ish frameworks if present in project root (paths in sample PBX):
|
|
21
|
-
for lib in libswscale.5.dylib.framework libavfilter.7.dylib.framework liblive666.dylib.framework libavdevice.58.dylib.framework libavcodec.58.dylib.framework libavformat.58.dylib.framework libswresample.3.dylib.framework libavutil.56.dylib.framework; do
|
|
22
|
-
SRC_LIB="$PWD/../$lib"
|
|
23
|
-
if [ -d "$SRC_LIB" ]; then
|
|
24
|
-
echo "Copying $lib -> $DEST_DIR"
|
|
25
|
-
rm -rf "$DEST_DIR/$lib"
|
|
26
|
-
cp -R "$SRC_LIB" "$DEST_DIR/"
|
|
27
|
-
else
|
|
28
|
-
echo "Note: $lib not found at $SRC_LIB. Add it to ios/Flir/libs if required."
|
|
29
|
-
fi
|
|
30
|
-
done
|
|
31
|
-
|
|
32
|
-
echo "Done copying frameworks. The podspec references `ios/Flir/libs` — run 'pod install' from ios after adding frameworks."
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
# Script to copy necessary iOS frameworks into ios/Flir/libs
|
|
5
|
+
# by default ThermalSDK.framework is located under ios/Flir/
|
|
6
|
+
|
|
7
|
+
DEST_DIR="$(pwd)/ios/Flir/libs"
|
|
8
|
+
mkdir -p "$DEST_DIR"
|
|
9
|
+
|
|
10
|
+
# copy ThermalSDK.framework if it exists
|
|
11
|
+
SRC_THERMAL="$PWD/ios/Flir/ThermalSDK.framework"
|
|
12
|
+
if [ -d "$SRC_THERMAL" ]; then
|
|
13
|
+
echo "Copying ThermalSDK.framework -> $DEST_DIR"
|
|
14
|
+
rm -rf "$DEST_DIR/ThermalSDK.framework"
|
|
15
|
+
cp -R "$SRC_THERMAL" "$DEST_DIR/"
|
|
16
|
+
else
|
|
17
|
+
echo "Warning: $SRC_THERMAL not found. Please add ThermalSDK.framework to ios/Flir/libs manually or place it at ios/Flir/"
|
|
18
|
+
fi
|
|
19
|
+
|
|
20
|
+
# Optionally copy FFmpeg-ish frameworks if present in project root (paths in sample PBX):
|
|
21
|
+
for lib in libswscale.5.dylib.framework libavfilter.7.dylib.framework liblive666.dylib.framework libavdevice.58.dylib.framework libavcodec.58.dylib.framework libavformat.58.dylib.framework libswresample.3.dylib.framework libavutil.56.dylib.framework; do
|
|
22
|
+
SRC_LIB="$PWD/../$lib"
|
|
23
|
+
if [ -d "$SRC_LIB" ]; then
|
|
24
|
+
echo "Copying $lib -> $DEST_DIR"
|
|
25
|
+
rm -rf "$DEST_DIR/$lib"
|
|
26
|
+
cp -R "$SRC_LIB" "$DEST_DIR/"
|
|
27
|
+
else
|
|
28
|
+
echo "Note: $lib not found at $SRC_LIB. Add it to ios/Flir/libs if required."
|
|
29
|
+
fi
|
|
30
|
+
done
|
|
31
|
+
|
|
32
|
+
echo "Done copying frameworks. The podspec references `ios/Flir/libs` — run 'pod install' from ios after adding frameworks."
|