ilabs-flir 2.2.30 → 2.2.32
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 +9 -8
- package/ios/Flir/src/FlirManager.swift +44 -13
- package/package.json +1 -1
- package/scripts/fetch-binaries.js +5 -5
package/Flir.podspec
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Pod::Spec.new do |s|
|
|
2
2
|
s.name = 'Flir'
|
|
3
|
-
s.version = '2.2.
|
|
3
|
+
s.version = '2.2.31'
|
|
4
4
|
s.summary = 'FLIR Thermal SDK React Native - Bundled via postinstall'
|
|
5
5
|
s.description = <<-DESC
|
|
6
6
|
A React Native wrapper for the FLIR Thermal SDK, providing thermal imaging
|
|
@@ -94,14 +94,15 @@ Pod::Spec.new do |s|
|
|
|
94
94
|
# Vendored frameworks - the actual SDK
|
|
95
95
|
s.vendored_frameworks = [
|
|
96
96
|
'ios/Flir/Frameworks/ThermalSDK.xcframework',
|
|
97
|
-
'ios/Flir/Frameworks/
|
|
98
|
-
'ios/Flir/Frameworks/
|
|
99
|
-
'ios/Flir/Frameworks/
|
|
100
|
-
'ios/Flir/Frameworks/
|
|
101
|
-
'ios/Flir/Frameworks/
|
|
97
|
+
'ios/Flir/Frameworks/MeterLink.xcframework',
|
|
98
|
+
'ios/Flir/Frameworks/libavcodec.62.dylib.xcframework',
|
|
99
|
+
'ios/Flir/Frameworks/libavdevice.62.dylib.xcframework',
|
|
100
|
+
'ios/Flir/Frameworks/libavfilter.11.dylib.xcframework',
|
|
101
|
+
'ios/Flir/Frameworks/libavformat.62.dylib.xcframework',
|
|
102
|
+
'ios/Flir/Frameworks/libavutil.60.dylib.xcframework',
|
|
102
103
|
'ios/Flir/Frameworks/liblive666.dylib.xcframework',
|
|
103
|
-
'ios/Flir/Frameworks/libswresample.
|
|
104
|
-
'ios/Flir/Frameworks/libswscale.
|
|
104
|
+
'ios/Flir/Frameworks/libswresample.6.dylib.xcframework',
|
|
105
|
+
'ios/Flir/Frameworks/libswscale.9.dylib.xcframework'
|
|
105
106
|
].select { |f| File.exist?(File.join(__dir__, f)) }
|
|
106
107
|
|
|
107
108
|
s.pod_target_xcconfig = {
|
|
@@ -364,14 +364,22 @@ import ThermalSDK
|
|
|
364
364
|
|
|
365
365
|
@objc public func getTemperatureAt(x: Int, y: Int) -> Double {
|
|
366
366
|
#if FLIR_ENABLED
|
|
367
|
-
guard let streamer = streamer else { return Double.nan }
|
|
367
|
+
guard let streamer = streamer, _isStreaming else { return Double.nan }
|
|
368
368
|
|
|
369
369
|
var result = Double.nan
|
|
370
370
|
streamer.withThermalImage { thermalImage in
|
|
371
|
-
let w = thermalImage.getWidth()
|
|
372
|
-
let h = thermalImage.getHeight()
|
|
373
|
-
|
|
374
|
-
|
|
371
|
+
let w = Double(thermalImage.getWidth())
|
|
372
|
+
let h = Double(thermalImage.getHeight())
|
|
373
|
+
|
|
374
|
+
// Map incoming integer coordinates (from latestImage) to normalized, then to sensor
|
|
375
|
+
// This assumes x,y are in latestImage coordinate space.
|
|
376
|
+
guard let img = self.latestImage, img.size.width > 0, img.size.height > 0 else { return }
|
|
377
|
+
|
|
378
|
+
let nx = Double(x) / Double(img.size.width)
|
|
379
|
+
let ny = Double(y) / Double(img.size.height)
|
|
380
|
+
|
|
381
|
+
let cx = max(0, min(Int(w) - 1, Int(nx * w)))
|
|
382
|
+
let cy = max(0, min(Int(h) - 1, Int(ny * h)))
|
|
375
383
|
|
|
376
384
|
if let measurements = thermalImage.measurements,
|
|
377
385
|
let spot = try? measurements.addSpot(CGPoint(x: cx, y: cy)) {
|
|
@@ -393,10 +401,28 @@ import ThermalSDK
|
|
|
393
401
|
|
|
394
402
|
|
|
395
403
|
@objc public func getTemperatureAtNormalized(_ nx: Double, y: Double) -> Double {
|
|
396
|
-
|
|
397
|
-
let
|
|
398
|
-
|
|
399
|
-
|
|
404
|
+
#if FLIR_ENABLED
|
|
405
|
+
guard let streamer = streamer, _isStreaming else { return Double.nan }
|
|
406
|
+
|
|
407
|
+
var result = Double.nan
|
|
408
|
+
streamer.withThermalImage { thermalImage in
|
|
409
|
+
let w = Double(thermalImage.getWidth())
|
|
410
|
+
let h = Double(thermalImage.getHeight())
|
|
411
|
+
|
|
412
|
+
// Map normalized (0.0 - 1.0) to actual sensor pixels
|
|
413
|
+
let cx = max(0, min(Int(w) - 1, Int(nx * w)))
|
|
414
|
+
let cy = max(0, min(Int(h) - 1, Int(y * h)))
|
|
415
|
+
|
|
416
|
+
if let measurements = thermalImage.measurements,
|
|
417
|
+
let spot = try? measurements.addSpot(CGPoint(x: cx, y: cy)) {
|
|
418
|
+
result = spot.getValue().value
|
|
419
|
+
try? measurements.remove(spot)
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
return result
|
|
423
|
+
#else
|
|
424
|
+
return Double.nan
|
|
425
|
+
#endif
|
|
400
426
|
}
|
|
401
427
|
|
|
402
428
|
// MARK: - Legacy / Compatibility Methods
|
|
@@ -604,16 +630,21 @@ extension FlirManager: FLIRStreamDelegate {
|
|
|
604
630
|
_isProcessingFrame = true
|
|
605
631
|
renderQueue.async { [weak self] in
|
|
606
632
|
defer { self?._isProcessingFrame = false }
|
|
607
|
-
guard let self = self, let streamer = self.streamer else {
|
|
608
|
-
NSLog("[FLIR-TRACE ❌] No self or
|
|
633
|
+
guard let self = self, self._isStreaming, let streamer = self.streamer else {
|
|
634
|
+
NSLog("[FLIR-TRACE ❌] No self, streamer or not streaming in renderQueue")
|
|
609
635
|
return
|
|
610
636
|
}
|
|
611
637
|
|
|
612
638
|
NSLog("[FLIR-TRACE 2️⃣] Processing on renderQueue")
|
|
613
639
|
|
|
614
640
|
do {
|
|
615
|
-
|
|
616
|
-
|
|
641
|
+
// Double check streaming state before update to prevent EXC_BAD_ACCESS during shutdown
|
|
642
|
+
if self._isStreaming {
|
|
643
|
+
try streamer.update()
|
|
644
|
+
NSLog("[FLIR-TRACE 3️⃣] Streamer updated successfully")
|
|
645
|
+
} else {
|
|
646
|
+
return
|
|
647
|
+
}
|
|
617
648
|
} catch {
|
|
618
649
|
NSLog("[FLIR-TRACE ❌] Streamer update failed: \(error)")
|
|
619
650
|
return
|
package/package.json
CHANGED
|
@@ -192,7 +192,7 @@ async function run() {
|
|
|
192
192
|
args[key] = value;
|
|
193
193
|
} else {
|
|
194
194
|
// if following arg exists and doesn't start with '-', use it as the value
|
|
195
|
-
const next = argv[i+1];
|
|
195
|
+
const next = argv[i + 1];
|
|
196
196
|
if (next && !next.startsWith('-')) {
|
|
197
197
|
args[cur.replace(/^--/, '')] = next;
|
|
198
198
|
i++;
|
|
@@ -202,7 +202,7 @@ async function run() {
|
|
|
202
202
|
}
|
|
203
203
|
} else if (cur.startsWith('-')) {
|
|
204
204
|
const key = cur.replace(/^-+/, '');
|
|
205
|
-
const next = argv[i+1];
|
|
205
|
+
const next = argv[i + 1];
|
|
206
206
|
if (next && !next.startsWith('-')) {
|
|
207
207
|
args[key] = next;
|
|
208
208
|
i++;
|
|
@@ -254,7 +254,7 @@ async function run() {
|
|
|
254
254
|
// Clean out TMP_DIR (remove all contents) to avoid conflicts for iOS
|
|
255
255
|
fs.readdirSync(TMP_DIR).forEach(f => {
|
|
256
256
|
const fp = path.join(TMP_DIR, f);
|
|
257
|
-
try { fs.rmSync(fp, { recursive: true, force: true }); } catch (e) {}
|
|
257
|
+
try { fs.rmSync(fp, { recursive: true, force: true }); } catch (e) { }
|
|
258
258
|
});
|
|
259
259
|
|
|
260
260
|
if (skipIfPresent && platformArg !== 'android' && hasIosFrameworks(DEST_IOS)) {
|
|
@@ -270,7 +270,7 @@ async function run() {
|
|
|
270
270
|
}
|
|
271
271
|
|
|
272
272
|
// Cleanup tmp
|
|
273
|
-
try { fs.rmSync(TMP_DIR, { recursive: true, force: true }); } catch (e) {}
|
|
273
|
+
try { fs.rmSync(TMP_DIR, { recursive: true, force: true }); } catch (e) { }
|
|
274
274
|
|
|
275
275
|
console.log('FLIR SDK binaries fetched and installed into the package folders.');
|
|
276
276
|
} catch (err) {
|
|
@@ -278,7 +278,7 @@ async function run() {
|
|
|
278
278
|
process.exit(1);
|
|
279
279
|
} finally {
|
|
280
280
|
// Always attempt to remove temporary folder to avoid leaving cruft
|
|
281
|
-
try { fs.rmSync(TMP_DIR, { recursive: true, force: true }); } catch (e) {}
|
|
281
|
+
try { fs.rmSync(TMP_DIR, { recursive: true, force: true }); } catch (e) { }
|
|
282
282
|
}
|
|
283
283
|
}
|
|
284
284
|
|