Optional development replay adapter, independent of geographic analysis. More...
#include <stdbool.h>

Go to the source code of this file.
Functions | |
| int | lwir_process_mock (const char *input_path, const char *output_path, bool layer_only) |
| Preserve embedded temperatures or attach explicitly synthetic evidence. | |
Detailed Description
Optional development replay adapter, independent of geographic analysis.
Built only with LWIR_ENABLE_MOCK. Turns an ordinary JPEG into LWIR evidence for tests and demos: an existing temperature layer is preserved, otherwise temperatures are synthesized from luminance and tagged LWIRSIM1.
Definition in file lwir_mock.h.
Function Documentation
◆ lwir_process_mock()
| int lwir_process_mock | ( | const char * | input_path, |
| const char * | output_path, | ||
| bool | layer_only ) |
Preserve embedded temperatures or attach explicitly synthetic evidence.
- Parameters
-
input_path Regular source JPEG. output_path Destination; existing unrelated files are never overwritten. layer_only Attach evidence without recompressing display pixels.
- Returns
- Zero on success, otherwise -1.
Serial worker adapter. Synthesized temperatures cannot represent a physical measurement and never inherit live device-state provenance. The result is published atomically (link or same-inode rename) and the directory is fsynced; the source must stay unchanged during processing.
- Note
- With
layer_onlyand a source that already holds a temperature layer, nothing is written and 0 is returned, even whenoutput_pathdiffers.
- Warning
- Uses one static workspace; not reentrant or thread-safe.
Preserve embedded temperatures or attach explicitly synthetic evidence.
- Returns
- 0 on success, -1 on any failure.
Steps: open and identify the source; read any embedded layer; decode if needed; write a mode-matched temporary file next to the output; check that the source did not change meanwhile; publish with link() (fails if the name exists) or, in place, rename() after confirming the path still names the same inode; finally fsync the directory.
- Warning
- -1 is also returned if only the final directory fsync fails, after the file has already been published.
Definition at line 208 of file lwir_mock.c.