Illustrated C/C++ source sheets, symbol index, API relationship graph, compiler console and debug trace

LIVE AI / FLEXIBLE SENSING / FLIGHT CONTEXT

Sensoraia API

Live AI and sensing, connected to the flight.
See, listen, inspect and return supported results while airborne.

Loading...
Searching...
No Matches
pangea_survey::PhotoExif Class Reference

Build bounded EXIF payloads for simulator-generated source photos. More...

#include <photo_exif.h>

Inheritance diagram for pangea_survey::PhotoExif:
Collaboration diagram for pangea_survey::PhotoExif:

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()

Payload pangea_survey::PhotoExif::build ( const PhotoPosition & position,
int width,
int height,
const std::optional< PhotoCamera > & camera = {} )
inline

Construct EXIF from validated photo position and optional camera evidence.

Parameters
[in]positionWGS-84 position with camera/ground AMSL heights in metres.
[in]widthEncoded image width in pixels.
[in]heightEncoded image height in pixels.
[in]cameraOptional pose, optics, UTC-readback, and map provenance.
Returns
Serialized EXIF payload borrowed from this object.
Exceptions
std::runtime_errorIf coordinates, optics, timestamps, or payload size violate the supported metadata contract.

Definition at line 194 of file photo_exif.h.

◆ captureTime()

void pangea_survey::PhotoExif::captureTime ( const PhotoCamera & camera)
inlineprotected

Write simulator-observed UTC into consistent EXIF and GPS fields.

Parameters
cameraCapture metadata with its optional UTC field engaged.
Exceptions
std::runtime_errorIf 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()

void pangea_survey::PhotoExif::check ( int result,
const char * operation )
inlinestaticprotected

Convert a C EXIF status into the mapper's error path.

Parameters
resultZero on success, nonzero on failure.
operationContext for the error.
Exceptions
std::runtime_errorWith the current errno diagnostic on failure.

Definition at line 100 of file photo_exif.h.

◆ coordinate()

void pangea_survey::PhotoExif::coordinate ( double degrees,
std::uint16_t referenceTag,
std::uint16_t valueTag,
char positive,
char negative )
inlineprotected

Encode a validated geographic coordinate as EXIF GPS rationals.

Parameters
degreesSigned decimal degrees.
referenceTagHemisphere tag ID.
valueTagDegrees/minutes/seconds tag ID.
positiveHemisphere for a nonnegative coordinate.
negativeHemisphere for a negative coordinate.
Exceptions
std::runtime_errorIf 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()

std::string pangea_survey::PhotoExif::jsonString ( const std::string & text)
inlinestatic

Escape a string as a JSON string literal.

Parameters
[in]textUTF-8 byte string without control characters.
Returns
Quoted JSON string value.
Exceptions
std::runtime_errorIf the input contains a control character.

Definition at line 456 of file photo_exif.h.

◆ reserve()

unsigned char * pangea_survey::PhotoExif::reserve ( exif_directory directory,
std::uint16_t tag,
exif_format format,
std::uint32_t count )
inlineprotected

Allocate one field in the bounded EXIF document.

Parameters
directoryTarget EXIF directory.
tagNumeric field identifier.
formatElement encoding.
countNumber of elements, not the byte count.
Returns
Borrowed writable field storage.
Exceptions
std::runtime_errorIf the document cannot reserve the field.

Definition at line 112 of file photo_exif.h.

Field Documentation

◆ document_

exif_document pangea_survey::PhotoExif::document_ {}
protected

Definition at line 93 of file photo_exif.h.

◆ payload_

std::array<unsigned char, EXIF_MAX_PAYLOAD> pangea_survey::PhotoExif::payload_ {}
protected

Definition at line 94 of file photo_exif.h.


The documentation for this class was generated from the following file: