Flight, timing, and thermal-analysis metadata writing for captured JPEGs. More...
#include "usher_protocol.h"#include "capture_timing.h"#include "exifite.h"#include "sensor_capture.h"#include "../modules/loom_cam/loom_features.h"

Go to the source code of this file.
Macros | |
| #define | IMAGE_EXIF_ATOMIC_REPLACE 0 |
| Select sibling-file atomic replacement instead of the default in-place update. | |
Functions | |
| static bool | image_exif_capture_tag (void *context, enum exif_directory directory, uint16_t tag) |
| Select additional image evidence, without teaching EXIFite its schemas. | |
| static int | image_exif_import (struct exif_document *document, const struct exif_view *view) |
| Import standard metadata plus the application's approved capture evidence. | |
| int | image_exif_write (const char *filename, const union dc_shot_union *shot) |
| Add standard USHER flight metadata to a JPEG. | |
| int | image_exif_write_timed (const char *filename, const union dc_shot_union *shot, double capture_delay_s, int compensate) |
| Add flight metadata with optional capture-delay motion compensation. | |
| int | image_exif_write_hotspots (const char *filename, const char *information) |
| Append structured thermal hotspot/geolocation evidence to JPEG EXIF. | |
| int | image_exif_write_object_detections (const char *filename, const char *information) |
| Append structured object-detection evidence (AICam) to JPEG EXIF. | |
| int | image_exif_write_mock_map (const char *filename, double horizontal_fov, double vertical_fov) |
| Label a synthetic map fixture with its geometry and provider-neutral XYZ tile scheme. | |
| int | image_exif_write_capture (const char *filename, const union dc_shot_union *shot, double capture_delay_s, int compensate, const struct capture_timing *timing) |
| Add flight metadata using authoritative capture timing when available. | |
| int | image_exif_write_complete (const char *filename, const union dc_shot_union *shot, double delay, int compensate, const struct capture_timing *timing, const union dc_shot_union *request, double uncertainty_m, const char *objects) |
| Write flight provenance and an available object-detection result in one metadata transaction. | |
Variables | |
| static const uint16_t | image_exif_capture_tags [] = {SENSOR_CAPTURE_TAG, LOOM_FEATURES_TAG, LOOM_ONNX_FEATURES_TAG} |
| Application-owned opaque evidence retained by photo metadata updates. | |
Detailed Description
Flight, timing, and thermal-analysis metadata writing for captured JPEGs.
Definition in file image_exif.h.
Macro Definition Documentation
◆ IMAGE_EXIF_ATOMIC_REPLACE
| #define IMAGE_EXIF_ATOMIC_REPLACE 0 |
Select sibling-file atomic replacement instead of the default in-place update.
Set to 1 for original-file retention on publication failure. The default 0 avoids temporary files but cannot recover from interrupted block moves or writes. Both methods validate JPEG framing, retain compressed bytes and sync the result. The caller must exclusively own updates to the file and its hard-linked aliases.
Definition at line 70 of file image_exif.h.
Function Documentation
◆ image_exif_capture_tag()
|
inlinestatic |
Select additional image evidence, without teaching EXIFite its schemas.
- Parameters
-
context Unused; the application policy needs no mutable state. directory Directory containing the field. tag Directory-local identifier owned by the producing module.
- Returns
- True only for the application's relocatable camera evidence records.
Definition at line 42 of file image_exif.h.
◆ image_exif_import()
|
inlinestatic |
Import standard metadata plus the application's approved capture evidence.
- Parameters
-
document Caller-owned bounded destination. view Validated source with nonoverlapping backing storage.
- Returns
- Zero on success, otherwise -1 with EXIFite's import rollback rules.
A small inline policy wrapper keeps standalone image tools independent of the flight writer's workspaces. Unknown vendor structures remain excluded.
Definition at line 58 of file image_exif.h.
◆ image_exif_write()
| int image_exif_write | ( | const char * | filename, |
| const union dc_shot_union * | shot ) |
Add standard USHER flight metadata to a JPEG.
- Parameters
-
filename Existing JPEG to update using the selected publication method. shot Flight-controller shot payload.
- Returns
- 0 on success or -1 on invalid input, JPEG, metadata, or storage failure.
Fresh capture writes replace prior camera EXIF with supported USHER metadata while preserving supported raw capture/LOOM evidence. Thumbnail and manufacturer records are deliberately discarded.
Definition at line 408 of file image_exif.c.
◆ image_exif_write_capture()
| int image_exif_write_capture | ( | const char * | filename, |
| const union dc_shot_union * | shot, | ||
| double | capture_delay_s, | ||
| int | compensate, | ||
| const struct capture_timing * | timing ) |
Add flight metadata using authoritative capture timing when available.
- Parameters
-
filename Existing JPEG to update using the selected publication method. shot Flight-controller shot payload. capture_delay_s Fallback latency when timingis absent or invalid.compensate Nonzero to apply conservative constant-velocity ground correction. timing Optional validated server timing evidence; it overrides a supplied delay.
Timing describes request-to-frame arrival, not sensor exposure time; the emitted metadata labels this limitation explicitly.
Definition at line 419 of file image_exif.c.
◆ image_exif_write_complete()
| int image_exif_write_complete | ( | const char * | filename, |
| const union dc_shot_union * | shot, | ||
| double | delay, | ||
| int | compensate, | ||
| const struct capture_timing * | timing, | ||
| const union dc_shot_union * | request, | ||
| double | uncertainty_m, | ||
| const char * | objects ) |
Write flight provenance and an available object-detection result in one metadata transaction.
- Parameters
-
filename Existing JPEG; the caller exclusively owns metadata updates to this path. shot Pose used for geotags, already exposure-aligned when request is supplied. delay Fallback request-to-arrival latency in seconds; negative means unknown. compensate Nonzero enables the legacy position estimate; use zero for exposure-aligned pose. timing Optional arrival evidence and shared bounded observation-time pose. request Original FC request to preserve alongside an aligned pose, or NULL. uncertainty_m Nonnegative ground-position margin recorded when request is supplied. objects Optional already-produced object summary, or NULL; no inference runs here.
- Returns
- Zero on publication, -1 on invalid metadata, JPEG or storage failure.
Compressed image data is copied, not decoded/re-encoded. Combining tags avoids a second full-file rewrite but does not remove the camera's original JPEG write. Validate frame identity before calling. In-place updates retain the inode; optional atomic replacement changes it. In-place I/O failures can damage the file.
Definition at line 473 of file image_exif.c.
◆ image_exif_write_hotspots()
| int image_exif_write_hotspots | ( | const char * | filename, |
| const char * | information ) |
Append structured thermal hotspot/geolocation evidence to JPEG EXIF.
- Parameters
-
filename Existing JPEG. information Bounded UTF-8/ASCII analysis record.
- Returns
- 0 on metadata update success, otherwise -1.
Definition at line 372 of file image_exif.c.
◆ image_exif_write_mock_map()
| int image_exif_write_mock_map | ( | const char * | filename, |
| double | horizontal_fov, | ||
| double | vertical_fov ) |
Label a synthetic map fixture with its geometry and provider-neutral XYZ tile scheme.
- Parameters
-
filename Existing mock JPEG. horizontal_fov Horizontal field of view in degrees, strictly between 0 and 179. vertical_fov Vertical field of view in degrees, strictly between 0 and 179.
- Returns
- Zero on metadata update success, otherwise -1.
Writes Sensoraia-owned geometry only; it does not write a tile-provider attribution.
Definition at line 382 of file image_exif.c.
◆ image_exif_write_object_detections()
| int image_exif_write_object_detections | ( | const char * | filename, |
| const char * | information ) |
Append structured object-detection evidence (AICam) to JPEG EXIF.
- Parameters
-
filename Existing JPEG. information Bounded UTF-8/ASCII analysis record.
- Returns
- 0 on metadata update success, otherwise -1.
Definition at line 377 of file image_exif.c.
◆ image_exif_write_timed()
| int image_exif_write_timed | ( | const char * | filename, |
| const union dc_shot_union * | shot, | ||
| double | capture_delay_s, | ||
| int | compensate ) |
Add flight metadata with optional capture-delay motion compensation.
- Parameters
-
filename Existing JPEG to update using the selected publication method. shot Flight-controller shot payload. capture_delay_s Nonnegative request-to-frame latency, or a negative value when unknown. compensate Nonzero to estimate ground displacement from speed/course and latency.
Original coordinates remain in the textual record so downstream analysis can audit the correction rather than treating the constant-velocity estimate as ground truth.
Definition at line 413 of file image_exif.c.
Variable Documentation
◆ image_exif_capture_tags
|
static |
Application-owned opaque evidence retained by photo metadata updates.
Definition at line 35 of file image_exif.h.