@aguacerowx/react-native 0.0.9 → 0.0.12
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/README.md +60 -60
- package/android/build.gradle +83 -84
- package/android/src/main/AndroidManifest.xml +6 -6
- package/android/src/main/java/com/aguacerowx/reactnative/AguaceroPackage.java +33 -33
- package/android/src/main/java/com/aguacerowx/reactnative/GridRenderLayer.java +611 -611
- package/android/src/main/java/com/aguacerowx/reactnative/GridRenderLayerView.java +299 -299
- package/android/src/main/java/com/aguacerowx/reactnative/GridRenderManager.java +117 -117
- package/android/src/main/java/com/aguacerowx/reactnative/InspectorModule.java +71 -71
- package/android/src/main/java/com/aguacerowx/reactnative/ShaderUtils.java +106 -106
- package/android/src/main/java/com/aguacerowx/reactnative/WeatherFrameProcessorModule.java +151 -151
- package/android/src/main/java/com/facebook/react/viewmanagers/.gitkeep +0 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/GridRenderLayerManagerDelegate.java +0 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/GridRenderLayerManagerInterface.java +0 -0
- package/android/src/main/res/raw/debug_fragment_shader.glsl +12 -12
- package/android/src/main/res/raw/debug_vertex_shader.glsl +12 -12
- package/android/src/main/res/raw/fragment_shader.glsl +97 -97
- package/android/src/main/res/raw/vertex_shader.glsl +19 -19
- package/index.js +1 -1
- package/ios/AguaceroPackage.m +18 -18
- package/ios/FragmentUniforms.swift +13 -13
- package/ios/GridRenderLayer.swift +962 -962
- package/ios/GridRenderLayerBridge.swift +29 -29
- package/ios/GridRenderLayerManager.mm +145 -145
- package/ios/GridRenderLayerView.h +22 -22
- package/ios/GridRenderLayerView.m +199 -199
- package/ios/InspectorDataCache.swift +65 -65
- package/ios/InspectorModule.m +9 -9
- package/ios/InspectorModule.swift +63 -63
- package/ios/Shaders.metal +130 -130
- package/ios/WeatherFrameProcessorModule.m +15 -15
- package/ios/WeatherFrameProcessorModule.swift +103 -103
- package/ios/aguacerowx-react-native.podspec +36 -35
- package/ios/generated/.gitkeep +0 -0
- package/ios/generated/AguaceroWxReactNativeSpec-generated.mm +0 -0
- package/ios/generated/AguaceroWxReactNativeSpec.h +0 -0
- package/lib/commonjs/README.md +60 -60
- package/lib/commonjs/android/build.gradle +83 -84
- package/lib/commonjs/android/src/main/AndroidManifest.xml +6 -6
- package/lib/commonjs/android/src/main/java/com/aguacerowx/reactnative/AguaceroPackage.java +33 -33
- package/lib/commonjs/android/src/main/java/com/aguacerowx/reactnative/GridRenderLayer.java +611 -611
- package/lib/commonjs/android/src/main/java/com/aguacerowx/reactnative/GridRenderLayerView.java +299 -299
- package/lib/commonjs/android/src/main/java/com/aguacerowx/reactnative/GridRenderManager.java +117 -117
- package/lib/commonjs/android/src/main/java/com/aguacerowx/reactnative/InspectorModule.java +71 -71
- package/lib/commonjs/android/src/main/java/com/aguacerowx/reactnative/ShaderUtils.java +106 -106
- package/lib/commonjs/android/src/main/java/com/aguacerowx/reactnative/WeatherFrameProcessorModule.java +151 -151
- package/lib/commonjs/android/src/main/java/com/facebook/react/viewmanagers/GridRenderLayerManagerDelegate.java +0 -0
- package/lib/commonjs/android/src/main/java/com/facebook/react/viewmanagers/GridRenderLayerManagerInterface.java +0 -0
- package/lib/commonjs/android/src/main/res/raw/debug_fragment_shader.glsl +12 -12
- package/lib/commonjs/android/src/main/res/raw/debug_vertex_shader.glsl +12 -12
- package/lib/commonjs/android/src/main/res/raw/fragment_shader.glsl +97 -97
- package/lib/commonjs/android/src/main/res/raw/vertex_shader.glsl +19 -19
- package/lib/commonjs/babel.config.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ios/AguaceroPackage.m +18 -18
- package/lib/commonjs/ios/FragmentUniforms.swift +13 -13
- package/lib/commonjs/ios/GridRenderLayer.swift +962 -962
- package/lib/commonjs/ios/GridRenderLayerBridge.swift +29 -29
- package/lib/commonjs/ios/GridRenderLayerManager.mm +145 -145
- package/lib/commonjs/ios/GridRenderLayerView.h +22 -22
- package/lib/commonjs/ios/GridRenderLayerView.m +199 -199
- package/lib/commonjs/ios/InspectorDataCache.swift +65 -65
- package/lib/commonjs/ios/InspectorModule.m +9 -9
- package/lib/commonjs/ios/InspectorModule.swift +63 -63
- package/lib/commonjs/ios/Shaders.metal +130 -130
- package/lib/commonjs/ios/WeatherFrameProcessorModule.m +15 -15
- package/lib/commonjs/ios/WeatherFrameProcessorModule.swift +103 -103
- package/lib/commonjs/ios/aguacerowx-react-native.podspec +36 -35
- package/lib/commonjs/ios/generated/AguaceroWxReactNativeSpec-generated.mm +0 -0
- package/lib/commonjs/ios/generated/AguaceroWxReactNativeSpec.h +0 -0
- package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/AguaceroCore.js.map +1 -1
- package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/coordinate_configs.js.map +1 -1
- package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/default-colormaps.js.map +1 -1
- package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/dictionaries.js.map +1 -1
- package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/events.js.map +1 -1
- package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/fill-layer-worker.js.map +1 -1
- package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/getBundleId.js.map +1 -1
- package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/index.js.map +1 -1
- package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/map-styles.js.map +1 -1
- package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/unitConversions.js.map +1 -1
- package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/package.json +1 -1
- package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/AguaceroCore.js.map +1 -1
- package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/coordinate_configs.js.map +1 -1
- package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/default-colormaps.js.map +1 -1
- package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/dictionaries.js.map +1 -1
- package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/events.js.map +1 -1
- package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/fill-layer-worker.js.map +1 -1
- package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/getBundleId.js.map +1 -1
- package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/index.js.map +1 -1
- package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/map-styles.js.map +1 -1
- package/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/unitConversions.js.map +1 -1
- package/lib/commonjs/package.json +71 -65
- package/lib/commonjs/react-native-builder-bob.config.js.map +1 -1
- package/lib/commonjs/src/AguaceroContext.js.map +1 -1
- package/lib/commonjs/src/GridRenderLayer.js.map +1 -1
- package/lib/commonjs/src/GridRenderLayerNativeComponent.js.map +1 -1
- package/lib/commonjs/src/MapManager.js.map +1 -1
- package/lib/commonjs/src/MapRegistry.js.map +1 -1
- package/lib/commonjs/src/StyleApplicator.js +6 -6
- package/lib/commonjs/src/StyleApplicator.js.map +1 -1
- package/lib/commonjs/src/WeatherLayerManager.js +2 -2
- package/lib/commonjs/src/WeatherLayerManager.js.map +1 -1
- package/lib/commonjs/tsconfig.json +23 -23
- package/lib/module/README.md +60 -60
- package/lib/module/android/build.gradle +83 -84
- package/lib/module/android/src/main/AndroidManifest.xml +6 -6
- package/lib/module/android/src/main/java/com/aguacerowx/reactnative/AguaceroPackage.java +33 -33
- package/lib/module/android/src/main/java/com/aguacerowx/reactnative/GridRenderLayer.java +611 -611
- package/lib/module/android/src/main/java/com/aguacerowx/reactnative/GridRenderLayerView.java +299 -299
- package/lib/module/android/src/main/java/com/aguacerowx/reactnative/GridRenderManager.java +117 -117
- package/lib/module/android/src/main/java/com/aguacerowx/reactnative/InspectorModule.java +71 -71
- package/lib/module/android/src/main/java/com/aguacerowx/reactnative/ShaderUtils.java +106 -106
- package/lib/module/android/src/main/java/com/aguacerowx/reactnative/WeatherFrameProcessorModule.java +151 -151
- package/lib/module/android/src/main/java/com/facebook/react/viewmanagers/GridRenderLayerManagerDelegate.java +0 -0
- package/lib/module/android/src/main/java/com/facebook/react/viewmanagers/GridRenderLayerManagerInterface.java +0 -0
- package/lib/module/android/src/main/res/raw/debug_fragment_shader.glsl +12 -12
- package/lib/module/android/src/main/res/raw/debug_vertex_shader.glsl +12 -12
- package/lib/module/android/src/main/res/raw/fragment_shader.glsl +97 -97
- package/lib/module/android/src/main/res/raw/vertex_shader.glsl +19 -19
- package/lib/module/babel.config.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/ios/AguaceroPackage.m +18 -18
- package/lib/module/ios/FragmentUniforms.swift +13 -13
- package/lib/module/ios/GridRenderLayer.swift +962 -962
- package/lib/module/ios/GridRenderLayerBridge.swift +29 -29
- package/lib/module/ios/GridRenderLayerManager.mm +145 -145
- package/lib/module/ios/GridRenderLayerView.h +22 -22
- package/lib/module/ios/GridRenderLayerView.m +199 -199
- package/lib/module/ios/InspectorDataCache.swift +65 -65
- package/lib/module/ios/InspectorModule.m +9 -9
- package/lib/module/ios/InspectorModule.swift +63 -63
- package/lib/module/ios/Shaders.metal +130 -130
- package/lib/module/ios/WeatherFrameProcessorModule.m +15 -15
- package/lib/module/ios/WeatherFrameProcessorModule.swift +103 -103
- package/lib/module/ios/aguacerowx-react-native.podspec +36 -35
- package/lib/module/ios/generated/AguaceroWxReactNativeSpec-generated.mm +0 -0
- package/lib/module/ios/generated/AguaceroWxReactNativeSpec.h +0 -0
- package/lib/module/lib/commonjs/README.md +60 -60
- package/lib/module/lib/commonjs/android/build.gradle +83 -84
- package/lib/module/lib/commonjs/android/src/main/AndroidManifest.xml +6 -6
- package/lib/module/lib/commonjs/babel.config.js.map +1 -1
- package/lib/module/lib/commonjs/index.js.map +1 -1
- package/lib/module/lib/commonjs/ios/AguaceroPackage.m +18 -18
- package/lib/module/lib/commonjs/ios/FragmentUniforms.swift +13 -13
- package/lib/module/lib/commonjs/ios/GridRenderLayer.swift +962 -962
- package/lib/module/lib/commonjs/ios/GridRenderLayerBridge.swift +29 -29
- package/lib/module/lib/commonjs/ios/GridRenderLayerManager.mm +145 -145
- package/lib/module/lib/commonjs/ios/GridRenderLayerView.h +22 -22
- package/lib/module/lib/commonjs/ios/GridRenderLayerView.m +199 -199
- package/lib/module/lib/commonjs/ios/InspectorDataCache.swift +65 -65
- package/lib/module/lib/commonjs/ios/InspectorModule.m +9 -9
- package/lib/module/lib/commonjs/ios/InspectorModule.swift +63 -63
- package/lib/module/lib/commonjs/ios/Shaders.metal +130 -130
- package/lib/module/lib/commonjs/ios/WeatherFrameProcessorModule.m +15 -15
- package/lib/module/lib/commonjs/ios/WeatherFrameProcessorModule.swift +103 -103
- package/lib/module/lib/commonjs/ios/aguacerowx-react-native.podspec +36 -35
- package/lib/module/lib/commonjs/ios/generated/AguaceroWxReactNativeSpec-generated.mm +0 -0
- package/lib/module/lib/commonjs/ios/generated/AguaceroWxReactNativeSpec.h +0 -0
- package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/AguaceroCore.js.map +1 -1
- package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/coordinate_configs.js.map +1 -1
- package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/default-colormaps.js.map +1 -1
- package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/dictionaries.js.map +1 -1
- package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/events.js.map +1 -1
- package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/fill-layer-worker.js.map +1 -1
- package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/getBundleId.js.map +1 -1
- package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/index.js.map +1 -1
- package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/map-styles.js.map +1 -1
- package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/dist/unitConversions.js.map +1 -1
- package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/package.json +1 -1
- package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/AguaceroCore.js.map +1 -1
- package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/coordinate_configs.js.map +1 -1
- package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/default-colormaps.js.map +1 -1
- package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/dictionaries.js.map +1 -1
- package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/events.js.map +1 -1
- package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/fill-layer-worker.js.map +1 -1
- package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/getBundleId.js.map +1 -1
- package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/index.js.map +1 -1
- package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/map-styles.js.map +1 -1
- package/lib/module/lib/commonjs/node_modules/@aguacerowx/javascript-sdk/src/unitConversions.js.map +1 -1
- package/lib/module/lib/commonjs/package.json +71 -65
- package/lib/module/lib/commonjs/react-native-builder-bob.config.js.map +1 -1
- package/lib/module/lib/commonjs/src/AguaceroContext.js.map +1 -1
- package/lib/module/lib/commonjs/src/GridRenderLayer.js.map +1 -1
- package/lib/module/lib/commonjs/src/GridRenderLayerNativeComponent.js.map +1 -1
- package/lib/module/lib/commonjs/src/MapManager.js.map +1 -1
- package/lib/module/lib/commonjs/src/MapRegistry.js.map +1 -1
- package/lib/module/lib/commonjs/src/StyleApplicator.js +6 -6
- package/lib/module/lib/commonjs/src/StyleApplicator.js.map +1 -1
- package/lib/module/lib/commonjs/src/WeatherLayerManager.js +2 -2
- package/lib/module/lib/commonjs/src/WeatherLayerManager.js.map +1 -1
- package/lib/module/lib/commonjs/tsconfig.json +23 -23
- package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/AguaceroCore.js.map +1 -1
- package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/coordinate_configs.js.map +1 -1
- package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/default-colormaps.js.map +1 -1
- package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/dictionaries.js.map +1 -1
- package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/events.js.map +1 -1
- package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/fill-layer-worker.js.map +1 -1
- package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/getBundleId.js.map +1 -1
- package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/index.js.map +1 -1
- package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/map-styles.js.map +1 -1
- package/lib/module/node_modules/@aguacerowx/javascript-sdk/dist/unitConversions.js.map +1 -1
- package/lib/module/node_modules/@aguacerowx/javascript-sdk/package.json +1 -1
- package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/AguaceroCore.js.map +1 -1
- package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/coordinate_configs.js.map +1 -1
- package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/default-colormaps.js.map +1 -1
- package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/dictionaries.js.map +1 -1
- package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/events.js.map +1 -1
- package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/fill-layer-worker.js.map +1 -1
- package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/getBundleId.js.map +1 -1
- package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/index.js.map +1 -1
- package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/map-styles.js.map +1 -1
- package/lib/module/node_modules/@aguacerowx/javascript-sdk/src/unitConversions.js.map +1 -1
- package/lib/module/package.json +71 -65
- package/lib/module/react-native-builder-bob.config.js.map +1 -1
- package/lib/module/src/AguaceroContext.js.map +1 -1
- package/lib/module/src/GridRenderLayer.js.map +1 -1
- package/lib/module/src/GridRenderLayerNativeComponent.js.map +1 -1
- package/lib/module/src/MapManager.js.map +1 -1
- package/lib/module/src/MapRegistry.js.map +1 -1
- package/lib/module/src/StyleApplicator.js +6 -6
- package/lib/module/src/StyleApplicator.js.map +1 -1
- package/lib/module/src/WeatherLayerManager.js +2 -2
- package/lib/module/src/WeatherLayerManager.js.map +1 -1
- package/lib/module/tsconfig.json +23 -23
- package/package.json +71 -65
- package/src/AguaceroContext.js +3 -3
- package/src/GridRenderLayer.js +204 -204
- package/src/GridRenderLayerNativeComponent.ts +15 -15
- package/src/MapManager.js +155 -155
- package/src/MapRegistry.js +34 -34
- package/src/StyleApplicator.js +240 -240
- package/src/WeatherLayerManager.js +872 -872
- package/android/build/.transforms/78b892a9dae44f36e51ff0649e9c6e36/results.bin +0 -1
- package/android/build/.transforms/78b892a9dae44f36e51ff0649e9c6e36/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/.transforms/f4de14556a82e99f0d27ddcab762b219/results.bin +0 -1
- package/android/build/.transforms/f4de14556a82e99f0d27ddcab762b219/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/aguacerowx/reactnative/AguaceroPackage.dex +0 -0
- package/android/build/.transforms/f4de14556a82e99f0d27ddcab762b219/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/aguacerowx/reactnative/BuildConfig.dex +0 -0
- package/android/build/.transforms/f4de14556a82e99f0d27ddcab762b219/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/aguacerowx/reactnative/GridRenderLayer$VertexInfo.dex +0 -0
- package/android/build/.transforms/f4de14556a82e99f0d27ddcab762b219/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/aguacerowx/reactnative/GridRenderLayer.dex +0 -0
- package/android/build/.transforms/f4de14556a82e99f0d27ddcab762b219/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/aguacerowx/reactnative/GridRenderLayerView.dex +0 -0
- package/android/build/.transforms/f4de14556a82e99f0d27ddcab762b219/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/aguacerowx/reactnative/GridRenderManager.dex +0 -0
- package/android/build/.transforms/f4de14556a82e99f0d27ddcab762b219/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/aguacerowx/reactnative/InspectorModule.dex +0 -0
- package/android/build/.transforms/f4de14556a82e99f0d27ddcab762b219/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/aguacerowx/reactnative/ShaderUtils.dex +0 -0
- package/android/build/.transforms/f4de14556a82e99f0d27ddcab762b219/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/aguacerowx/reactnative/WeatherFrameProcessorModule.dex +0 -0
- package/android/build/.transforms/f4de14556a82e99f0d27ddcab762b219/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
- package/android/build/generated/source/buildConfig/debug/com/aguacerowx/reactnative/BuildConfig.java +0 -10
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +0 -8
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +0 -18
- package/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +0 -6
- package/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +0 -1
- package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
- package/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +0 -4
- package/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_debug_fragment_shader.glsl.flat +0 -0
- package/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_debug_vertex_shader.glsl.flat +0 -0
- package/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_fragment_shader.glsl.flat +0 -0
- package/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_vertex_shader.glsl.flat +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +0 -5
- package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +0 -2
- package/android/build/intermediates/incremental/mergeDebugAssets/merger.xml +0 -2
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +0 -2
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +0 -2
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/AguaceroPackage.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/BuildConfig.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayer$VertexInfo.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayer.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayerView.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderManager.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/InspectorModule.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/ShaderUtils.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/WeatherFrameProcessorModule.class +0 -0
- package/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +0 -6
- package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +0 -8
- package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +0 -8
- package/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +0 -1
- package/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +0 -1
- package/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/debug_fragment_shader.glsl +0 -13
- package/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/debug_vertex_shader.glsl +0 -13
- package/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/fragment_shader.glsl +0 -98
- package/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/vertex_shader.glsl +0 -20
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/AguaceroPackage.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/BuildConfig.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayer$VertexInfo.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayer.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayerView.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderManager.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/InspectorModule.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/ShaderUtils.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/WeatherFrameProcessorModule.class +0 -0
- package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +0 -5
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -17
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/AguaceroPackage.class.uniqueId1 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/GridRenderLayerView.class.uniqueId2 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/GridRenderManager.class.uniqueId3 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/InspectorModule.class.uniqueId0 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/lib/commonjs/android/build/generated/source/buildConfig/debug/com/aguacerowx/reactnative/BuildConfig.java +0 -10
- package/lib/commonjs/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +0 -8
- package/lib/commonjs/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +0 -18
- package/lib/commonjs/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +0 -6
- package/lib/commonjs/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +0 -1
- package/lib/commonjs/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
- package/lib/commonjs/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
- package/lib/commonjs/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +0 -4
- package/lib/commonjs/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_debug_fragment_shader.glsl.flat +0 -0
- package/lib/commonjs/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_debug_vertex_shader.glsl.flat +0 -0
- package/lib/commonjs/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_fragment_shader.glsl.flat +0 -0
- package/lib/commonjs/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_vertex_shader.glsl.flat +0 -0
- package/lib/commonjs/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +0 -5
- package/lib/commonjs/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +0 -2
- package/lib/commonjs/android/build/intermediates/incremental/mergeDebugAssets/merger.xml +0 -2
- package/lib/commonjs/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +0 -2
- package/lib/commonjs/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +0 -2
- package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/AguaceroPackage.class +0 -0
- package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/BuildConfig.class +0 -0
- package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayer$VertexInfo.class +0 -0
- package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayer.class +0 -0
- package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayerView.class +0 -0
- package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderManager.class +0 -0
- package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/InspectorModule.class +0 -0
- package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/ShaderUtils.class +0 -0
- package/lib/commonjs/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/WeatherFrameProcessorModule.class +0 -0
- package/lib/commonjs/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +0 -6
- package/lib/commonjs/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +0 -8
- package/lib/commonjs/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +0 -8
- package/lib/commonjs/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +0 -1
- package/lib/commonjs/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +0 -1
- package/lib/commonjs/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/debug_fragment_shader.glsl +0 -13
- package/lib/commonjs/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/debug_vertex_shader.glsl +0 -13
- package/lib/commonjs/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/fragment_shader.glsl +0 -98
- package/lib/commonjs/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/vertex_shader.glsl +0 -20
- package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/AguaceroPackage.class +0 -0
- package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/BuildConfig.class +0 -0
- package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayer$VertexInfo.class +0 -0
- package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayer.class +0 -0
- package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayerView.class +0 -0
- package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderManager.class +0 -0
- package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/InspectorModule.class +0 -0
- package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/ShaderUtils.class +0 -0
- package/lib/commonjs/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/WeatherFrameProcessorModule.class +0 -0
- package/lib/commonjs/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
- package/lib/commonjs/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +0 -5
- package/lib/commonjs/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -17
- package/lib/commonjs/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/AguaceroPackage.class.uniqueId1 +0 -0
- package/lib/commonjs/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/GridRenderLayerView.class.uniqueId2 +0 -0
- package/lib/commonjs/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/GridRenderManager.class.uniqueId3 +0 -0
- package/lib/commonjs/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/InspectorModule.class.uniqueId0 +0 -0
- package/lib/commonjs/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/lib/module/android/build/generated/source/buildConfig/debug/com/aguacerowx/reactnative/BuildConfig.java +0 -10
- package/lib/module/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +0 -8
- package/lib/module/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +0 -18
- package/lib/module/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +0 -6
- package/lib/module/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +0 -1
- package/lib/module/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
- package/lib/module/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
- package/lib/module/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +0 -4
- package/lib/module/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_debug_fragment_shader.glsl.flat +0 -0
- package/lib/module/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_debug_vertex_shader.glsl.flat +0 -0
- package/lib/module/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_fragment_shader.glsl.flat +0 -0
- package/lib/module/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_vertex_shader.glsl.flat +0 -0
- package/lib/module/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +0 -5
- package/lib/module/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +0 -2
- package/lib/module/android/build/intermediates/incremental/mergeDebugAssets/merger.xml +0 -2
- package/lib/module/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +0 -2
- package/lib/module/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +0 -2
- package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/AguaceroPackage.class +0 -0
- package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/BuildConfig.class +0 -0
- package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayer$VertexInfo.class +0 -0
- package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayer.class +0 -0
- package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderLayerView.class +0 -0
- package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/GridRenderManager.class +0 -0
- package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/InspectorModule.class +0 -0
- package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/ShaderUtils.class +0 -0
- package/lib/module/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/aguacerowx/reactnative/WeatherFrameProcessorModule.class +0 -0
- package/lib/module/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +0 -6
- package/lib/module/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +0 -8
- package/lib/module/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +0 -8
- package/lib/module/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +0 -1
- package/lib/module/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +0 -1
- package/lib/module/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/debug_fragment_shader.glsl +0 -13
- package/lib/module/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/debug_vertex_shader.glsl +0 -13
- package/lib/module/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/fragment_shader.glsl +0 -98
- package/lib/module/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/vertex_shader.glsl +0 -20
- package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/AguaceroPackage.class +0 -0
- package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/BuildConfig.class +0 -0
- package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayer$VertexInfo.class +0 -0
- package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayer.class +0 -0
- package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderLayerView.class +0 -0
- package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/GridRenderManager.class +0 -0
- package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/InspectorModule.class +0 -0
- package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/ShaderUtils.class +0 -0
- package/lib/module/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/aguacerowx/reactnative/WeatherFrameProcessorModule.class +0 -0
- package/lib/module/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
- package/lib/module/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +0 -5
- package/lib/module/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -17
- package/lib/module/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/AguaceroPackage.class.uniqueId1 +0 -0
- package/lib/module/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/GridRenderLayerView.class.uniqueId2 +0 -0
- package/lib/module/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/GridRenderManager.class.uniqueId3 +0 -0
- package/lib/module/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/InspectorModule.class.uniqueId0 +0 -0
- package/lib/module/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
import Foundation
|
|
2
|
-
import React
|
|
3
|
-
|
|
4
|
-
@objc(InspectorModule)
|
|
5
|
-
class InspectorModule: NSObject {
|
|
6
|
-
|
|
7
|
-
@objc(getValueAtGridIndex:j:resolver:rejecter:)
|
|
8
|
-
func getValueAtGridIndex(
|
|
9
|
-
i: NSNumber,
|
|
10
|
-
j: NSNumber,
|
|
11
|
-
resolve: @escaping RCTPromiseResolveBlock,
|
|
12
|
-
reject: @escaping RCTPromiseRejectBlock
|
|
13
|
-
) {
|
|
14
|
-
DispatchQueue.global(qos: .userInitiated).async {
|
|
15
|
-
let cache = InspectorDataCache.shared
|
|
16
|
-
|
|
17
|
-
guard let data = cache.lastDecompressedData else {
|
|
18
|
-
print("🔍 [Inspector] ERROR: No data in cache")
|
|
19
|
-
resolve(nil)
|
|
20
|
-
return
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
let nx = cache.nx
|
|
24
|
-
let scale = cache.scale
|
|
25
|
-
let offset = cache.offset
|
|
26
|
-
let missing = cache.missing
|
|
27
|
-
let scaleType = cache.scaleType
|
|
28
|
-
|
|
29
|
-
let index = j.intValue * nx + i.intValue
|
|
30
|
-
|
|
31
|
-
guard index >= 0 && index < data.count else {
|
|
32
|
-
print("🔍 [Inspector] ERROR: Index out of bounds")
|
|
33
|
-
resolve(nil)
|
|
34
|
-
return
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// Read as signed value
|
|
38
|
-
let signedQuantizedValue = Int(Int8(bitPattern: data[index]))
|
|
39
|
-
let missingQuantized = Int(round(missing))
|
|
40
|
-
|
|
41
|
-
// Check for missing value with tolerance
|
|
42
|
-
if abs(signedQuantizedValue - missingQuantized) < 1 {
|
|
43
|
-
resolve(nil)
|
|
44
|
-
return
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// Step 1: Linear dequantization
|
|
48
|
-
let intermediateValue = Double(signedQuantizedValue) * Double(scale) + Double(offset)
|
|
49
|
-
var finalValue = intermediateValue
|
|
50
|
-
|
|
51
|
-
// Step 2: Apply sqrt inverse transformation if needed
|
|
52
|
-
if scaleType == 1 {
|
|
53
|
-
finalValue = intermediateValue * abs(intermediateValue)
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
resolve(finalValue)
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
@objc
|
|
61
|
-
static func requiresMainQueueSetup() -> Bool {
|
|
62
|
-
return false
|
|
63
|
-
}
|
|
1
|
+
import Foundation
|
|
2
|
+
import React
|
|
3
|
+
|
|
4
|
+
@objc(InspectorModule)
|
|
5
|
+
class InspectorModule: NSObject {
|
|
6
|
+
|
|
7
|
+
@objc(getValueAtGridIndex:j:resolver:rejecter:)
|
|
8
|
+
func getValueAtGridIndex(
|
|
9
|
+
i: NSNumber,
|
|
10
|
+
j: NSNumber,
|
|
11
|
+
resolve: @escaping RCTPromiseResolveBlock,
|
|
12
|
+
reject: @escaping RCTPromiseRejectBlock
|
|
13
|
+
) {
|
|
14
|
+
DispatchQueue.global(qos: .userInitiated).async {
|
|
15
|
+
let cache = InspectorDataCache.shared
|
|
16
|
+
|
|
17
|
+
guard let data = cache.lastDecompressedData else {
|
|
18
|
+
print("🔍 [Inspector] ERROR: No data in cache")
|
|
19
|
+
resolve(nil)
|
|
20
|
+
return
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
let nx = cache.nx
|
|
24
|
+
let scale = cache.scale
|
|
25
|
+
let offset = cache.offset
|
|
26
|
+
let missing = cache.missing
|
|
27
|
+
let scaleType = cache.scaleType
|
|
28
|
+
|
|
29
|
+
let index = j.intValue * nx + i.intValue
|
|
30
|
+
|
|
31
|
+
guard index >= 0 && index < data.count else {
|
|
32
|
+
print("🔍 [Inspector] ERROR: Index out of bounds")
|
|
33
|
+
resolve(nil)
|
|
34
|
+
return
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Read as signed value
|
|
38
|
+
let signedQuantizedValue = Int(Int8(bitPattern: data[index]))
|
|
39
|
+
let missingQuantized = Int(round(missing))
|
|
40
|
+
|
|
41
|
+
// Check for missing value with tolerance
|
|
42
|
+
if abs(signedQuantizedValue - missingQuantized) < 1 {
|
|
43
|
+
resolve(nil)
|
|
44
|
+
return
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Step 1: Linear dequantization
|
|
48
|
+
let intermediateValue = Double(signedQuantizedValue) * Double(scale) + Double(offset)
|
|
49
|
+
var finalValue = intermediateValue
|
|
50
|
+
|
|
51
|
+
// Step 2: Apply sqrt inverse transformation if needed
|
|
52
|
+
if scaleType == 1 {
|
|
53
|
+
finalValue = intermediateValue * abs(intermediateValue)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
resolve(finalValue)
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@objc
|
|
61
|
+
static func requiresMainQueueSetup() -> Bool {
|
|
62
|
+
return false
|
|
63
|
+
}
|
|
64
64
|
}
|
package/ios/Shaders.metal
CHANGED
|
@@ -1,131 +1,131 @@
|
|
|
1
|
-
#include <metal_stdlib>
|
|
2
|
-
using namespace metal;
|
|
3
|
-
|
|
4
|
-
// Struct to match the vertex buffer layout in Swift
|
|
5
|
-
struct Vertex {
|
|
6
|
-
float2 position [[attribute(0)]];
|
|
7
|
-
float2 texCoord [[attribute(1)]];
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
// Struct for passing data from vertex to fragment shader
|
|
11
|
-
struct RasterizerData {
|
|
12
|
-
float4 position [[position]];
|
|
13
|
-
float2 texCoord;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
// Uniforms passed from the CPU to the fragment shader
|
|
17
|
-
struct FragmentUniforms {
|
|
18
|
-
float opacity;
|
|
19
|
-
float2 dataRange;
|
|
20
|
-
float scale;
|
|
21
|
-
float offset;
|
|
22
|
-
float missingQuantized;
|
|
23
|
-
float2 textureSize;
|
|
24
|
-
int smoothing;
|
|
25
|
-
int scaleType; // 0 for linear, 1 for sqrt
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
// --- Vertex Shader (Unchanged) ---
|
|
29
|
-
vertex RasterizerData vertex_main(const Vertex in [[stage_in]],
|
|
30
|
-
constant float4x4 &mvp [[buffer(1)]]) {
|
|
31
|
-
RasterizerData out;
|
|
32
|
-
out.position = mvp * float4(in.position, 0.0, 1.0);
|
|
33
|
-
out.texCoord = in.texCoord;
|
|
34
|
-
return out;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
float sampleDataTextureSmooth(
|
|
38
|
-
texture2d<float, access::sample> dataTexture,
|
|
39
|
-
sampler dataSampler,
|
|
40
|
-
float2 uv,
|
|
41
|
-
constant FragmentUniforms &uniforms)
|
|
42
|
-
{
|
|
43
|
-
float missing_value = uniforms.missingQuantized + 128.0;
|
|
44
|
-
|
|
45
|
-
// Calculate the fractional part for interpolation and the size of one texel.
|
|
46
|
-
float2 texel_size = 1.0 / uniforms.textureSize;
|
|
47
|
-
float2 pixel_coord = uv * uniforms.textureSize;
|
|
48
|
-
float2 pixel_floor = floor(pixel_coord - 0.5);
|
|
49
|
-
float2 f = fract(pixel_coord - 0.5);
|
|
50
|
-
|
|
51
|
-
// Calculate the precise UV coordinates for the CENTER of the four surrounding texels.
|
|
52
|
-
float2 uv00 = (pixel_floor + float2(0.5, 0.5)) * texel_size;
|
|
53
|
-
float2 uv10 = (pixel_floor + float2(1.5, 0.5)) * texel_size;
|
|
54
|
-
float2 uv01 = (pixel_floor + float2(0.5, 1.5)) * texel_size;
|
|
55
|
-
float2 uv11 = (pixel_floor + float2(1.5, 1.5)) * texel_size;
|
|
56
|
-
|
|
57
|
-
// Sample the four corner texels.
|
|
58
|
-
float s00 = dataTexture.sample(dataSampler, uv00).r * 255.0;
|
|
59
|
-
float s10 = dataTexture.sample(dataSampler, uv10).r * 255.0;
|
|
60
|
-
float s01 = dataTexture.sample(dataSampler, uv01).r * 255.0;
|
|
61
|
-
float s11 = dataTexture.sample(dataSampler, uv11).r * 255.0;
|
|
62
|
-
|
|
63
|
-
// THE CRITICAL CHECK: If any surrounding pixel is a "missing" value,
|
|
64
|
-
// treat this entire fragment as missing to prevent interpolation.
|
|
65
|
-
if (abs(s00 - missing_value) < 0.5 ||
|
|
66
|
-
abs(s10 - missing_value) < 0.5 ||
|
|
67
|
-
abs(s01 - missing_value) < 0.5 ||
|
|
68
|
-
abs(s11 - missing_value) < 0.5)
|
|
69
|
-
{
|
|
70
|
-
return missing_value;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// All neighbors are valid data, so we can safely perform manual bilinear interpolation.
|
|
74
|
-
float s0 = mix(s00, s10, f.x); // Interpolate the top row
|
|
75
|
-
float s1 = mix(s01, s11, f.x); // Interpolate the bottom row
|
|
76
|
-
|
|
77
|
-
// --- THE FIX IS HERE ---
|
|
78
|
-
// Remove the incorrect "1.0 - f.y" inversion. The vertical mix should use f.y directly.
|
|
79
|
-
return mix(s0, s1, f.y);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
// --- Fragment Shader (NEW & IMPROVED) ---
|
|
83
|
-
fragment float4 fragment_main(RasterizerData in [[stage_in]],
|
|
84
|
-
constant FragmentUniforms &uniforms [[buffer(0)]],
|
|
85
|
-
texture2d<float, access::sample> dataTexture [[texture(0)]],
|
|
86
|
-
texture2d<float, access::sample> colormapTexture [[texture(1)]],
|
|
87
|
-
sampler dataSampler [[sampler(0)]],
|
|
88
|
-
sampler colormapSampler [[sampler(1)]])
|
|
89
|
-
{
|
|
90
|
-
// Choose the sampling method based on the smoothing uniform.
|
|
91
|
-
float value_in_texture;
|
|
92
|
-
if (uniforms.smoothing == 1) {
|
|
93
|
-
// Use our custom function that prevents edge artifacts.
|
|
94
|
-
value_in_texture = sampleDataTextureSmooth(dataTexture, dataSampler, in.texCoord, uniforms);
|
|
95
|
-
} else {
|
|
96
|
-
// Smoothing is off. The sampler is already set to 'nearest' by the Swift code,
|
|
97
|
-
// so a standard sample call produces the correct pixelated result.
|
|
98
|
-
value_in_texture = dataTexture.sample(dataSampler, in.texCoord).r * 255.0;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
float missing_value = uniforms.missingQuantized + 128.0;
|
|
102
|
-
|
|
103
|
-
// Discard if the pixel is a predefined missing value (either originally or from our function).
|
|
104
|
-
if (abs(value_in_texture - missing_value) < 0.5) {
|
|
105
|
-
discard_fragment();
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
// Dequantize the value to its real-world representation.
|
|
109
|
-
float quantized_value = value_in_texture - 128.0;
|
|
110
|
-
float intermediate_value = quantized_value * uniforms.scale + uniforms.offset;
|
|
111
|
-
float raw_value = intermediate_value;
|
|
112
|
-
|
|
113
|
-
// Apply non-linear inverse scaling if specified.
|
|
114
|
-
if (uniforms.scaleType == 1) { // 'sqrt'
|
|
115
|
-
raw_value = intermediate_value * abs(intermediate_value);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
// Discard if the data is below the specified visible range.
|
|
119
|
-
if (raw_value < uniforms.dataRange.x) {
|
|
120
|
-
discard_fragment();
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
// Normalize the value to a 0-1 coordinate for colormap lookup.
|
|
124
|
-
float colormap_coord = (raw_value - uniforms.dataRange.x) / (uniforms.dataRange.y - uniforms.dataRange.x);
|
|
125
|
-
colormap_coord = clamp(colormap_coord, 0.0, 1.0);
|
|
126
|
-
|
|
127
|
-
// Sample the colormap and apply final opacity.
|
|
128
|
-
float4 color = colormapTexture.sample(colormapSampler, float2(colormap_coord, 0.5));
|
|
129
|
-
|
|
130
|
-
return float4(color.rgb, color.a * uniforms.opacity);
|
|
1
|
+
#include <metal_stdlib>
|
|
2
|
+
using namespace metal;
|
|
3
|
+
|
|
4
|
+
// Struct to match the vertex buffer layout in Swift
|
|
5
|
+
struct Vertex {
|
|
6
|
+
float2 position [[attribute(0)]];
|
|
7
|
+
float2 texCoord [[attribute(1)]];
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
// Struct for passing data from vertex to fragment shader
|
|
11
|
+
struct RasterizerData {
|
|
12
|
+
float4 position [[position]];
|
|
13
|
+
float2 texCoord;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
// Uniforms passed from the CPU to the fragment shader
|
|
17
|
+
struct FragmentUniforms {
|
|
18
|
+
float opacity;
|
|
19
|
+
float2 dataRange;
|
|
20
|
+
float scale;
|
|
21
|
+
float offset;
|
|
22
|
+
float missingQuantized;
|
|
23
|
+
float2 textureSize;
|
|
24
|
+
int smoothing;
|
|
25
|
+
int scaleType; // 0 for linear, 1 for sqrt
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
// --- Vertex Shader (Unchanged) ---
|
|
29
|
+
vertex RasterizerData vertex_main(const Vertex in [[stage_in]],
|
|
30
|
+
constant float4x4 &mvp [[buffer(1)]]) {
|
|
31
|
+
RasterizerData out;
|
|
32
|
+
out.position = mvp * float4(in.position, 0.0, 1.0);
|
|
33
|
+
out.texCoord = in.texCoord;
|
|
34
|
+
return out;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
float sampleDataTextureSmooth(
|
|
38
|
+
texture2d<float, access::sample> dataTexture,
|
|
39
|
+
sampler dataSampler,
|
|
40
|
+
float2 uv,
|
|
41
|
+
constant FragmentUniforms &uniforms)
|
|
42
|
+
{
|
|
43
|
+
float missing_value = uniforms.missingQuantized + 128.0;
|
|
44
|
+
|
|
45
|
+
// Calculate the fractional part for interpolation and the size of one texel.
|
|
46
|
+
float2 texel_size = 1.0 / uniforms.textureSize;
|
|
47
|
+
float2 pixel_coord = uv * uniforms.textureSize;
|
|
48
|
+
float2 pixel_floor = floor(pixel_coord - 0.5);
|
|
49
|
+
float2 f = fract(pixel_coord - 0.5);
|
|
50
|
+
|
|
51
|
+
// Calculate the precise UV coordinates for the CENTER of the four surrounding texels.
|
|
52
|
+
float2 uv00 = (pixel_floor + float2(0.5, 0.5)) * texel_size;
|
|
53
|
+
float2 uv10 = (pixel_floor + float2(1.5, 0.5)) * texel_size;
|
|
54
|
+
float2 uv01 = (pixel_floor + float2(0.5, 1.5)) * texel_size;
|
|
55
|
+
float2 uv11 = (pixel_floor + float2(1.5, 1.5)) * texel_size;
|
|
56
|
+
|
|
57
|
+
// Sample the four corner texels.
|
|
58
|
+
float s00 = dataTexture.sample(dataSampler, uv00).r * 255.0;
|
|
59
|
+
float s10 = dataTexture.sample(dataSampler, uv10).r * 255.0;
|
|
60
|
+
float s01 = dataTexture.sample(dataSampler, uv01).r * 255.0;
|
|
61
|
+
float s11 = dataTexture.sample(dataSampler, uv11).r * 255.0;
|
|
62
|
+
|
|
63
|
+
// THE CRITICAL CHECK: If any surrounding pixel is a "missing" value,
|
|
64
|
+
// treat this entire fragment as missing to prevent interpolation.
|
|
65
|
+
if (abs(s00 - missing_value) < 0.5 ||
|
|
66
|
+
abs(s10 - missing_value) < 0.5 ||
|
|
67
|
+
abs(s01 - missing_value) < 0.5 ||
|
|
68
|
+
abs(s11 - missing_value) < 0.5)
|
|
69
|
+
{
|
|
70
|
+
return missing_value;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// All neighbors are valid data, so we can safely perform manual bilinear interpolation.
|
|
74
|
+
float s0 = mix(s00, s10, f.x); // Interpolate the top row
|
|
75
|
+
float s1 = mix(s01, s11, f.x); // Interpolate the bottom row
|
|
76
|
+
|
|
77
|
+
// --- THE FIX IS HERE ---
|
|
78
|
+
// Remove the incorrect "1.0 - f.y" inversion. The vertical mix should use f.y directly.
|
|
79
|
+
return mix(s0, s1, f.y);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// --- Fragment Shader (NEW & IMPROVED) ---
|
|
83
|
+
fragment float4 fragment_main(RasterizerData in [[stage_in]],
|
|
84
|
+
constant FragmentUniforms &uniforms [[buffer(0)]],
|
|
85
|
+
texture2d<float, access::sample> dataTexture [[texture(0)]],
|
|
86
|
+
texture2d<float, access::sample> colormapTexture [[texture(1)]],
|
|
87
|
+
sampler dataSampler [[sampler(0)]],
|
|
88
|
+
sampler colormapSampler [[sampler(1)]])
|
|
89
|
+
{
|
|
90
|
+
// Choose the sampling method based on the smoothing uniform.
|
|
91
|
+
float value_in_texture;
|
|
92
|
+
if (uniforms.smoothing == 1) {
|
|
93
|
+
// Use our custom function that prevents edge artifacts.
|
|
94
|
+
value_in_texture = sampleDataTextureSmooth(dataTexture, dataSampler, in.texCoord, uniforms);
|
|
95
|
+
} else {
|
|
96
|
+
// Smoothing is off. The sampler is already set to 'nearest' by the Swift code,
|
|
97
|
+
// so a standard sample call produces the correct pixelated result.
|
|
98
|
+
value_in_texture = dataTexture.sample(dataSampler, in.texCoord).r * 255.0;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
float missing_value = uniforms.missingQuantized + 128.0;
|
|
102
|
+
|
|
103
|
+
// Discard if the pixel is a predefined missing value (either originally or from our function).
|
|
104
|
+
if (abs(value_in_texture - missing_value) < 0.5) {
|
|
105
|
+
discard_fragment();
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// Dequantize the value to its real-world representation.
|
|
109
|
+
float quantized_value = value_in_texture - 128.0;
|
|
110
|
+
float intermediate_value = quantized_value * uniforms.scale + uniforms.offset;
|
|
111
|
+
float raw_value = intermediate_value;
|
|
112
|
+
|
|
113
|
+
// Apply non-linear inverse scaling if specified.
|
|
114
|
+
if (uniforms.scaleType == 1) { // 'sqrt'
|
|
115
|
+
raw_value = intermediate_value * abs(intermediate_value);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// Discard if the data is below the specified visible range.
|
|
119
|
+
if (raw_value < uniforms.dataRange.x) {
|
|
120
|
+
discard_fragment();
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Normalize the value to a 0-1 coordinate for colormap lookup.
|
|
124
|
+
float colormap_coord = (raw_value - uniforms.dataRange.x) / (uniforms.dataRange.y - uniforms.dataRange.x);
|
|
125
|
+
colormap_coord = clamp(colormap_coord, 0.0, 1.0);
|
|
126
|
+
|
|
127
|
+
// Sample the colormap and apply final opacity.
|
|
128
|
+
float4 color = colormapTexture.sample(colormapSampler, float2(colormap_coord, 0.5));
|
|
129
|
+
|
|
130
|
+
return float4(color.rgb, color.a * uniforms.opacity);
|
|
131
131
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
#import <React/RCTBridgeModule.h>
|
|
2
|
-
|
|
3
|
-
@interface RCT_EXTERN_MODULE(WeatherFrameProcessorModule, NSObject)
|
|
4
|
-
|
|
5
|
-
RCT_EXTERN_METHOD(processFrame:(NSDictionary *)options
|
|
6
|
-
resolver:(RCTPromiseResolveBlock)resolve
|
|
7
|
-
rejecter:(RCTPromiseRejectBlock)reject)
|
|
8
|
-
|
|
9
|
-
RCT_EXTERN_METHOD(cancelAllFrames)
|
|
10
|
-
|
|
11
|
-
+ (BOOL)requiresMainQueueSetup
|
|
12
|
-
{
|
|
13
|
-
return NO;
|
|
14
|
-
}
|
|
15
|
-
|
|
1
|
+
#import <React/RCTBridgeModule.h>
|
|
2
|
+
|
|
3
|
+
@interface RCT_EXTERN_MODULE(WeatherFrameProcessorModule, NSObject)
|
|
4
|
+
|
|
5
|
+
RCT_EXTERN_METHOD(processFrame:(NSDictionary *)options
|
|
6
|
+
resolver:(RCTPromiseResolveBlock)resolve
|
|
7
|
+
rejecter:(RCTPromiseRejectBlock)reject)
|
|
8
|
+
|
|
9
|
+
RCT_EXTERN_METHOD(cancelAllFrames)
|
|
10
|
+
|
|
11
|
+
+ (BOOL)requiresMainQueueSetup
|
|
12
|
+
{
|
|
13
|
+
return NO;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
16
|
@end
|
|
@@ -1,104 +1,104 @@
|
|
|
1
|
-
import Foundation
|
|
2
|
-
import React
|
|
3
|
-
|
|
4
|
-
@objc(WeatherFrameProcessorModule)
|
|
5
|
-
class WeatherFrameProcessorModule: NSObject {
|
|
6
|
-
|
|
7
|
-
private var currentRunToken = 0
|
|
8
|
-
private let session = URLSession(configuration: .default)
|
|
9
|
-
|
|
10
|
-
@objc(cancelAllFrames)
|
|
11
|
-
func cancelAllFrames() {
|
|
12
|
-
// Incrementing the token effectively cancels any in-flight tasks
|
|
13
|
-
// as they will check their token against the new value upon completion.
|
|
14
|
-
currentRunToken += 1
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
@objc(processFrame:resolver:rejecter:)
|
|
18
|
-
func processFrame(options: [String: Any], resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
|
|
19
|
-
let taskToken = self.currentRunToken
|
|
20
|
-
|
|
21
|
-
guard let urlString = options["url"] as? String, let url = URL(string: urlString) else {
|
|
22
|
-
reject("INVALID_URL", "The provided URL is not valid.", nil)
|
|
23
|
-
return
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
let apiKey = options["apiKey"] as? String ?? ""
|
|
27
|
-
let bundleId = options["bundleId"] as? String
|
|
28
|
-
|
|
29
|
-
var request = URLRequest(url: url)
|
|
30
|
-
request.setValue(apiKey, forHTTPHeaderField: "x-api-key")
|
|
31
|
-
if let bundleId = bundleId {
|
|
32
|
-
request.setValue(bundleId, forHTTPHeaderField: "x-app-identifier")
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
let task = session.dataTask(with: request) { data, response, error in
|
|
36
|
-
if self.currentRunToken != taskToken {
|
|
37
|
-
// Task was cancelled
|
|
38
|
-
return
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
if let error = error {
|
|
42
|
-
reject("NETWORK_ERROR", "Failed to fetch frame data: \(error.localizedDescription)", error)
|
|
43
|
-
return
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
guard let httpResponse = response as? HTTPURLResponse, (200...299).contains(httpResponse.statusCode) else {
|
|
47
|
-
let statusCode = (response as? HTTPURLResponse)?.statusCode ?? -1
|
|
48
|
-
reject("HTTP_ERROR", "HTTP request failed with status code: \(statusCode)", nil)
|
|
49
|
-
return
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
guard let data = data else {
|
|
53
|
-
reject("NO_DATA", "The server returned no data.", nil)
|
|
54
|
-
return
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
do {
|
|
58
|
-
guard let jsonResponse = try JSONSerialization.jsonObject(with: data, options: []) as? [String: Any],
|
|
59
|
-
let b64CompressedData = jsonResponse["data"] as? String,
|
|
60
|
-
let encoding = jsonResponse["encoding"] as? [String: Any],
|
|
61
|
-
let scale = encoding["scale"] as? NSNumber,
|
|
62
|
-
let offset = encoding["offset"] as? NSNumber,
|
|
63
|
-
let missing = encoding["missing_quantized"] as? NSNumber else {
|
|
64
|
-
reject("INVALID_RESPONSE", "The API response format was invalid.", nil)
|
|
65
|
-
return
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
guard let compressedData = Data(base64Encoded: b64CompressedData) else {
|
|
69
|
-
reject("DECODING_ERROR", "Failed to decode base64 data string.", nil)
|
|
70
|
-
return
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
let cacheDir = FileManager.default.urls(for: .cachesDirectory, in: .userDomainMask).first!
|
|
74
|
-
let fileName = "frame_\(urlString.hashValue).zst"
|
|
75
|
-
let dataFile = cacheDir.appendingPathComponent(fileName)
|
|
76
|
-
|
|
77
|
-
try compressedData.write(to: dataFile)
|
|
78
|
-
|
|
79
|
-
var responseMap: [String: Any] = [
|
|
80
|
-
"filePath": dataFile.path,
|
|
81
|
-
"scale": scale,
|
|
82
|
-
"offset": offset,
|
|
83
|
-
"missing": missing,
|
|
84
|
-
"dataAsBase64": b64CompressedData // Pass this through for the initial load case
|
|
85
|
-
]
|
|
86
|
-
|
|
87
|
-
if let scaleType = encoding["scale_type"] as? String {
|
|
88
|
-
responseMap["scaleType"] = scaleType
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
resolve(responseMap)
|
|
92
|
-
|
|
93
|
-
} catch {
|
|
94
|
-
reject("PROCESSING_ERROR", "Failed to process the frame data: \(error.localizedDescription)", error)
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
task.resume()
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
@objc
|
|
101
|
-
static func requiresMainQueueSetup() -> Bool {
|
|
102
|
-
return false
|
|
103
|
-
}
|
|
1
|
+
import Foundation
|
|
2
|
+
import React
|
|
3
|
+
|
|
4
|
+
@objc(WeatherFrameProcessorModule)
|
|
5
|
+
class WeatherFrameProcessorModule: NSObject {
|
|
6
|
+
|
|
7
|
+
private var currentRunToken = 0
|
|
8
|
+
private let session = URLSession(configuration: .default)
|
|
9
|
+
|
|
10
|
+
@objc(cancelAllFrames)
|
|
11
|
+
func cancelAllFrames() {
|
|
12
|
+
// Incrementing the token effectively cancels any in-flight tasks
|
|
13
|
+
// as they will check their token against the new value upon completion.
|
|
14
|
+
currentRunToken += 1
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@objc(processFrame:resolver:rejecter:)
|
|
18
|
+
func processFrame(options: [String: Any], resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) {
|
|
19
|
+
let taskToken = self.currentRunToken
|
|
20
|
+
|
|
21
|
+
guard let urlString = options["url"] as? String, let url = URL(string: urlString) else {
|
|
22
|
+
reject("INVALID_URL", "The provided URL is not valid.", nil)
|
|
23
|
+
return
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
let apiKey = options["apiKey"] as? String ?? ""
|
|
27
|
+
let bundleId = options["bundleId"] as? String
|
|
28
|
+
|
|
29
|
+
var request = URLRequest(url: url)
|
|
30
|
+
request.setValue(apiKey, forHTTPHeaderField: "x-api-key")
|
|
31
|
+
if let bundleId = bundleId {
|
|
32
|
+
request.setValue(bundleId, forHTTPHeaderField: "x-app-identifier")
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
let task = session.dataTask(with: request) { data, response, error in
|
|
36
|
+
if self.currentRunToken != taskToken {
|
|
37
|
+
// Task was cancelled
|
|
38
|
+
return
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if let error = error {
|
|
42
|
+
reject("NETWORK_ERROR", "Failed to fetch frame data: \(error.localizedDescription)", error)
|
|
43
|
+
return
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
guard let httpResponse = response as? HTTPURLResponse, (200...299).contains(httpResponse.statusCode) else {
|
|
47
|
+
let statusCode = (response as? HTTPURLResponse)?.statusCode ?? -1
|
|
48
|
+
reject("HTTP_ERROR", "HTTP request failed with status code: \(statusCode)", nil)
|
|
49
|
+
return
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
guard let data = data else {
|
|
53
|
+
reject("NO_DATA", "The server returned no data.", nil)
|
|
54
|
+
return
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
do {
|
|
58
|
+
guard let jsonResponse = try JSONSerialization.jsonObject(with: data, options: []) as? [String: Any],
|
|
59
|
+
let b64CompressedData = jsonResponse["data"] as? String,
|
|
60
|
+
let encoding = jsonResponse["encoding"] as? [String: Any],
|
|
61
|
+
let scale = encoding["scale"] as? NSNumber,
|
|
62
|
+
let offset = encoding["offset"] as? NSNumber,
|
|
63
|
+
let missing = encoding["missing_quantized"] as? NSNumber else {
|
|
64
|
+
reject("INVALID_RESPONSE", "The API response format was invalid.", nil)
|
|
65
|
+
return
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
guard let compressedData = Data(base64Encoded: b64CompressedData) else {
|
|
69
|
+
reject("DECODING_ERROR", "Failed to decode base64 data string.", nil)
|
|
70
|
+
return
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
let cacheDir = FileManager.default.urls(for: .cachesDirectory, in: .userDomainMask).first!
|
|
74
|
+
let fileName = "frame_\(urlString.hashValue).zst"
|
|
75
|
+
let dataFile = cacheDir.appendingPathComponent(fileName)
|
|
76
|
+
|
|
77
|
+
try compressedData.write(to: dataFile)
|
|
78
|
+
|
|
79
|
+
var responseMap: [String: Any] = [
|
|
80
|
+
"filePath": dataFile.path,
|
|
81
|
+
"scale": scale,
|
|
82
|
+
"offset": offset,
|
|
83
|
+
"missing": missing,
|
|
84
|
+
"dataAsBase64": b64CompressedData // Pass this through for the initial load case
|
|
85
|
+
]
|
|
86
|
+
|
|
87
|
+
if let scaleType = encoding["scale_type"] as? String {
|
|
88
|
+
responseMap["scaleType"] = scaleType
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
resolve(responseMap)
|
|
92
|
+
|
|
93
|
+
} catch {
|
|
94
|
+
reject("PROCESSING_ERROR", "Failed to process the frame data: \(error.localizedDescription)", error)
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
task.resume()
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
@objc
|
|
101
|
+
static func requiresMainQueueSetup() -> Bool {
|
|
102
|
+
return false
|
|
103
|
+
}
|
|
104
104
|
}
|