@aguacerowx/react-native 0.0.52 → 0.0.54

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.
Files changed (265) hide show
  1. package/LICENSE +21 -0
  2. package/android/src/main/cpp/satellite_ktx_jni.cpp +6 -1
  3. package/android/src/main/java/com/aguacerowx/reactnative/NexradRadarLayerView.java +14 -2
  4. package/android/src/main/java/com/aguacerowx/reactnative/SatelliteLayer.java +121 -1
  5. package/android/src/main/java/com/aguacerowx/reactnative/SatelliteLayerView.java +556 -392
  6. package/android/src/main/java/com/aguacerowx/reactnative/WeatherFrameProcessorModule.java +77 -0
  7. package/index.js +1 -1
  8. package/ios/SatelliteLayerView.swift +517 -517
  9. package/ios/WeatherFrameProcessorModule.m +19 -15
  10. package/ios/WeatherFrameProcessorModule.swift +65 -0
  11. package/lib/commonjs/AguaceroContext.js +0 -4
  12. package/lib/commonjs/AguaceroContext.js.map +1 -1
  13. package/lib/commonjs/GridRenderLayer.js +62 -76
  14. package/lib/commonjs/GridRenderLayer.js.map +1 -1
  15. package/lib/commonjs/MapManager.js +110 -224
  16. package/lib/commonjs/MapManager.js.map +1 -1
  17. package/lib/commonjs/MapRegistry.js +21 -33
  18. package/lib/commonjs/MapRegistry.js.map +1 -1
  19. package/lib/commonjs/NexradRadarLayer.android.js +28 -100
  20. package/lib/commonjs/NexradRadarLayer.android.js.map +1 -1
  21. package/lib/commonjs/NexradRadarLayer.ios.js +26 -97
  22. package/lib/commonjs/NexradRadarLayer.ios.js.map +1 -1
  23. package/lib/commonjs/NexradSitesMapLayer.js +41 -61
  24. package/lib/commonjs/NexradSitesMapLayer.js.map +1 -1
  25. package/lib/commonjs/SatelliteLayer.android.js +26 -38
  26. package/lib/commonjs/SatelliteLayer.android.js.map +1 -1
  27. package/lib/commonjs/SatelliteLayer.ios.js +30 -42
  28. package/lib/commonjs/SatelliteLayer.ios.js.map +1 -1
  29. package/lib/commonjs/StyleApplicator.js +129 -175
  30. package/lib/commonjs/StyleApplicator.js.map +1 -1
  31. package/lib/commonjs/WeatherLayerManager.js +996 -1627
  32. package/lib/commonjs/WeatherLayerManager.js.map +1 -1
  33. package/lib/commonjs/aguaceroCoreDebugHooks.js +58 -130
  34. package/lib/commonjs/aguaceroCoreDebugHooks.js.map +1 -1
  35. package/lib/commonjs/aguaceroRnDebug.js +147 -287
  36. package/lib/commonjs/aguaceroRnDebug.js.map +1 -1
  37. package/lib/commonjs/cdnAuthenticatedFetch.js +104 -0
  38. package/lib/commonjs/cdnAuthenticatedFetch.js.map +1 -0
  39. package/lib/commonjs/dispatchViewManagerCommandCompat.js +51 -88
  40. package/lib/commonjs/dispatchViewManagerCommandCompat.js.map +1 -1
  41. package/lib/commonjs/gridCdnAuth.js +41 -50
  42. package/lib/commonjs/gridCdnAuth.js.map +1 -1
  43. package/lib/commonjs/index.js +51 -0
  44. package/lib/commonjs/index.js.map +1 -1
  45. package/lib/commonjs/nexrad/nexradAndroidController.js +851 -863
  46. package/lib/commonjs/nexrad/nexradAndroidController.js.map +1 -1
  47. package/lib/commonjs/nexrad/nexradCrossSectionSampleAtLatLon.bundled.js +62 -85
  48. package/lib/commonjs/nexrad/nexradCrossSectionSampleAtLatLon.bundled.js.map +1 -1
  49. package/lib/commonjs/nexrad/nexradDiag.js +32 -148
  50. package/lib/commonjs/nexrad/nexradDiag.js.map +1 -1
  51. package/lib/commonjs/nexrad/nexradLevel2Keys.js +261 -0
  52. package/lib/commonjs/nexrad/nexradLevel2Keys.js.map +1 -0
  53. package/lib/commonjs/nexrad/nexradLutBuild.js +64 -111
  54. package/lib/commonjs/nexrad/nexradLutBuild.js.map +1 -1
  55. package/lib/commonjs/nexrad/nexradMapboxFrameOpts.bundled.js +136 -164
  56. package/lib/commonjs/nexrad/nexradMapboxFrameOpts.bundled.js.map +1 -1
  57. package/lib/commonjs/nexrad/nexradSdkImports.js +51 -0
  58. package/lib/commonjs/nexrad/nexradSdkImports.js.map +1 -0
  59. package/lib/commonjs/nexrad/radarArchiveCore.bundled.js +2848 -4455
  60. package/lib/commonjs/nexrad/radarArchiveCore.bundled.js.map +1 -1
  61. package/lib/commonjs/nexrad/radarDecode.worker.bundled.js +445 -648
  62. package/lib/commonjs/nexrad/radarDecode.worker.bundled.js.map +1 -1
  63. package/lib/commonjs/nexrad/radarFrameGpuMatch.bundled.js +52 -68
  64. package/lib/commonjs/nexrad/radarFrameGpuMatch.bundled.js.map +1 -1
  65. package/lib/commonjs/nexradNativeCommandIds.js +24 -0
  66. package/lib/commonjs/nexradNativeCommandIds.js.map +1 -0
  67. package/lib/commonjs/nws/NwsAlertsOverlay.android.js.map +1 -1
  68. package/lib/commonjs/nws/NwsAlertsOverlay.ios.js.map +1 -1
  69. package/lib/commonjs/nws/NwsAlertsOverlay.js +3 -3
  70. package/lib/commonjs/nws/NwsAlertsOverlay.js.map +1 -1
  71. package/lib/commonjs/nws/NwsAlertsOverlay.native.js +235 -361
  72. package/lib/commonjs/nws/NwsAlertsOverlay.native.js.map +1 -1
  73. package/lib/commonjs/nws/eventSourceRnPolyfill.js +92 -146
  74. package/lib/commonjs/nws/eventSourceRnPolyfill.js.map +1 -1
  75. package/lib/commonjs/nws/nwsAndroidConstants.js +2 -8
  76. package/lib/commonjs/nws/nwsAndroidConstants.js.map +1 -1
  77. package/lib/commonjs/satellite/satelliteAndroidController.js +122 -199
  78. package/lib/commonjs/satellite/satelliteAndroidController.js.map +1 -1
  79. package/lib/commonjs/satelliteBridgeDiag.js +3 -13
  80. package/lib/commonjs/satelliteBridgeDiag.js.map +1 -1
  81. package/lib/commonjs/satelliteRnDebug.js +160 -0
  82. package/lib/commonjs/satelliteRnDebug.js.map +1 -0
  83. package/lib/module/AguaceroContext.js +2 -7
  84. package/lib/module/AguaceroContext.js.map +1 -1
  85. package/lib/module/GridRenderLayer.js +66 -80
  86. package/lib/module/GridRenderLayer.js.map +1 -1
  87. package/lib/module/MapManager.js +125 -239
  88. package/lib/module/MapManager.js.map +1 -1
  89. package/lib/module/MapRegistry.js +21 -33
  90. package/lib/module/MapRegistry.js.map +1 -1
  91. package/lib/module/NexradRadarLayer.android.js +32 -104
  92. package/lib/module/NexradRadarLayer.android.js.map +1 -1
  93. package/lib/module/NexradRadarLayer.ios.js +30 -101
  94. package/lib/module/NexradRadarLayer.ios.js.map +1 -1
  95. package/lib/module/NexradSitesMapLayer.js +44 -63
  96. package/lib/module/NexradSitesMapLayer.js.map +1 -1
  97. package/lib/module/SatelliteLayer.android.js +32 -44
  98. package/lib/module/SatelliteLayer.android.js.map +1 -1
  99. package/lib/module/SatelliteLayer.ios.js +36 -48
  100. package/lib/module/SatelliteLayer.ios.js.map +1 -1
  101. package/lib/module/StyleApplicator.js +144 -191
  102. package/lib/module/StyleApplicator.js.map +1 -1
  103. package/lib/module/WeatherLayerManager.js +1024 -1655
  104. package/lib/module/WeatherLayerManager.js.map +1 -1
  105. package/lib/module/aguaceroCoreDebugHooks.js +59 -130
  106. package/lib/module/aguaceroCoreDebugHooks.js.map +1 -1
  107. package/lib/module/aguaceroRnDebug.js +151 -291
  108. package/lib/module/aguaceroRnDebug.js.map +1 -1
  109. package/lib/module/cdnAuthenticatedFetch.js +97 -0
  110. package/lib/module/cdnAuthenticatedFetch.js.map +1 -0
  111. package/lib/module/dispatchViewManagerCommandCompat.js +52 -90
  112. package/lib/module/dispatchViewManagerCommandCompat.js.map +1 -1
  113. package/lib/module/gridCdnAuth.js +38 -50
  114. package/lib/module/gridCdnAuth.js.map +1 -1
  115. package/lib/module/index.js +9 -6
  116. package/lib/module/index.js.map +1 -1
  117. package/lib/module/nexrad/nexradAndroidController.js +865 -876
  118. package/lib/module/nexrad/nexradAndroidController.js.map +1 -1
  119. package/lib/module/nexrad/nexradCrossSectionSampleAtLatLon.bundled.js +62 -85
  120. package/lib/module/nexrad/nexradCrossSectionSampleAtLatLon.bundled.js.map +1 -1
  121. package/lib/module/nexrad/nexradDiag.js +31 -145
  122. package/lib/module/nexrad/nexradDiag.js.map +1 -1
  123. package/lib/module/nexrad/nexradLevel2Keys.js +245 -0
  124. package/lib/module/nexrad/nexradLevel2Keys.js.map +1 -0
  125. package/lib/module/nexrad/nexradLutBuild.js +64 -110
  126. package/lib/module/nexrad/nexradLutBuild.js.map +1 -1
  127. package/lib/module/nexrad/nexradMapboxFrameOpts.bundled.js +136 -163
  128. package/lib/module/nexrad/nexradMapboxFrameOpts.bundled.js.map +1 -1
  129. package/lib/module/nexrad/nexradSdkImports.js +4 -0
  130. package/lib/module/nexrad/nexradSdkImports.js.map +1 -0
  131. package/lib/module/nexrad/radarArchiveCore.bundled.js +2839 -4448
  132. package/lib/module/nexrad/radarArchiveCore.bundled.js.map +1 -1
  133. package/lib/module/nexrad/radarDecode.worker.bundled.js +445 -648
  134. package/lib/module/nexrad/radarDecode.worker.bundled.js.map +1 -1
  135. package/lib/module/nexrad/radarFrameGpuMatch.bundled.js +50 -66
  136. package/lib/module/nexrad/radarFrameGpuMatch.bundled.js.map +1 -1
  137. package/lib/module/nexradNativeCommandIds.js +18 -0
  138. package/lib/module/nexradNativeCommandIds.js.map +1 -0
  139. package/lib/module/nws/NwsAlertsOverlay.android.js +1 -1
  140. package/lib/module/nws/NwsAlertsOverlay.android.js.map +1 -1
  141. package/lib/module/nws/NwsAlertsOverlay.ios.js +1 -1
  142. package/lib/module/nws/NwsAlertsOverlay.ios.js.map +1 -1
  143. package/lib/module/nws/NwsAlertsOverlay.js +5 -5
  144. package/lib/module/nws/NwsAlertsOverlay.js.map +1 -1
  145. package/lib/module/nws/NwsAlertsOverlay.native.js +248 -373
  146. package/lib/module/nws/NwsAlertsOverlay.native.js.map +1 -1
  147. package/lib/module/nws/eventSourceRnPolyfill.js +92 -146
  148. package/lib/module/nws/eventSourceRnPolyfill.js.map +1 -1
  149. package/lib/module/nws/nwsAndroidConstants.js +2 -8
  150. package/lib/module/nws/nwsAndroidConstants.js.map +1 -1
  151. package/lib/module/satellite/satelliteAndroidController.js +125 -202
  152. package/lib/module/satellite/satelliteAndroidController.js.map +1 -1
  153. package/lib/module/satelliteBridgeDiag.js +3 -13
  154. package/lib/module/satelliteBridgeDiag.js.map +1 -1
  155. package/lib/module/satelliteRnDebug.js +148 -0
  156. package/lib/module/satelliteRnDebug.js.map +1 -0
  157. package/lib/typescript/AguaceroContext.d.ts +0 -4
  158. package/lib/typescript/AguaceroContext.d.ts.map +1 -1
  159. package/lib/typescript/GridRenderLayer.d.ts.map +1 -1
  160. package/lib/typescript/MapManager.d.ts +0 -12
  161. package/lib/typescript/MapManager.d.ts.map +1 -1
  162. package/lib/typescript/MapRegistry.d.ts +10 -12
  163. package/lib/typescript/MapRegistry.d.ts.map +1 -1
  164. package/lib/typescript/NexradRadarLayer.android.d.ts.map +1 -1
  165. package/lib/typescript/NexradRadarLayer.ios.d.ts.map +1 -1
  166. package/lib/typescript/NexradSitesMapLayer.d.ts +4 -10
  167. package/lib/typescript/NexradSitesMapLayer.d.ts.map +1 -1
  168. package/lib/typescript/SatelliteLayer.android.d.ts.map +1 -1
  169. package/lib/typescript/SatelliteLayer.ios.d.ts.map +1 -1
  170. package/lib/typescript/StyleApplicator.d.ts +1 -1
  171. package/lib/typescript/StyleApplicator.d.ts.map +1 -1
  172. package/lib/typescript/WeatherLayerManager.d.ts.map +1 -1
  173. package/lib/typescript/aguaceroCoreDebugHooks.d.ts +2 -9
  174. package/lib/typescript/aguaceroCoreDebugHooks.d.ts.map +1 -1
  175. package/lib/typescript/aguaceroRnDebug.d.ts +47 -66
  176. package/lib/typescript/aguaceroRnDebug.d.ts.map +1 -1
  177. package/lib/typescript/cdnAuthenticatedFetch.d.ts +10 -0
  178. package/lib/typescript/cdnAuthenticatedFetch.d.ts.map +1 -0
  179. package/lib/typescript/dispatchViewManagerCommandCompat.d.ts +1 -17
  180. package/lib/typescript/dispatchViewManagerCommandCompat.d.ts.map +1 -1
  181. package/lib/typescript/gridCdnAuth.d.ts +16 -21
  182. package/lib/typescript/gridCdnAuth.d.ts.map +1 -1
  183. package/lib/typescript/index.d.ts +2 -0
  184. package/lib/typescript/nexrad/nexradAndroidController.d.ts +39 -89
  185. package/lib/typescript/nexrad/nexradAndroidController.d.ts.map +1 -1
  186. package/lib/typescript/nexrad/nexradCrossSectionSampleAtLatLon.bundled.d.ts +2 -1
  187. package/lib/typescript/nexrad/nexradCrossSectionSampleAtLatLon.bundled.d.ts.map +1 -1
  188. package/lib/typescript/nexrad/nexradDiag.d.ts +13 -101
  189. package/lib/typescript/nexrad/nexradDiag.d.ts.map +1 -1
  190. package/lib/typescript/nexrad/nexradLevel2Keys.d.ts +36 -0
  191. package/lib/typescript/nexrad/nexradLevel2Keys.d.ts.map +1 -0
  192. package/lib/typescript/nexrad/nexradLutBuild.d.ts +3 -10
  193. package/lib/typescript/nexrad/nexradLutBuild.d.ts.map +1 -1
  194. package/lib/typescript/nexrad/nexradMapboxFrameOpts.bundled.d.ts +4 -3
  195. package/lib/typescript/nexrad/nexradMapboxFrameOpts.bundled.d.ts.map +1 -1
  196. package/lib/typescript/nexrad/nexradSdkImports.d.ts +2 -0
  197. package/lib/typescript/nexrad/nexradSdkImports.d.ts.map +1 -0
  198. package/lib/typescript/nexrad/radarArchiveCore.bundled.d.ts +12 -7
  199. package/lib/typescript/nexrad/radarArchiveCore.bundled.d.ts.map +1 -1
  200. package/lib/typescript/nexrad/radarDecode.worker.bundled.d.ts +20 -20
  201. package/lib/typescript/nexrad/radarDecode.worker.bundled.d.ts.map +1 -1
  202. package/lib/typescript/nexrad/radarFrameGpuMatch.bundled.d.ts +4 -3
  203. package/lib/typescript/nexrad/radarFrameGpuMatch.bundled.d.ts.map +1 -1
  204. package/lib/typescript/nexradNativeCommandIds.d.ts +2 -0
  205. package/lib/typescript/nexradNativeCommandIds.d.ts.map +1 -0
  206. package/lib/typescript/nws/NwsAlertsOverlay.native.d.ts +6 -17
  207. package/lib/typescript/nws/NwsAlertsOverlay.native.d.ts.map +1 -1
  208. package/lib/typescript/nws/eventSourceRnPolyfill.d.ts +0 -3
  209. package/lib/typescript/nws/eventSourceRnPolyfill.d.ts.map +1 -1
  210. package/lib/typescript/nws/nwsAndroidConstants.d.ts +0 -5
  211. package/lib/typescript/nws/nwsAndroidConstants.d.ts.map +1 -1
  212. package/lib/typescript/satellite/satelliteAndroidController.d.ts +9 -47
  213. package/lib/typescript/satellite/satelliteAndroidController.d.ts.map +1 -1
  214. package/lib/typescript/satelliteBridgeDiag.d.ts +1 -5
  215. package/lib/typescript/satelliteBridgeDiag.d.ts.map +1 -1
  216. package/lib/typescript/satelliteRnDebug.d.ts +75 -0
  217. package/lib/typescript/satelliteRnDebug.d.ts.map +1 -0
  218. package/package.json +75 -74
  219. package/src/AguaceroContext.js +1 -7
  220. package/src/GridRenderLayer.js +1 -128
  221. package/src/MapManager.js +1 -277
  222. package/src/MapRegistry.js +1 -56
  223. package/src/NexradRadarLayer.android.js +1 -121
  224. package/src/NexradRadarLayer.ios.js +1 -115
  225. package/src/NexradSitesMapLayer.js +1 -75
  226. package/src/SatelliteLayer.android.js +1 -63
  227. package/src/SatelliteLayer.ios.js +1 -70
  228. package/src/StyleApplicator.js +1 -241
  229. package/src/WeatherLayerManager.js +1 -2025
  230. package/src/aguaceroCoreDebugHooks.js +1 -142
  231. package/src/aguaceroRnDebug.js +1 -335
  232. package/src/cdnAuthenticatedFetch.js +1 -0
  233. package/src/dispatchViewManagerCommandCompat.js +1 -100
  234. package/src/gridCdnAuth.js +1 -56
  235. package/src/index.js +1 -19
  236. package/src/nexrad/nexradAndroidController.js +1 -1078
  237. package/src/nexrad/nexradCrossSectionSampleAtLatLon.bundled.js +1 -91
  238. package/src/nexrad/nexradDiag.js +1 -150
  239. package/src/nexrad/nexradLevel2Keys.js +1 -0
  240. package/src/nexrad/nexradLutBuild.js +1 -126
  241. package/src/nexrad/nexradMapboxFrameOpts.bundled.js +1 -245
  242. package/src/nexrad/nexradSdkImports.js +1 -0
  243. package/src/nexrad/radarArchiveCore.bundled.js +1 -7085
  244. package/src/nexrad/radarDecode.worker.bundled.js +1 -813
  245. package/src/nexrad/radarFrameGpuMatch.bundled.js +1 -79
  246. package/src/nexradNativeCommandIds.js +1 -0
  247. package/src/nws/NwsAlertsOverlay.android.js +1 -1
  248. package/src/nws/NwsAlertsOverlay.ios.js +1 -1
  249. package/src/nws/NwsAlertsOverlay.js +1 -7
  250. package/src/nws/NwsAlertsOverlay.native.js +1 -463
  251. package/src/nws/eventSourceRnPolyfill.js +7 -193
  252. package/src/nws/nwsAndroidConstants.js +1 -8
  253. package/src/satellite/satelliteAndroidController.js +1 -245
  254. package/src/satelliteBridgeDiag.js +1 -15
  255. package/src/satelliteRnDebug.js +1 -0
  256. package/lib/commonjs/nexrad/nexradNativeCommandIds.js +0 -51
  257. package/lib/commonjs/nexrad/nexradNativeCommandIds.js.map +0 -1
  258. package/lib/module/nexrad/nexradNativeCommandIds.js +0 -44
  259. package/lib/module/nexrad/nexradNativeCommandIds.js.map +0 -1
  260. package/lib/typescript/nexrad/nexradNativeCommandIds.d.ts +0 -9
  261. package/lib/typescript/nexrad/nexradNativeCommandIds.d.ts.map +0 -1
  262. package/src/nexrad/nexradNativeCommandIds.js +0 -44
  263. /package/lib/commonjs/{nexrad/nexradSitesUs.json → nexradSitesUs.json} +0 -0
  264. /package/lib/module/{nexrad/nexradSitesUs.json → nexradSitesUs.json} +0 -0
  265. /package/src/{nexrad/nexradSitesUs.json → nexradSitesUs.json} +0 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024-2026 Aguacero Wx
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -8,6 +8,7 @@
8
8
 
9
9
  #define LOG_TAG "AguaceroSatKtx"
10
10
  #define ALOGW(...) __android_log_print(ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)
11
+ #define ALOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)
11
12
 
12
13
  namespace {
13
14
 
@@ -104,10 +105,13 @@ Java_com_aguacerowx_reactnative_SatelliteKtxDecoder_nativeTranscodeKtx2(
104
105
  std::vector<uint8_t> out_pixels;
105
106
  basist::transcoder_texture_format used_fmt = basist::transcoder_texture_format::cTFTotalTextureFormats;
106
107
 
108
+ // Android: prefer ETC2 (GLES 3.0 baseline), then uncompressed RGBA32, then ASTC last.
109
+ // CPU-side ASTC transcode can succeed while Mapbox's GL context cannot sample it → black tiles.
110
+ // Web (satelliteKtxWorker.js) probes WebGL extensions before picking ASTC; match that intent here.
107
111
  static const basist::transcoder_texture_format k_try_order[] = {
108
- basist::transcoder_texture_format::cTFASTC_LDR_4x4_RGBA,
109
112
  basist::transcoder_texture_format::cTFETC2_RGBA,
110
113
  basist::transcoder_texture_format::cTFRGBA32,
114
+ basist::transcoder_texture_format::cTFASTC_LDR_4x4_RGBA,
111
115
  };
112
116
 
113
117
  bool ok = false;
@@ -131,6 +135,7 @@ Java_com_aguacerowx_reactnative_SatelliteKtxDecoder_nativeTranscodeKtx2(
131
135
  }
132
136
 
133
137
  const int32_t fmt_ordinal = static_cast<int32_t>(used_fmt);
138
+ ALOGI("KTX2 transcoded %ux%u to format ordinal %d", width, height, fmt_ordinal);
134
139
 
135
140
  const uint32_t header_size = 20;
136
141
  const uint32_t payload_size = static_cast<uint32_t>(out_pixels.size());
@@ -229,6 +229,18 @@ public class NexradRadarLayerView extends FrameLayout {
229
229
  return (System.nanoTime() - startNanos) / 1_000_000.0;
230
230
  }
231
231
 
232
+ /** JS may send 0/1 or legacy boolean for shader flags; {@link JSONObject#getDouble} rejects booleans. */
233
+ private static float jsonShaderFlag(JSONObject o, String key) throws org.json.JSONException {
234
+ Object raw = o.get(key);
235
+ if (raw instanceof Boolean) {
236
+ return ((Boolean) raw) ? 1f : 0f;
237
+ }
238
+ if (raw instanceof Number) {
239
+ return ((Number) raw).floatValue();
240
+ }
241
+ return (float) o.getDouble(key);
242
+ }
243
+
232
244
  private static byte[] decodeRleGateData(byte[] compressed, int expectedSize) {
233
245
  byte[] out = new byte[expectedSize];
234
246
  int outIdx = 0;
@@ -306,7 +318,7 @@ public class NexradRadarLayerView extends FrameLayout {
306
318
  float valueOffset = (float) o.getDouble("valueOffset");
307
319
  float lutMin = (float) o.getDouble("lutMin");
308
320
  float lutMax = (float) o.getDouble("lutMax");
309
- float discrete = (float) o.getDouble("discreteIntegerLut");
321
+ float discrete = jsonShaderFlag(o, "discreteIntegerLut");
310
322
  float opacity = (float) o.getDouble("opacity");
311
323
  float gateSmooth = (float) o.getDouble("gateSmoothPolar");
312
324
  int interpolateLut = o.optInt("interpolateLut", 1);
@@ -469,7 +481,7 @@ public class NexradRadarLayerView extends FrameLayout {
469
481
  float valueOffset = (float) o.getDouble("valueOffset");
470
482
  float lutMin = (float) o.getDouble("lutMin");
471
483
  float lutMax = (float) o.getDouble("lutMax");
472
- float discrete = (float) o.getDouble("discreteIntegerLut");
484
+ float discrete = jsonShaderFlag(o, "discreteIntegerLut");
473
485
  float opacity = (float) o.getDouble("opacity");
474
486
  float gateSmooth = (float) o.getDouble("gateSmoothPolar");
475
487
  int interpolateLut = o.optInt("interpolateLut", 1);
@@ -26,11 +26,46 @@ import java.util.Map;
26
26
  public class SatelliteLayer implements CustomLayerHost {
27
27
 
28
28
  private static final String TAG = "AguaceroSatellite";
29
+ /** Matches Metro filter {@code [AguaceroRN][satellite]} when debug is on. */
30
+ private static final String DIAG_TAG = "AguaceroRN";
29
31
  private static final int MAX_GPU_CACHED_FRAMES = 64;
30
32
 
33
+ private static volatile boolean debugLogging = false;
34
+ private int debugRenderTick = 0;
35
+
31
36
  private static final int GL_COMPRESSED_RGBA_ASTC_4x4_KHR = 0x93B0;
32
37
  private static final int GL_COMPRESSED_RGBA8_ETC2_EAC = 0x9278;
33
38
 
39
+ public static void setDebugLogging(boolean enabled) {
40
+ debugLogging = enabled;
41
+ }
42
+
43
+ private static void diag(String msg) {
44
+ if (debugLogging) {
45
+ android.util.Log.w(DIAG_TAG, "[satellite.native] " + msg);
46
+ }
47
+ }
48
+
49
+ private static String basisFormatName(int fmt) {
50
+ if (fmt == SatelliteKtxDecoder.TF_ETC2_RGBA) return "ETC2_RGBA";
51
+ if (fmt == SatelliteKtxDecoder.TF_ASTC_LDR_4x4_RGBA) return "ASTC_LDR_4x4";
52
+ if (fmt == SatelliteKtxDecoder.TF_RGBA32) return "RGBA32";
53
+ return "ordinal_" + fmt;
54
+ }
55
+
56
+ /** Snapshot for debug events (thread-safe). */
57
+ public void fillDebugSnapshot(@NonNull java.util.Map<String, Object> out) {
58
+ synchronized (lock) {
59
+ out.put("cachedFrameCount", cache.size());
60
+ out.put("pendingGpuUploads", pendingGpuQueue.size());
61
+ out.put("activeUnix", activeUnix);
62
+ out.put("targetUnix", targetUnix);
63
+ out.put("visible", visible);
64
+ out.put("opacity", opacity);
65
+ out.put("programReady", program != 0);
66
+ }
67
+ }
68
+
34
69
  private final Object lock = new Object();
35
70
 
36
71
  private int program;
@@ -197,6 +232,17 @@ public class SatelliteLayer implements CustomLayerHost {
197
232
  defaultIrColormapTex = uploadColormapTexture(ir);
198
233
  defaultWvColormapTex = uploadColormapTexture(wv);
199
234
  userColormapTex = 0;
235
+
236
+ if (debugLogging) {
237
+ String ext = GLES20.glGetString(GLES20.GL_EXTENSIONS);
238
+ if (ext == null) ext = "";
239
+ diag(
240
+ "gl.extensions hasASTC="
241
+ + ext.contains("ASTC")
242
+ + " hasETC2="
243
+ + (ext.contains("ETC2") || ext.contains("EAC"))
244
+ + " (black geocolor tiles often mean ASTC upload on unsupported GPU)");
245
+ }
200
246
  }
201
247
 
202
248
  private int uploadColormapTexture(byte[] rgba) {
@@ -401,6 +447,51 @@ public class SatelliteLayer implements CustomLayerHost {
401
447
  return null;
402
448
  }
403
449
 
450
+ int glErr = GLES20.glGetError();
451
+ if (glErr != GLES20.GL_NO_ERROR) {
452
+ Log.w(
453
+ TAG,
454
+ "GPU texture upload failed (GL 0x"
455
+ + Integer.toHexString(glErr)
456
+ + ") fmt="
457
+ + fmt
458
+ + " "
459
+ + w
460
+ + "x"
461
+ + h
462
+ + " — device may not support this compressed format; rebuild SDK with latest KTX transcode order");
463
+ diag(
464
+ "gpu.upload.fail unix="
465
+ + p.unix
466
+ + " gl=0x"
467
+ + Integer.toHexString(glErr)
468
+ + " fmt="
469
+ + basisFormatName(fmt)
470
+ + " "
471
+ + w
472
+ + "x"
473
+ + h
474
+ + " trueColor="
475
+ + p.trueColor);
476
+ GLES20.glDeleteTextures(1, texArr, 0);
477
+ GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, 0);
478
+ return null;
479
+ }
480
+
481
+ diag(
482
+ "gpu.upload.ok unix="
483
+ + p.unix
484
+ + " fmt="
485
+ + basisFormatName(fmt)
486
+ + " "
487
+ + w
488
+ + "x"
489
+ + h
490
+ + " trueColor="
491
+ + p.trueColor
492
+ + " useColormap="
493
+ + p.useColormap);
494
+
404
495
  GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, 0);
405
496
 
406
497
  FloatBuffer vb = p.mesh.vertexBuffer;
@@ -459,7 +550,36 @@ public class SatelliteLayer implements CustomLayerHost {
459
550
  synchronized (lock) {
460
551
  draw = activeUnix != null ? cache.get(activeUnix) : null;
461
552
  }
462
- if (draw == null || draw.indexCount <= 0) return;
553
+ if (draw == null || draw.indexCount <= 0) {
554
+ if (debugLogging && ++debugRenderTick % 90 == 0) {
555
+ synchronized (lock) {
556
+ diag(
557
+ "render.noDraw targetUnix="
558
+ + targetUnix
559
+ + " activeUnix="
560
+ + activeUnix
561
+ + " cached="
562
+ + cache.size()
563
+ + " pendingUploads="
564
+ + pendingGpuQueue.size()
565
+ + " visible="
566
+ + visible
567
+ + " opacity="
568
+ + opacity);
569
+ }
570
+ }
571
+ return;
572
+ }
573
+
574
+ if (debugLogging && debugRenderTick % 180 == 0) {
575
+ diag(
576
+ "render.drawing unix="
577
+ + draw.unix
578
+ + " trueColor="
579
+ + draw.trueColor
580
+ + " indexCount="
581
+ + draw.indexCount);
582
+ }
463
583
 
464
584
  GLES20.glUseProgram(program);
465
585