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
-
photo Validated source image and projection. root Output map directory. sequence Pending photo sequence used for replay protection. resources Serial 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
-
prepared Precomputed colour and weight data for this photo. root Output map directory. sequence Pending photo sequence. resources Desktop 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
-
photo Source pixels, projection, and affected tile bounds. root Tile/state directory. sequence Unique accepted-photo sequence used to prevent duplicate contribution. resources Cooperative CPU/RAM/pause policy. tile_column Independent destination tile column. tile_row Independent 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
-
path Empty 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
-
root Output/checkpoint filesystem path. required Estimated 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
-
root Map output directory. state Durable sequence/bounds checkpoint. resources Cooperative resource policy. max_map_side Explicit 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
-
path Candidate photo. allow_missing Return 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
-
state JPEG 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
-
state JPEG state with the installed mapper error manager. level libjpeg 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] prepared Decoded photo and destination for its contributions. resources Resource 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
-
path procfs status file. wanted Counter 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
-
path Source JPEG path. resources Resource and cancellation policy. camera Camera calibration/profile fields. standard_profile Whether the standard camera profile is active. parallel_decode Whether 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
-
path Input path. maximum Maximum 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
-
clock Clock 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
-
path Directory 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
|
constexpr |
Bound total accepted source photos and the on-disk checkpoint sequence.
Definition at line 108 of file pangea.cpp.
◆ memory_limit
|
constexpr |
Hard virtual-address ceiling prevents OpenCV allocations exceeding the worker budget.
Definition at line 98 of file pangea.cpp.
◆ mib
|
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
|
constexpr |
Radians per degree conversion used by pose and camera rotations.
Definition at line 100 of file pangea.cpp.
◆ projected_pixel_m
|
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
|
constexpr |
Slippy-map tile side length in pixels.
Definition at line 106 of file pangea.cpp.
◆ world_pixels
|
constexpr |
Slippy-map world width at zoom 18: 256 pixels per tile times 2^18 tiles.
Definition at line 102 of file pangea.cpp.