@aguacerowx/react-native 0.0.4 → 0.0.7
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 +51 -6
- package/android/build/.transforms/78b892a9dae44f36e51ff0649e9c6e36/transformed/classes/classes_dex/classes.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/WeatherFrameProcessorModule.dex +0 -0
- package/android/build/.transforms/f4de14556a82e99f0d27ddcab762b219/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
- package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/compiled_local_resources/debug/compileDebugLibraryResources/out/raw_fragment_shader.glsl.flat +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +1 -1
- 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/WeatherFrameProcessorModule.class +0 -0
- package/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/fragment_shader.glsl +13 -2
- 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/WeatherFrameProcessorModule.class +0 -0
- package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
- 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/android/src/main/java/com/aguacerowx/reactnative/GridRenderLayer.java +21 -52
- package/android/src/main/java/com/aguacerowx/reactnative/GridRenderLayerView.java +13 -2
- package/android/src/main/java/com/aguacerowx/reactnative/GridRenderManager.java +21 -14
- package/android/src/main/java/com/aguacerowx/reactnative/WeatherFrameProcessorModule.java +15 -0
- package/android/src/main/res/raw/fragment_shader.glsl +13 -2
- package/ios/GridRenderLayer.swift +62 -0
- package/ios/GridRenderLayerManager.mm +140 -0
- package/ios/aguacerowx-react-native.podspec +29 -0
- package/lib/commonjs/README.md +61 -0
- package/lib/commonjs/android/build/generated/source/buildConfig/debug/com/aguacerowx/reactnative/BuildConfig.java +10 -0
- package/lib/commonjs/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +8 -0
- package/lib/commonjs/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +18 -0
- package/lib/commonjs/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +6 -0
- package/lib/commonjs/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +1 -0
- 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 +4 -0
- 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 +5 -0
- package/lib/commonjs/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
- package/lib/commonjs/android/build/intermediates/incremental/mergeDebugAssets/merger.xml +2 -0
- package/lib/commonjs/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
- package/lib/commonjs/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
- 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 +6 -0
- package/lib/commonjs/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +8 -0
- package/lib/commonjs/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +8 -0
- package/lib/commonjs/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +1 -0
- package/lib/commonjs/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +1 -0
- package/lib/commonjs/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/debug_fragment_shader.glsl +13 -0
- package/lib/commonjs/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/debug_vertex_shader.glsl +13 -0
- package/lib/commonjs/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/fragment_shader.glsl +98 -0
- package/lib/commonjs/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/vertex_shader.glsl +20 -0
- 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 +5 -0
- package/lib/commonjs/android/build/outputs/logs/manifest-merger-debug-report.txt +17 -0
- 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/commonjs/android/build.gradle +85 -0
- package/lib/commonjs/android/src/main/AndroidManifest.xml +7 -0
- package/lib/commonjs/android/src/main/java/com/aguacerowx/reactnative/AguaceroPackage.java +34 -0
- package/lib/commonjs/android/src/main/java/com/aguacerowx/reactnative/GridRenderLayer.java +608 -0
- package/lib/commonjs/android/src/main/java/com/aguacerowx/reactnative/GridRenderLayerView.java +298 -0
- package/lib/commonjs/android/src/main/java/com/aguacerowx/reactnative/GridRenderManager.java +118 -0
- package/lib/commonjs/android/src/main/java/com/aguacerowx/reactnative/InspectorModule.java +64 -0
- package/lib/commonjs/android/src/main/java/com/aguacerowx/reactnative/ShaderUtils.java +107 -0
- package/lib/commonjs/android/src/main/java/com/aguacerowx/reactnative/WeatherFrameProcessorModule.java +166 -0
- package/lib/commonjs/android/src/main/res/raw/debug_fragment_shader.glsl +13 -0
- package/lib/commonjs/android/src/main/res/raw/debug_vertex_shader.glsl +13 -0
- package/lib/commonjs/android/src/main/res/raw/fragment_shader.glsl +98 -0
- package/lib/commonjs/android/src/main/res/raw/vertex_shader.glsl +20 -0
- package/lib/commonjs/babel.config.js +7 -0
- package/lib/commonjs/babel.config.js.map +1 -0
- package/lib/commonjs/index.js +20 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +73 -0
- package/lib/commonjs/react-native-builder-bob.config.js +13 -0
- package/lib/commonjs/react-native-builder-bob.config.js.map +1 -0
- package/lib/commonjs/src/AguaceroContext.js +11 -0
- package/lib/commonjs/src/AguaceroContext.js.map +1 -0
- package/lib/commonjs/src/GridRenderLayer.js +132 -0
- package/lib/commonjs/src/GridRenderLayer.js.map +1 -0
- package/lib/commonjs/src/GridRenderLayerNativeComponent.js +11 -0
- package/lib/commonjs/src/GridRenderLayerNativeComponent.js.map +1 -0
- package/lib/commonjs/src/MapManager.js +164 -0
- package/lib/commonjs/src/MapManager.js.map +1 -0
- package/lib/commonjs/src/MapRegistry.js +36 -0
- package/lib/commonjs/src/MapRegistry.js.map +1 -0
- package/lib/commonjs/src/StyleApplicator.js +262 -0
- package/lib/commonjs/src/StyleApplicator.js.map +1 -0
- package/lib/commonjs/src/WeatherLayerManager.js +782 -0
- package/lib/commonjs/src/WeatherLayerManager.js.map +1 -0
- package/lib/commonjs/tsconfig.json +24 -0
- package/lib/module/README.md +61 -0
- package/lib/module/android/build/generated/source/buildConfig/debug/com/aguacerowx/reactnative/BuildConfig.java +10 -0
- package/lib/module/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +8 -0
- package/lib/module/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +18 -0
- package/lib/module/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +6 -0
- package/lib/module/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +1 -0
- 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 +4 -0
- 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 +5 -0
- package/lib/module/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
- package/lib/module/android/build/intermediates/incremental/mergeDebugAssets/merger.xml +2 -0
- package/lib/module/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
- package/lib/module/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
- 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 +6 -0
- package/lib/module/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +8 -0
- package/lib/module/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +8 -0
- package/lib/module/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +1 -0
- package/lib/module/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +1 -0
- package/lib/module/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/debug_fragment_shader.glsl +13 -0
- package/lib/module/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/debug_vertex_shader.glsl +13 -0
- package/lib/module/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/fragment_shader.glsl +98 -0
- package/lib/module/android/build/intermediates/packaged_res/debug/packageDebugResources/raw/vertex_shader.glsl +20 -0
- 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 +5 -0
- package/lib/module/android/build/outputs/logs/manifest-merger-debug-report.txt +17 -0
- 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
- package/lib/module/android/build.gradle +85 -0
- package/lib/module/android/src/main/AndroidManifest.xml +7 -0
- package/lib/module/android/src/main/java/com/aguacerowx/reactnative/AguaceroPackage.java +34 -0
- package/lib/module/android/src/main/java/com/aguacerowx/reactnative/GridRenderLayer.java +608 -0
- package/lib/module/android/src/main/java/com/aguacerowx/reactnative/GridRenderLayerView.java +298 -0
- package/lib/module/android/src/main/java/com/aguacerowx/reactnative/GridRenderManager.java +118 -0
- package/lib/module/android/src/main/java/com/aguacerowx/reactnative/InspectorModule.java +64 -0
- package/lib/module/android/src/main/java/com/aguacerowx/reactnative/ShaderUtils.java +107 -0
- package/lib/module/android/src/main/java/com/aguacerowx/reactnative/WeatherFrameProcessorModule.java +166 -0
- package/lib/module/android/src/main/res/raw/debug_fragment_shader.glsl +13 -0
- package/lib/module/android/src/main/res/raw/debug_vertex_shader.glsl +13 -0
- package/lib/module/android/src/main/res/raw/fragment_shader.glsl +98 -0
- package/lib/module/android/src/main/res/raw/vertex_shader.glsl +20 -0
- package/lib/module/babel.config.js +5 -0
- package/lib/module/babel.config.js.map +1 -0
- package/lib/module/index.js +3 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/lib/commonjs/README.md +61 -0
- package/lib/module/lib/commonjs/android/build.gradle +85 -0
- package/lib/module/lib/commonjs/android/src/main/AndroidManifest.xml +7 -0
- package/lib/module/lib/commonjs/babel.config.js +7 -0
- package/lib/module/lib/commonjs/babel.config.js.map +1 -0
- package/lib/module/lib/commonjs/index.js +20 -0
- package/lib/module/lib/commonjs/index.js.map +1 -0
- package/lib/module/lib/commonjs/package.json +73 -0
- package/lib/module/lib/commonjs/react-native-builder-bob.config.js +13 -0
- package/lib/module/lib/commonjs/react-native-builder-bob.config.js.map +1 -0
- package/lib/module/lib/commonjs/src/AguaceroContext.js +15 -0
- package/lib/module/lib/commonjs/src/AguaceroContext.js.map +1 -0
- package/lib/module/lib/commonjs/src/GridRenderLayer.js +155 -0
- package/lib/module/lib/commonjs/src/GridRenderLayer.js.map +1 -0
- package/lib/module/lib/commonjs/src/GridRenderLayerNativeComponent.js +15 -0
- package/lib/module/lib/commonjs/src/GridRenderLayerNativeComponent.js.map +1 -0
- package/lib/module/lib/commonjs/src/MapManager.js +187 -0
- package/lib/module/lib/commonjs/src/MapManager.js.map +1 -0
- package/lib/module/lib/commonjs/src/MapRegistry.js +36 -0
- package/lib/module/lib/commonjs/src/MapRegistry.js.map +1 -0
- package/lib/module/lib/commonjs/src/StyleApplicator.js +286 -0
- package/lib/module/lib/commonjs/src/StyleApplicator.js.map +1 -0
- package/lib/module/lib/commonjs/src/WeatherLayerManager.js +801 -0
- package/lib/module/lib/commonjs/src/WeatherLayerManager.js.map +1 -0
- package/lib/module/lib/commonjs/tsconfig.json +24 -0
- package/lib/module/package.json +73 -0
- package/lib/module/react-native-builder-bob.config.js +11 -0
- package/lib/module/react-native-builder-bob.config.js.map +1 -0
- package/lib/module/src/AguaceroContext.js +5 -0
- package/lib/module/src/AguaceroContext.js.map +1 -0
- package/lib/module/src/GridRenderLayer.js +125 -0
- package/lib/module/src/GridRenderLayer.js.map +1 -0
- package/lib/module/src/GridRenderLayerNativeComponent.js +5 -0
- package/lib/module/src/GridRenderLayerNativeComponent.js.map +1 -0
- package/lib/module/src/MapManager.js +155 -0
- package/lib/module/src/MapManager.js.map +1 -0
- package/lib/module/src/MapRegistry.js +30 -0
- package/lib/module/src/MapRegistry.js.map +1 -0
- package/lib/module/src/StyleApplicator.js +255 -0
- package/lib/module/src/StyleApplicator.js.map +1 -0
- package/lib/module/src/WeatherLayerManager.js +775 -0
- package/lib/module/src/WeatherLayerManager.js.map +1 -0
- package/lib/module/tsconfig.json +24 -0
- package/lib/typescript/babel.config.d.ts +3 -0
- package/lib/typescript/babel.config.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +3 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/react-native-builder-bob.config.d.ts +6 -0
- package/lib/typescript/react-native-builder-bob.config.d.ts.map +1 -0
- package/lib/typescript/src/AguaceroContext.d.ts +2 -0
- package/lib/typescript/src/AguaceroContext.d.ts.map +1 -0
- package/lib/typescript/src/GridRenderLayer.d.ts +2 -0
- package/lib/typescript/src/GridRenderLayer.d.ts.map +1 -0
- package/lib/typescript/src/GridRenderLayerNativeComponent.d.ts +12 -0
- package/lib/typescript/src/GridRenderLayerNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/MapManager.d.ts +8 -0
- package/lib/typescript/src/MapManager.d.ts.map +1 -0
- package/lib/typescript/src/MapRegistry.d.ts +12 -0
- package/lib/typescript/src/MapRegistry.d.ts.map +1 -0
- package/lib/typescript/src/StyleApplicator.d.ts +4 -0
- package/lib/typescript/src/StyleApplicator.d.ts.map +1 -0
- package/lib/typescript/src/WeatherLayerManager.d.ts +2 -0
- package/lib/typescript/src/WeatherLayerManager.d.ts.map +1 -0
- package/package.json +53 -15
- package/src/AguaceroContext.js +0 -4
- package/src/GridRenderLayer.js +0 -121
- package/src/MapManager.js +0 -158
- package/src/MapRegistry.js +0 -35
- package/src/StyleApplicator.js +0 -241
- package/src/WeatherLayerManager.js +0 -754
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
package com.aguacerowx.reactnative;
|
|
2
|
+
|
|
3
|
+
import android.app.Activity;
|
|
4
|
+
import android.util.Base64;
|
|
5
|
+
import android.util.Log;
|
|
6
|
+
import android.view.View;
|
|
7
|
+
import android.view.ViewGroup;
|
|
8
|
+
import android.widget.FrameLayout;
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.NonNull;
|
|
11
|
+
|
|
12
|
+
import com.facebook.react.bridge.ReadableArray;
|
|
13
|
+
import com.facebook.react.bridge.ReadableMap;
|
|
14
|
+
import com.facebook.react.uimanager.ThemedReactContext;
|
|
15
|
+
import com.mapbox.maps.LayerPosition;
|
|
16
|
+
import com.mapbox.maps.MapView;
|
|
17
|
+
import com.mapbox.maps.MapboxMap;
|
|
18
|
+
import com.mapbox.maps.Style;
|
|
19
|
+
|
|
20
|
+
// ADD THIS IMPORT
|
|
21
|
+
import com.github.luben.zstd.Zstd;
|
|
22
|
+
|
|
23
|
+
import java.io.File;
|
|
24
|
+
import java.io.FileInputStream;
|
|
25
|
+
import java.nio.ByteBuffer;
|
|
26
|
+
|
|
27
|
+
public class GridRenderLayerView extends FrameLayout {
|
|
28
|
+
|
|
29
|
+
private final GridRenderLayer gridLayerImplementation;
|
|
30
|
+
private final String LAYER_ID = "weather-layer-" + getId();
|
|
31
|
+
private static final String TAG = "AguaceroWX";
|
|
32
|
+
private MapView mapView;
|
|
33
|
+
private boolean isLayerAdded = false;
|
|
34
|
+
private String belowLayerID = null;
|
|
35
|
+
private static byte[] lastDecompressedData = null;
|
|
36
|
+
private static int lastDataNx = 0;
|
|
37
|
+
private static int lastDataNy = 0;
|
|
38
|
+
private static float lastDataScale = 1.0f;
|
|
39
|
+
private static float lastDataOffset = 0.0f;
|
|
40
|
+
private static float lastDataMissing = 127.0f;
|
|
41
|
+
private static String lastDataScaleType = "linear";
|
|
42
|
+
|
|
43
|
+
public GridRenderLayerView(@NonNull ThemedReactContext context) {
|
|
44
|
+
super(context);
|
|
45
|
+
this.gridLayerImplementation = new GridRenderLayer(context);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
public static String getLastDataScaleType() {
|
|
49
|
+
return lastDataScaleType;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
public void updateDataTexture(String dataFilePathOrBase64, int nx, int ny, float scale, float offset, float missing, String scaleType) {
|
|
53
|
+
if (dataFilePathOrBase64 == null) {
|
|
54
|
+
Log.e(TAG, "❌ [View] Data from manager is null!");
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (!isLayerAdded) {
|
|
59
|
+
findMapViewAndAddLayer();
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
try {
|
|
63
|
+
byte[] compressedData;
|
|
64
|
+
if (dataFilePathOrBase64.startsWith("/")) {
|
|
65
|
+
File file = new File(dataFilePathOrBase64);
|
|
66
|
+
try (FileInputStream fis = new FileInputStream(file)) {
|
|
67
|
+
compressedData = new byte[(int) file.length()];
|
|
68
|
+
fis.read(compressedData);
|
|
69
|
+
}
|
|
70
|
+
} else {
|
|
71
|
+
compressedData = Base64.decode(dataFilePathOrBase64, Base64.DEFAULT);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
int expectedLength = nx * ny;
|
|
75
|
+
byte[] decompressedDeltas = Zstd.decompress(compressedData, expectedLength);
|
|
76
|
+
byte[] reconstructedData = reconstructData(decompressedDeltas, expectedLength);
|
|
77
|
+
byte[] finalTextureBytes = transformData(reconstructedData);
|
|
78
|
+
|
|
79
|
+
// CACHE the decompressed, transformed data for the inspector
|
|
80
|
+
lastDecompressedData = finalTextureBytes;
|
|
81
|
+
lastDataNx = nx;
|
|
82
|
+
lastDataNy = ny;
|
|
83
|
+
lastDataScale = scale;
|
|
84
|
+
lastDataOffset = offset;
|
|
85
|
+
lastDataMissing = missing;
|
|
86
|
+
lastDataScaleType = scaleType; // FIX: Update the cached scaleType
|
|
87
|
+
|
|
88
|
+
gridLayerImplementation.updateDataTexture(finalTextureBytes, nx, ny, scale, offset, missing, scaleType);
|
|
89
|
+
triggerRepaint();
|
|
90
|
+
|
|
91
|
+
} catch (Exception e) {
|
|
92
|
+
Log.e(TAG, "❌❌❌ [View] CRITICAL ERROR during data processing: " + e.getMessage());
|
|
93
|
+
e.printStackTrace();
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// Add a method to get the cached data
|
|
98
|
+
public static byte[] getLastDecompressedData() {
|
|
99
|
+
return lastDecompressedData;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
public static int getLastDataNx() {
|
|
103
|
+
return lastDataNx;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
public static int getLastDataNy() {
|
|
107
|
+
return lastDataNy;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
public static float getLastDataScale() {
|
|
111
|
+
return lastDataScale;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
public static float getLastDataOffset() {
|
|
115
|
+
return lastDataOffset;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
public static float getLastDataMissing() {
|
|
119
|
+
return lastDataMissing;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
public void setBelowID(String belowID) {
|
|
123
|
+
this.belowLayerID = belowID;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
@Override
|
|
127
|
+
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
|
|
128
|
+
super.onLayout(changed, left, top, right, bottom);
|
|
129
|
+
// It's often more reliable to trigger map search here
|
|
130
|
+
findMapViewAndAddLayer();
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
@Override
|
|
134
|
+
public void onViewAdded(View child) {
|
|
135
|
+
super.onViewAdded(child);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
private void findMapViewAndAddLayer() {
|
|
139
|
+
if (isLayerAdded) {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
Activity activity = ((ThemedReactContext) getContext()).getCurrentActivity();
|
|
144
|
+
if (activity == null) {
|
|
145
|
+
Log.e(TAG, "❌ [View] Could not find current Activity to search for MapView.");
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
View rootView = activity.findViewById(android.R.id.content);
|
|
150
|
+
if (rootView == null) {
|
|
151
|
+
Log.e(TAG, "❌ [View] Could not find root view of the Activity.");
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
MapView foundMap = findMapViewRecursive(rootView);
|
|
156
|
+
|
|
157
|
+
if (foundMap != null) {
|
|
158
|
+
this.mapView = foundMap;
|
|
159
|
+
final MapboxMap mapboxMap = mapView.getMapboxMap();
|
|
160
|
+
|
|
161
|
+
Style.OnStyleLoaded styleLoadedCallback = style -> {
|
|
162
|
+
if (!isLayerAdded && !style.styleLayerExists(LAYER_ID)) {
|
|
163
|
+
LayerPosition position = null;
|
|
164
|
+
if (this.belowLayerID != null && !this.belowLayerID.isEmpty()) {
|
|
165
|
+
if (style.styleLayerExists(this.belowLayerID)) {
|
|
166
|
+
position = new LayerPosition(null, this.belowLayerID, null);
|
|
167
|
+
} else {
|
|
168
|
+
Log.w(TAG, "⚠️ [View] Target layer '" + this.belowLayerID + "' NOT FOUND. Adding layer on top as a fallback.");
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
style.addStyleCustomLayer(LAYER_ID, gridLayerImplementation, position);
|
|
172
|
+
isLayerAdded = true;
|
|
173
|
+
triggerRepaint();
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
Style currentStyle = mapboxMap.getStyle();
|
|
178
|
+
if (currentStyle != null && currentStyle.isStyleLoaded()) {
|
|
179
|
+
styleLoadedCallback.onStyleLoaded(currentStyle);
|
|
180
|
+
} else {
|
|
181
|
+
mapboxMap.getStyle(styleLoadedCallback);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
} else {
|
|
185
|
+
Log.e(TAG, "❌❌❌ [View] FAILED to find MapView after searching from the root view! ❌❌❌");
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
private MapView findMapViewRecursive(View view) {
|
|
190
|
+
if (view instanceof MapView) {
|
|
191
|
+
return (MapView) view;
|
|
192
|
+
}
|
|
193
|
+
if (view instanceof ViewGroup) {
|
|
194
|
+
ViewGroup viewGroup = (ViewGroup) view;
|
|
195
|
+
for (int i = 0; i < viewGroup.getChildCount(); i++) {
|
|
196
|
+
MapView found = findMapViewRecursive(viewGroup.getChildAt(i));
|
|
197
|
+
if (found != null) {
|
|
198
|
+
return found;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
return null;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
private void triggerRepaint() {
|
|
206
|
+
if (mapView != null) {
|
|
207
|
+
mapView.post(mapView.getMapboxMap()::triggerRepaint);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
public void setOpacity(float opacity) {
|
|
212
|
+
gridLayerImplementation.setOpacity(opacity);
|
|
213
|
+
triggerRepaint();
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
public void setSmoothing(boolean enabled) {
|
|
217
|
+
gridLayerImplementation.setSmoothing(enabled);
|
|
218
|
+
triggerRepaint();
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
public void setDataRange(float[] range) {
|
|
222
|
+
gridLayerImplementation.setDataRange(range);
|
|
223
|
+
triggerRepaint();
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
public void setConversionType(int conversionType) {
|
|
227
|
+
gridLayerImplementation.setConversionType(conversionType);
|
|
228
|
+
triggerRepaint();
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
public void updateColormapTexture(String colormapAsBase64) {
|
|
232
|
+
if (colormapAsBase64 == null) {
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
if (!isLayerAdded) {
|
|
236
|
+
findMapViewAndAddLayer();
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
byte[] bytes = Base64.decode(colormapAsBase64, Base64.DEFAULT);
|
|
240
|
+
ByteBuffer colormapBuffer = ByteBuffer.allocateDirect(bytes.length);
|
|
241
|
+
colormapBuffer.put(bytes);
|
|
242
|
+
colormapBuffer.position(0);
|
|
243
|
+
gridLayerImplementation.updateColormapTexture(colormapBuffer);
|
|
244
|
+
triggerRepaint();
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
public void updateGeometry(ReadableMap corners, ReadableMap gridDef) {
|
|
248
|
+
if (!isLayerAdded) {
|
|
249
|
+
findMapViewAndAddLayer();
|
|
250
|
+
}
|
|
251
|
+
gridLayerImplementation.updateGeometry(corners, gridDef);
|
|
252
|
+
triggerRepaint();
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Reconstructs the full data array from the delta-encoded values.
|
|
257
|
+
* @param decompressedDeltas The array of deltas.
|
|
258
|
+
* @param expectedLength The total size of the final grid.
|
|
259
|
+
* @return The fully reconstructed data array.
|
|
260
|
+
*/
|
|
261
|
+
private byte[] reconstructData(byte[] decompressedDeltas, int expectedLength) {
|
|
262
|
+
byte[] reconstructedData = new byte[expectedLength];
|
|
263
|
+
if (decompressedDeltas.length > 0 && expectedLength > 0) {
|
|
264
|
+
reconstructedData[0] = decompressedDeltas[0];
|
|
265
|
+
for (int i = 1; i < expectedLength; i++) {
|
|
266
|
+
reconstructedData[i] = (byte) (reconstructedData[i - 1] + decompressedDeltas[i]);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
return reconstructedData;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Transforms the signed byte data (-128 to 127) to unsigned byte data (0 to 255)
|
|
274
|
+
* suitable for an ALPHA texture.
|
|
275
|
+
* @param finalData The reconstructed data array.
|
|
276
|
+
* @return The transformed data array ready for the GPU.
|
|
277
|
+
*/
|
|
278
|
+
private byte[] transformData(byte[] finalData) {
|
|
279
|
+
byte[] transformedData = new byte[finalData.length];
|
|
280
|
+
for (int i = 0; i < finalData.length; i++) {
|
|
281
|
+
transformedData[i] = (byte) (finalData[i] + 128);
|
|
282
|
+
}
|
|
283
|
+
return transformedData;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
// Add this method to GridRenderLayerView.java
|
|
287
|
+
public void updateDataParameters(float scale, float offset, float missing) {
|
|
288
|
+
// Update the cached values for the inspector
|
|
289
|
+
lastDataScale = scale;
|
|
290
|
+
lastDataOffset = offset;
|
|
291
|
+
lastDataMissing = missing;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
public void clearData() {
|
|
295
|
+
gridLayerImplementation.clearData();
|
|
296
|
+
triggerRepaint();
|
|
297
|
+
}
|
|
298
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
package com.aguacerowx.reactnative;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
import androidx.annotation.Nullable;
|
|
5
|
+
|
|
6
|
+
import com.facebook.react.bridge.ReadableArray;
|
|
7
|
+
import com.facebook.react.bridge.ReadableMap;
|
|
8
|
+
import com.facebook.react.uimanager.SimpleViewManager;
|
|
9
|
+
import com.facebook.react.uimanager.ThemedReactContext;
|
|
10
|
+
import com.facebook.react.uimanager.annotations.ReactProp;
|
|
11
|
+
import android.util.Log;
|
|
12
|
+
|
|
13
|
+
import java.util.Map;
|
|
14
|
+
import java.util.HashMap;
|
|
15
|
+
|
|
16
|
+
public class GridRenderManager extends SimpleViewManager<GridRenderLayerView> {
|
|
17
|
+
|
|
18
|
+
private static final String REACT_CLASS = "GridRenderLayer";
|
|
19
|
+
private static final int COMMAND_UPDATE_DATA_TEXTURE = 1;
|
|
20
|
+
private static final int COMMAND_UPDATE_COLORMAP_TEXTURE = 2;
|
|
21
|
+
private static final int COMMAND_UPDATE_GEOMETRY = 3;
|
|
22
|
+
private static final int COMMAND_UPDATE_DATA_PARAMETERS = 4;
|
|
23
|
+
private static final int COMMAND_CLEAR = 5;
|
|
24
|
+
|
|
25
|
+
@NonNull
|
|
26
|
+
@Override
|
|
27
|
+
public String getName() {
|
|
28
|
+
return REACT_CLASS;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@NonNull
|
|
32
|
+
@Override
|
|
33
|
+
protected GridRenderLayerView createViewInstance(@NonNull ThemedReactContext reactContext) {
|
|
34
|
+
return new GridRenderLayerView(reactContext);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@ReactProp(name = "opacity", defaultFloat = 1.0f)
|
|
38
|
+
public void setOpacity(GridRenderLayerView view, float opacity) {
|
|
39
|
+
view.setOpacity(opacity);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@ReactProp(name = "dataRange")
|
|
43
|
+
public void setDataRange(GridRenderLayerView view, @Nullable ReadableArray dataRange) {
|
|
44
|
+
if (dataRange != null && dataRange.size() == 2) {
|
|
45
|
+
float[] range = new float[]{
|
|
46
|
+
(float) dataRange.getDouble(0),
|
|
47
|
+
(float) dataRange.getDouble(1)
|
|
48
|
+
};
|
|
49
|
+
view.setDataRange(range);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@ReactProp(name = "belowID")
|
|
54
|
+
public void setBelowID(GridRenderLayerView view, @Nullable String belowID) {
|
|
55
|
+
view.setBelowID(belowID);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@ReactProp(name = "smoothing", defaultBoolean = true)
|
|
59
|
+
public void setSmoothing(GridRenderLayerView view, boolean enabled) {
|
|
60
|
+
view.setSmoothing(enabled);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@Override
|
|
64
|
+
public Map<String, Integer> getCommandsMap() {
|
|
65
|
+
Map<String, Integer> commands = new HashMap<>();
|
|
66
|
+
commands.put("updateDataTexture", COMMAND_UPDATE_DATA_TEXTURE);
|
|
67
|
+
commands.put("updateColormapTexture", COMMAND_UPDATE_COLORMAP_TEXTURE);
|
|
68
|
+
commands.put("updateGeometry", COMMAND_UPDATE_GEOMETRY);
|
|
69
|
+
commands.put("updateDataParameters", COMMAND_UPDATE_DATA_PARAMETERS);
|
|
70
|
+
commands.put("clear", COMMAND_CLEAR);
|
|
71
|
+
return commands;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@Override
|
|
75
|
+
public void receiveCommand(@NonNull GridRenderLayerView view, int commandId, @Nullable ReadableArray args) {
|
|
76
|
+
switch (commandId) {
|
|
77
|
+
case COMMAND_UPDATE_DATA_TEXTURE:
|
|
78
|
+
String data = args.getString(0);
|
|
79
|
+
int nx = args.getInt(1);
|
|
80
|
+
int ny = args.getInt(2);
|
|
81
|
+
float scale = (float) args.getDouble(3);
|
|
82
|
+
float offset = (float) args.getDouble(4);
|
|
83
|
+
float missing = (float) args.getDouble(5);
|
|
84
|
+
String scaleType = args.getString(6);
|
|
85
|
+
|
|
86
|
+
view.updateDataTexture(data, nx, ny, scale, offset, missing, scaleType);
|
|
87
|
+
break;
|
|
88
|
+
|
|
89
|
+
case COMMAND_UPDATE_COLORMAP_TEXTURE:
|
|
90
|
+
if (args != null && args.size() > 0) {
|
|
91
|
+
String colormapBase64 = args.getString(0);
|
|
92
|
+
view.updateColormapTexture(colormapBase64);
|
|
93
|
+
}
|
|
94
|
+
break;
|
|
95
|
+
|
|
96
|
+
case COMMAND_UPDATE_GEOMETRY:
|
|
97
|
+
if (args != null && args.size() >= 2) {
|
|
98
|
+
ReadableMap corners = args.getMap(0);
|
|
99
|
+
ReadableMap gridDef = args.getMap(1);
|
|
100
|
+
view.updateGeometry(corners, gridDef);
|
|
101
|
+
}
|
|
102
|
+
break;
|
|
103
|
+
|
|
104
|
+
case COMMAND_UPDATE_DATA_PARAMETERS:
|
|
105
|
+
if (args != null && args.size() >= 3) {
|
|
106
|
+
float scaleParam = (float) args.getDouble(0);
|
|
107
|
+
float offsetParam = (float) args.getDouble(1);
|
|
108
|
+
float missingParam = (float) args.getDouble(2);
|
|
109
|
+
view.updateDataParameters(scaleParam, offsetParam, missingParam);
|
|
110
|
+
}
|
|
111
|
+
break;
|
|
112
|
+
|
|
113
|
+
case COMMAND_CLEAR:
|
|
114
|
+
view.clearData();
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
package com.aguacerowx.reactnative;
|
|
2
|
+
|
|
3
|
+
import androidx.annotation.NonNull;
|
|
4
|
+
import com.facebook.react.bridge.Promise;
|
|
5
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
6
|
+
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
|
7
|
+
import com.facebook.react.bridge.ReactMethod;
|
|
8
|
+
|
|
9
|
+
public class InspectorModule extends ReactContextBaseJavaModule {
|
|
10
|
+
|
|
11
|
+
public InspectorModule(ReactApplicationContext reactContext) {
|
|
12
|
+
super(reactContext);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@NonNull
|
|
16
|
+
@Override
|
|
17
|
+
public String getName() {
|
|
18
|
+
return "InspectorModule";
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@ReactMethod
|
|
22
|
+
public void getValueAtGridIndex(int i, int j, Promise promise) {
|
|
23
|
+
try {
|
|
24
|
+
byte[] data = GridRenderLayerView.getLastDecompressedData();
|
|
25
|
+
if (data == null) {
|
|
26
|
+
promise.resolve(null);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
int nx = GridRenderLayerView.getLastDataNx();
|
|
31
|
+
int ny = GridRenderLayerView.getLastDataNy();
|
|
32
|
+
float scale = GridRenderLayerView.getLastDataScale();
|
|
33
|
+
float offset = GridRenderLayerView.getLastDataOffset();
|
|
34
|
+
float missing = GridRenderLayerView.getLastDataMissing();
|
|
35
|
+
|
|
36
|
+
// Calculate index
|
|
37
|
+
int index = j * nx + i;
|
|
38
|
+
|
|
39
|
+
// Bounds check
|
|
40
|
+
if (index < 0 || index >= data.length) {
|
|
41
|
+
promise.resolve(null);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Read byte value
|
|
46
|
+
int byteValue = data[index] & 0xFF; // Convert to unsigned
|
|
47
|
+
int signedQuantizedValue = byteValue - 128;
|
|
48
|
+
int missingQuantized = Math.round(missing - 128);
|
|
49
|
+
|
|
50
|
+
// Check for missing value
|
|
51
|
+
if (signedQuantizedValue == missingQuantized) {
|
|
52
|
+
promise.resolve(null);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Calculate actual value
|
|
57
|
+
double value = signedQuantizedValue * scale + offset;
|
|
58
|
+
|
|
59
|
+
promise.resolve(value);
|
|
60
|
+
} catch (Exception e) {
|
|
61
|
+
promise.reject("ERROR", e.getMessage());
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
package com.aguacerowx.reactnative;
|
|
2
|
+
|
|
3
|
+
import android.content.Context;
|
|
4
|
+
import android.opengl.GLES20;
|
|
5
|
+
import android.util.Log;
|
|
6
|
+
|
|
7
|
+
import java.io.BufferedReader;
|
|
8
|
+
import java.io.IOException;
|
|
9
|
+
import java.io.InputStream;
|
|
10
|
+
import java.io.InputStreamReader;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Utility class for loading, compiling, and linking OpenGL ES 2.0 shaders.
|
|
14
|
+
*/
|
|
15
|
+
public class ShaderUtils {
|
|
16
|
+
|
|
17
|
+
public static final String TAG = "ShaderUtils";
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Reads a raw text file from the res/raw directory.
|
|
21
|
+
*
|
|
22
|
+
* @param context The application context.
|
|
23
|
+
* @param resourceId The resource ID (e.g., R.raw.vertex_shader).
|
|
24
|
+
* @return The content of the file as a String.
|
|
25
|
+
*/
|
|
26
|
+
public static String readRawTextFile(Context context, int resourceId) {
|
|
27
|
+
InputStream inputStream = context.getResources().openRawResource(resourceId);
|
|
28
|
+
InputStreamReader inputStreamReader = new InputStreamReader(inputStream);
|
|
29
|
+
BufferedReader bufferedReader = new BufferedReader(inputStreamReader);
|
|
30
|
+
String nextLine;
|
|
31
|
+
StringBuilder body = new StringBuilder();
|
|
32
|
+
try {
|
|
33
|
+
while ((nextLine = bufferedReader.readLine()) != null) {
|
|
34
|
+
body.append(nextLine);
|
|
35
|
+
body.append('\n');
|
|
36
|
+
}
|
|
37
|
+
} catch (IOException e) {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
return body.toString();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Compiles a shader from source code.
|
|
45
|
+
*
|
|
46
|
+
* @param type The shader type (GLES20.GL_VERTEX_SHADER or GLES20.GL_FRAGMENT_SHADER).
|
|
47
|
+
* @param shaderCode The GLSL source code.
|
|
48
|
+
* @return The handle to the compiled shader.
|
|
49
|
+
*/
|
|
50
|
+
private static int compileShader(int type, String shaderCode) {
|
|
51
|
+
final int shader = GLES20.glCreateShader(type);
|
|
52
|
+
if (shader == 0) {
|
|
53
|
+
Log.e(TAG, "glCreateShader failed for type " + type);
|
|
54
|
+
return 0;
|
|
55
|
+
}
|
|
56
|
+
GLES20.glShaderSource(shader, shaderCode);
|
|
57
|
+
GLES20.glCompileShader(shader);
|
|
58
|
+
|
|
59
|
+
final int[] compileStatus = new int[1];
|
|
60
|
+
GLES20.glGetShaderiv(shader, GLES20.GL_COMPILE_STATUS, compileStatus, 0);
|
|
61
|
+
if (compileStatus[0] == 0) {
|
|
62
|
+
Log.e(TAG, "Shader compilation failed: " + GLES20.glGetShaderInfoLog(shader));
|
|
63
|
+
GLES20.glDeleteShader(shader);
|
|
64
|
+
return 0;
|
|
65
|
+
}
|
|
66
|
+
return shader;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Links a vertex and fragment shader into a complete OpenGL program.
|
|
71
|
+
*
|
|
72
|
+
* @param vertexShaderCode The vertex shader source code.
|
|
73
|
+
* @param fragmentShaderCode The fragment shader source code.
|
|
74
|
+
* @return The handle to the linked program.
|
|
75
|
+
*/
|
|
76
|
+
public static int createProgram(String vertexShaderCode, String fragmentShaderCode) {
|
|
77
|
+
int vertexShader = compileShader(GLES20.GL_VERTEX_SHADER, vertexShaderCode);
|
|
78
|
+
int fragmentShader = compileShader(GLES20.GL_FRAGMENT_SHADER, fragmentShaderCode);
|
|
79
|
+
|
|
80
|
+
if (vertexShader == 0 || fragmentShader == 0) {
|
|
81
|
+
return 0;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
final int program = GLES20.glCreateProgram();
|
|
85
|
+
if (program == 0) {
|
|
86
|
+
Log.e(TAG, "glCreateProgram failed");
|
|
87
|
+
return 0;
|
|
88
|
+
}
|
|
89
|
+
GLES20.glAttachShader(program, vertexShader);
|
|
90
|
+
GLES20.glAttachShader(program, fragmentShader);
|
|
91
|
+
GLES20.glLinkProgram(program);
|
|
92
|
+
|
|
93
|
+
final int[] linkStatus = new int[1];
|
|
94
|
+
GLES20.glGetProgramiv(program, GLES20.GL_LINK_STATUS, linkStatus, 0);
|
|
95
|
+
if (linkStatus[0] == 0) {
|
|
96
|
+
Log.e(TAG, "Program linking failed: " + GLES20.glGetProgramInfoLog(program));
|
|
97
|
+
GLES20.glDeleteProgram(program);
|
|
98
|
+
return 0;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// Shaders are no longer needed after linking
|
|
102
|
+
GLES20.glDeleteShader(vertexShader);
|
|
103
|
+
GLES20.glDeleteShader(fragmentShader);
|
|
104
|
+
|
|
105
|
+
return program;
|
|
106
|
+
}
|
|
107
|
+
}
|