Build bounded EXIF payloads for simulator-generated source photos. More...
#include <photo_exif.h>


Data Structures | |
| struct | Payload |
| Borrowed serialized EXIF bytes held in this object's workspace. More... | |
Public Member Functions | |
| Payload | build (const PhotoPosition &position, int width, int height, const std::optional< PhotoCamera > &camera={}) |
| Construct EXIF from validated photo position and optional camera evidence. | |
Static Public Member Functions | |
| static std::string | jsonString (const std::string &text) |
| Escape a string as a JSON string literal. | |
Protected Member Functions | |
| unsigned char * | reserve (exif_directory directory, std::uint16_t tag, exif_format format, std::uint32_t count) |
| Allocate one field in the bounded EXIF document. | |
| void | coordinate (double degrees, std::uint16_t referenceTag, std::uint16_t valueTag, char positive, char negative) |
| Encode a validated geographic coordinate as EXIF GPS rationals. | |
| void | captureTime (const PhotoCamera &camera) |
| Write simulator-observed UTC into consistent EXIF and GPS fields. | |
Static Protected Member Functions | |
| static void | check (int result, const char *operation) |
| Convert a C EXIF status into the mapper's error path. | |
Protected Attributes | |
| exif_document | document_ {} |
| std::array< unsigned char, EXIF_MAX_PAYLOAD > | payload_ {} |
Detailed Description
Build bounded EXIF payloads for simulator-generated source photos.
The output buffer is owned by this object and is replaced by each call to build. Callers must consume or copy the payload before building another record with the same instance.
Definition at line 91 of file photo_exif.h.
Member Function Documentation
◆ build()
|
inline |
Construct EXIF from validated photo position and optional camera evidence.
- Parameters
-
[in] position WGS-84 position with camera/ground AMSL heights in metres. [in] width Encoded image width in pixels. [in] height Encoded image height in pixels. [in] camera Optional pose, optics, UTC-readback, and map provenance.
- Returns
- Serialized EXIF payload borrowed from this object.
- Exceptions
-
std::runtime_error If coordinates, optics, timestamps, or payload size violate the supported metadata contract.
Definition at line 194 of file photo_exif.h.
◆ captureTime()
|
inlineprotected |
Write simulator-observed UTC into consistent EXIF and GPS fields.
- Parameters
-
camera Capture metadata with its optional UTC field engaged.
- Exceptions
-
std::runtime_error If the time sample is unqualified or a tag cannot be written.
Check frame/readback timing before publishing a wall-clock label. Derive both tag families from the same UTC sample.
Definition at line 146 of file photo_exif.h.
◆ check()
|
inlinestaticprotected |
Convert a C EXIF status into the mapper's error path.
- Parameters
-
result Zero on success, nonzero on failure. operation Context for the error.
- Exceptions
-
std::runtime_error With the current errno diagnostic on failure.
Definition at line 100 of file photo_exif.h.
◆ coordinate()
|
inlineprotected |
Encode a validated geographic coordinate as EXIF GPS rationals.
- Parameters
-
degrees Signed decimal degrees. referenceTag Hemisphere tag ID. valueTag Degrees/minutes/seconds tag ID. positive Hemisphere for a nonnegative coordinate. negative Hemisphere for a negative coordinate.
- Exceptions
-
std::runtime_error If either tag cannot be stored.
Round the total once so overflow from the fractional second carries naturally into minutes and degrees.
Definition at line 127 of file photo_exif.h.
◆ jsonString()
|
inlinestatic |
Escape a string as a JSON string literal.
- Parameters
-
[in] text UTF-8 byte string without control characters.
- Returns
- Quoted JSON string value.
- Exceptions
-
std::runtime_error If the input contains a control character.
Definition at line 456 of file photo_exif.h.
◆ reserve()
|
inlineprotected |
Allocate one field in the bounded EXIF document.
- Parameters
-
directory Target EXIF directory. tag Numeric field identifier. format Element encoding. count Number of elements, not the byte count.
- Returns
- Borrowed writable field storage.
- Exceptions
-
std::runtime_error If the document cannot reserve the field.
Definition at line 112 of file photo_exif.h.
Field Documentation
◆ document_
|
protected |
Definition at line 93 of file photo_exif.h.
◆ payload_
|
protected |
Definition at line 94 of file photo_exif.h.
The documentation for this class was generated from the following file:
- modules/pangea/photo_exif.h