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_detail Namespace Reference

Data Structures

class  DesktopPool
class  Resources
struct  FileCloser
struct  DirectoryCloser
struct  InvalidPhoto
struct  AtomicFile
struct  Bounds
struct  Photo
struct  JpegError
struct  Decoder
struct  Tile
struct  ProjectedTile
struct  ImageFeatures
struct  PreparedPhoto
struct  Encoder
class  Worker

Typedefs

using Json = usher_cv_json::Value
using File = std::unique_ptr<FILE, FileCloser>
using Directory = std::unique_ptr<DIR, DirectoryCloser>

Functions

void stop (int)
void check (bool condition, const char *message)
double seconds (clockid_t clock)
uint64_t proc_kib (const char *path, const char *wanted)
void photo_check (bool condition, const char *message)
File regular_file (const fs::path &path, uint64_t maximum)
void sync_directory (const fs::path &path)
void write_json (const fs::path &path, const Json &value)
Json read_json (const fs::path &path)
std::string digest (const void *data, size_t size)
std::string identity (const fs::path &path, bool allow_missing=false)
std::string exif_text (const exif_view *metadata, exif_directory directory, uint16_t tag)
double numeric (const Json &values, const char *key, double minimum, double maximum)
cv::Matx33d rotation (double roll, double pitch, double yaw)
Json camera_profile (const fs::path &path)
void jpeg_failure (j_common_ptr state)
 Route a libjpeg fatal callback to the active recovery point.
void jpeg_message (j_common_ptr state, int level)
 Screen scan diagnostics before dispatching to libjpeg's usual handler.
Photo read_photo (const fs::path &path, Resources &resources, const Json &camera, bool standard_profile=false, bool parallel_decode=false)
 Admit and decode one source JPEG into a projection-ready photo.
fs::path tile_path (const fs::path &root, int column, int row)
void disk_headroom (const fs::path &root, uint64_t required)
void blend_tile (const Photo &photo, const fs::path &root, uint64_t sequence, Resources &resources, int tile_column, int tile_row)
void blend (const Photo &photo, const fs::path &root, uint64_t sequence, Resources &resources)
 Apply one photo to the tiles enclosed by its footprint.
void prepare_projection (PreparedPhoto &prepared, Resources &resources)
 Stage projected colour and weights without modifying durable tiles.
void blend_prepared (const PreparedPhoto &prepared, const fs::path &root, uint64_t sequence, Resources &resources)
 Commit a prepared photo's contributions to independent tile files.
void export_map (const fs::path &root, const Json &state, Resources &resources, int max_map_side)

Variables

constexpr uint64_t mib = 1024 * 1024
constexpr uint64_t memory_limit = 128 * mib
constexpr double pi = 3.14159265358979323846
constexpr double world_pixels = 256.0 * (1 << 18)
constexpr double projected_pixel_m = 2 * pi * 6378137.0 / world_pixels
constexpr int tile_size = 256
constexpr int max_photos = 10000
std::atomic< sig_atomic_t > stopping {0}
pid_t parent_pid = 0

Detailed Description

Internal worker implementation; keeping the pipeline in one namespace aids code navigation.

Typedef Documentation

◆ Directory

using pangea_detail::Directory = std::unique_ptr<DIR, DirectoryCloser>

Definition at line 503 of file pangea.cpp.

◆ File

using pangea_detail::File = std::unique_ptr<FILE, FileCloser>

Definition at line 496 of file pangea.cpp.

◆ Json

Definition at line 91 of file pangea.cpp.

Function Documentation

◆ blend()

void pangea_detail::blend ( const Photo & photo,
const fs::path & root,
uint64_t sequence,
Resources & resources )

Apply one photo to the tiles enclosed by its footprint.

Parameters
photoValidated source image and projection.
rootOutput map directory.
sequencePending photo sequence used for replay protection.
resourcesSerial or desktop execution policy.

Desktop jobs operate on distinct tile files; onboard processing walks the same tile envelope serially to limit resource use.

Definition at line 1211 of file pangea.cpp.

◆ blend_prepared()

void pangea_detail::blend_prepared ( const PreparedPhoto & prepared,
const fs::path & root,
uint64_t sequence,
Resources & resources )

Commit a prepared photo's contributions to independent tile files.

Parameters
preparedPrecomputed colour and weight data for this photo.
rootOutput map directory.
sequencePending photo sequence.
resourcesDesktop execution policy.

Skip tiles already at this sequence to resume a partially committed photo without double-counting its weights.

Definition at line 1317 of file pangea.cpp.

◆ blend_tile()

void pangea_detail::blend_tile ( const Photo & photo,
const fs::path & root,
uint64_t sequence,
Resources & resources,
int tile_column,
int tile_row )

Blend one validated photo into intersecting tiles, checkpointing each tile atomically.

Parameters
photoSource pixels, projection, and affected tile bounds.
rootTile/state directory.
sequenceUnique accepted-photo sequence used to prevent duplicate contribution.
resourcesCooperative CPU/RAM/pause policy.
tile_columnIndependent destination tile column.
tile_rowIndependent destination tile row.

Definition at line 1139 of file pangea.cpp.

◆ camera_profile()

Json pangea_detail::camera_profile ( const fs::path & path)

Load explicit real-camera intrinsics and mount geometry; reject unknown fields.

Parameters
pathEmpty for MIMIC, otherwise a PANGEA_CAMERA_V1 key=value file.
Returns
Null for MIMIC, validated camera profile for real JPEGs.

Definition at line 691 of file pangea.cpp.

◆ check()

void pangea_detail::check ( bool condition,
const char * message )

Throw a worker-level error that reaches the single CLI diagnostic handler.

Definition at line 120 of file pangea.cpp.

◆ digest()

std::string pangea_detail::digest ( const void * data,
size_t size )

Return lowercase SHA-256 hex for tile payload and source-identity checks.

Definition at line 615 of file pangea.cpp.

◆ disk_headroom()

void pangea_detail::disk_headroom ( const fs::path & root,
uint64_t required )

Retain a 512 MiB filesystem reserve in addition to the next operation estimate.

Parameters
rootOutput/checkpoint filesystem path.
requiredEstimated additional bytes for the pending operation.

Definition at line 1121 of file pangea.cpp.

◆ exif_text()

std::string pangea_detail::exif_text ( const exif_view * metadata,
exif_directory directory,
uint16_t tag )

Read one bounded EXIF text entry without using NUL termination as its length.

Definition at line 650 of file pangea.cpp.

◆ export_map()

void pangea_detail::export_map ( const fs::path & root,
const Json & state,
Resources & resources,
int max_map_side )

Stream the committed tile bounds into a snapshot JPEG, mask, world file, and VRT.

Parameters
rootMap output directory.
stateDurable sequence/bounds checkpoint.
resourcesCooperative resource policy.
max_map_sideExplicit pixel-side ceiling for this invocation.

Definition at line 1362 of file pangea.cpp.

◆ identity()

std::string pangea_detail::identity ( const fs::path & path,
bool allow_missing = false )

Fingerprint a source from stable filesystem identity/metadata for resume validation.

Parameters
pathCandidate photo.
allow_missingReturn empty for a source already removed by its producer.
Returns
SHA-256 identity; content itself is not re-read for every directory scan.

Definition at line 631 of file pangea.cpp.

◆ jpeg_failure()

void pangea_detail::jpeg_failure ( j_common_ptr state)

Route a libjpeg fatal callback to the active recovery point.

Parameters
stateJPEG state whose error manager owns the jump buffer.
Warning
Does not return; recovery must be established before codec calls.

Definition at line 959 of file pangea.cpp.

◆ jpeg_message()

void pangea_detail::jpeg_message ( j_common_ptr state,
int level )

Screen scan diagnostics before dispatching to libjpeg's usual handler.

Parameters
stateJPEG state with the installed mapper error manager.
levellibjpeg message level.

Definition at line 965 of file pangea.cpp.

◆ numeric()

double pangea_detail::numeric ( const Json & values,
const char * key,
double minimum,
double maximum )

Require a finite JSON number within the field's physical or geometric range.

Definition at line 665 of file pangea.cpp.

◆ photo_check()

void pangea_detail::photo_check ( bool condition,
const char * message )

Reject an unusable photo without treating the whole batch as an infrastructure error.

Definition at line 512 of file pangea.cpp.

◆ prepare_projection()

void pangea_detail::prepare_projection ( PreparedPhoto & prepared,
Resources & resources )

Stage projected colour and weights without modifying durable tiles.

Parameters
[in,out]preparedDecoded photo and destination for its contributions.
resourcesResource and cancellation policy.

Reject tiles outside the actual quadrilateral before allocating buffers. Separate projection from commit so photos can be prepared in parallel.

Definition at line 1258 of file pangea.cpp.

◆ proc_kib()

uint64_t pangea_detail::proc_kib ( const char * path,
const char * wanted )

Read one named kB counter from Linux procfs and return bytes.

Parameters
pathprocfs status file.
wantedCounter name including trailing colon.
Returns
Counter in bytes, or zero when unavailable.

Definition at line 137 of file pangea.cpp.

◆ read_json()

Json pangea_detail::read_json ( const fs::path & path)

Read a bounded regular JSON checkpoint. Read a regular JSON state file subject to the 16 KiB input ceiling.

Definition at line 602 of file pangea.cpp.

◆ read_photo()

Photo pangea_detail::read_photo ( const fs::path & path,
Resources & resources,
const Json & camera,
bool standard_profile = false,
bool parallel_decode = false )

Admit and decode one source JPEG into a projection-ready photo.

Parameters
pathSource JPEG path.
resourcesResource and cancellation policy.
cameraCamera calibration/profile fields.
standard_profileWhether the standard camera profile is active.
parallel_decodeWhether to use reusable per-worker decode state.
Returns
Decoded image with its transform and tile footprint.

Reuse decoder storage only within a worker thread; discard that state after fatal libjpeg recovery rather than reusing a failed codec.

Definition at line 990 of file pangea.cpp.

◆ regular_file()

File pangea_detail::regular_file ( const fs::path & path,
uint64_t maximum )

Open a no-follow regular file and enforce its byte ceiling before decoding.

Parameters
pathInput path.
maximumMaximum file size in bytes.
Returns
Owning stream, or throws InvalidPhoto for unsafe/unusable input.

Definition at line 520 of file pangea.cpp.

◆ rotation()

cv::Matx33d pangea_detail::rotation ( double roll,
double pitch,
double yaw )

Compose roll, pitch, and yaw matrices in the aircraft frame's declared order.

Definition at line 677 of file pangea.cpp.

◆ seconds()

double pangea_detail::seconds ( clockid_t clock)

Read one clock as fractional seconds for CPU-duty accounting and deadlines.

Parameters
clockClock identifier.
Returns
Seconds with nanosecond fraction.

Definition at line 127 of file pangea.cpp.

◆ stop()

void pangea_detail::stop ( int )

Signal handler records cancellation; normal code performs checkpoint-safe shutdown.

Definition at line 116 of file pangea.cpp.

◆ sync_directory()

void pangea_detail::sync_directory ( const fs::path & path)

Persist directory-entry changes after atomic checkpoint publication.

Parameters
pathDirectory to synchronize.

Definition at line 538 of file pangea.cpp.

◆ tile_path()

fs::path pangea_detail::tile_path ( const fs::path & root,
int column,
int row )

Return the deterministic checkpoint path for one zoom-18 tile coordinate.

Definition at line 1112 of file pangea.cpp.

◆ write_json()

void pangea_detail::write_json ( const fs::path & path,
const Json & value )

Serialize one JSON checkpoint through AtomicFile rather than truncating live state. Serialize a small state/profile record through atomic, durable file publication.

Definition at line 594 of file pangea.cpp.

Variable Documentation

◆ max_photos

int pangea_detail::max_photos = 10000
constexpr

Bound total accepted source photos and the on-disk checkpoint sequence.

Definition at line 108 of file pangea.cpp.

◆ memory_limit

uint64_t pangea_detail::memory_limit = 128 * mib
constexpr

Hard virtual-address ceiling prevents OpenCV allocations exceeding the worker budget.

Definition at line 98 of file pangea.cpp.

◆ mib

uint64_t pangea_detail::mib = 1024 * 1024
constexpr

Binary-size unit for explicit resident-memory and disk-reserve accounting.

Definition at line 95 of file pangea.cpp.

◆ parent_pid

pid_t pangea_detail::parent_pid = 0

Definition at line 112 of file pangea.cpp.

◆ pi

double pangea_detail::pi = 3.14159265358979323846
constexpr

Radians per degree conversion used by pose and camera rotations.

Definition at line 100 of file pangea.cpp.

◆ projected_pixel_m

double pangea_detail::projected_pixel_m = 2 * pi * 6378137.0 / world_pixels
constexpr

Web-Mercator ground resolution scale at the equator for this zoom level.

Definition at line 104 of file pangea.cpp.

◆ stopping

std::atomic<sig_atomic_t> pangea_detail::stopping {0}

Definition at line 109 of file pangea.cpp.

◆ tile_size

int pangea_detail::tile_size = 256
constexpr

Slippy-map tile side length in pixels.

Definition at line 106 of file pangea.cpp.

◆ world_pixels

double pangea_detail::world_pixels = 256.0 * (1 << 18)
constexpr

Slippy-map world width at zoom 18: 256 pixels per tile times 2^18 tiles.

Definition at line 102 of file pangea.cpp.