Configuration API
Source headers: raptor/Config.hpp
raptor
Types
| Name | Description |
|---|---|
| Config | Configuration parameters for the Raptor SDK. |
| ConfigParseError | Error codes for configuration parsing. |
| ConfigParseFailure | Detailed configuration parsing failure. |
| CpuBudget | Logical CPUs the SDK's threads may run on. |
| GpuPriority | Priority of the SDK's GPU work relative to other processes. |
| LogLevel | Log severity levels. |
| LogMessage | A formatted log message delivered to a custom log callback. |
| Logger | Logger configuration. |
| MemoryBudget | Memory headroom reserved outside the SDK's map-data caches. |
Type Aliases
| Name | Description |
|---|---|
| LogCallback | Signature of a custom log callback. |
Functions
| Name | Description |
|---|---|
| parseConfigFromJson | Parse a Config object from a JSON file. |
Type Alias Details
LogCallback
using LogCallback = std::function<void(const LogMessage&)>
Signature of a custom log callback.
The callback may be invoked from any thread and must be thread-safe. Any state captured by the callback must also be safe to access concurrently for the lifetime of the Context that owns it.
Function Details
parseConfigFromJson
std::variant<Config, ConfigParseFailure> parseConfigFromJson( const std::string& filePath)
Parse a Config object from a JSON file
Reads a JSON configuration file and parses it into a Config struct. The JSON file should contain the following fields:
{
"licensePath": "/path/to/license", // REQUIRED
"mapPaths": [ // REQUIRED
"/path/to/map1.3dtiles.zip",
"/path/to/map2.3dtiles.zip"
],
"detailStage1": 8, // Optional, default: 8
"detailStage2": 9, // Optional, default: 9
"coordinateEpoch": 2025.0, // Optional, default: None
"geoResourcePath": "/path/to/geo", // Optional, default: ""
"logger": { // Optional
"name": "Raptor", // Optional, default: "Raptor"
"level": "Info" // Optional, default: "Info"
},
"memoryBudget": { // Optional
"gpuReserveBytes": 268435456, // Optional, default: 256 MiB
"hostReserveBytes": 1073741824 // Optional, default: 1 GiB
},
"cpuBudget": { // Optional
"maxCount": 4, // Optional, default: 0 (all)
"allowed": [0, 1, 2, 3] // Optional, default: [] (all)
},
"gpuPriority": "High" // Optional, default: "Medium"
}
The accepted "logger.level" values are the names of LogLevel (case-insensitive): "Trace", "Debug", "Info", "Warning", "Error", "Critical", "Off". The accepted "gpuPriority" values are the names of GpuPriority (case-insensitive): "Low", "Medium", "High", "Realtime". A custom log callback cannot be expressed in JSON and must be set programmatically after parsing.
Parameters:
filePath- Path to the JSON configuration file
Returns: std::variant containing either a parsed Config object or a ConfigParseFailure
auto result = raptor::parseConfigFromJson("config.json");
if (std::holds_alternative<raptor::Config>(result)) {
const auto& config = std::get<raptor::Config>(result);
raptor::Context context{config};
} else {
const auto& failure = std::get<raptor::ConfigParseFailure>(result);
std::cerr << "Failed to load config: error code "
<< static_cast<int>(failure.error)
<< " at field '" << failure.field << "': " << failure.detail << std::endl;
}
raptor::Config
struct Config
Configuration parameters for the Raptor SDK Context.
Passed to the Context constructor to control SDK-wide initialization. All fields have sensible defaults; populate only what you need to override.
Variables
| Name | Description |
|---|---|
| geoResourcePath | Path to geo resources. |
| logger | Logger configuration. |
| imageWidth | Width of input images in pixels. |
| imageHeight | Height of input images in pixels. |
| licensePath | Path to license file (REQUIRED). |
| mapPaths | Paths to 3D map files (REQUIRED). |
| detailStage1 | Level of detail of matching. |
| detailStage2 | Level of detail of matching. |
| coordinateEpoch | Coordinate epoch for tectonic plate correction (optional). |
| memoryBudget | Memory budget configuration. |
| cpuBudget | CPU budget configuration. |
| gpuPriority | Priority of the SDK's GPU work relative to other processes. |
Variable Details
coordinateEpoch
std::optional<float> coordinateEpoch
Coordinate epoch for tectonic plate correction (optional)
Enables correction for tectonic plate movement between epoch of reference map and epoch of mission, improving accuracy for high-precision applications. Uses GSRM2.1 model for tectonic plate movement.
Year as decimal number (e.g., 2025.0 for January 1st, 2025). We do not recommend specifying more than two decimal places (e.g., 2025.83).
The epoch should match the mission epoch (i.e., today's date for real-time, recording date for post-processing).
Models average, long-term plate movement only (GSRM2.1). Does NOT model deformation in zones along tectonic plate borders, compensate for sudden shifts (earthquakes, landslides), or account for local subsidence/uplift from other geological processes.
If not provided, no tectonic correction is applied.
cpuBudget
CpuBudget cpuBudget
CPU budget configuration.
detailStage1
std::uint32_t detailStage1
Level of detail of matching.
Higher values = more accurate but slower processing. Recommended values: 7-8
Values >= 32 will cause overflow - validated at runtime
detailStage2
std::uint32_t detailStage2
Level of detail of matching.
Should be >= detailStage1 for best results. Recommended values: 8-9
Values >= 32 will cause overflow - validated at runtime
geoResourcePath
std::string geoResourcePath
Path to geo resources.
Resolved in the following order of precedence:
- Explicit value - If
geoResourcePathis non-empty, it is used directly - RAPTOR_GEO_RESOURCE_PATH - Environment variable pointing to geo resources directory
- RAPTOR_DATA_DIR - Environment variable pointing to data directory.
Geo resources are expected at
$RAPTOR_DATA_DIR/resources/geo - System default paths - Searched in order until a compatible path is found:
Linux/Unix Default Paths:
data/resources/geo(relative to runtime location)/usr/local/share/raptor/data/resources/geo/usr/share/raptor/data/resources/geo/opt/raptor/share/raptor/data/resources/geo
An invalid path causes Context construction to throw with configuration guidance.
gpuPriority
GpuPriority gpuPriority
Priority of the SDK's GPU work relative to other processes.
Applied when the Context is created. See GpuPriority.
Default: GpuPriority::Medium.
imageHeight
std::int32_t imageHeight
Height of input images in pixels
DEPRECATED: Will be removed in the next major release.
imageWidth
std::int32_t imageWidth
Width of input images in pixels
DEPRECATED: Will be removed in the next major release.
licensePath
std::string licensePath
Path to license file (REQUIRED)
Must point to a readable Raptor license file.
logger
Logger logger
Logger configuration.
mapPaths
std::vector<std::string> mapPaths
Paths to 3D map files (REQUIRED)
Vector of paths to 3D map files (.r3db, .3tz, or .3dtiles.zip format). At least one map is required. Maps should cover your area of interest.
Rendering priority is given to maps with a lower index in the vector, so if the same area is covered by multiple maps, the first in the list will be drawn. Maps with a higher index are still drawn wherever no lower-indexed map has data, including directly adjacent to it.
Where maps meet, differences in texture and geometry can produce visible seams or steps along the border.
memoryBudget
MemoryBudget memoryBudget
Memory budget configuration.
raptor::ConfigParseError
enum class ConfigParseError : std::uint8_t
Error codes for configuration parsing
Describes different errors that may occur when parsing a configuration file.
FileNotFound : Failed to open the configuration file
InvalidJson : JSON parsing failed (malformed JSON)
NotAnObject : Root element is not a JSON object
MissingRequiredField : Required field is missing
InvalidType : Field has invalid type (e.g., expected string but got number)
InvalidValue : Field has invalid value (e.g., enum value not recognized)
raptor::ConfigParseFailure
struct ConfigParseFailure
Detailed configuration parsing failure.
Returned in place of a Config when parseConfigFromJson() fails. Carries the error category along with location information so callers can render actionable diagnostics.
Variables
| Name | Description |
|---|---|
| error | Category of the failure. |
| field | Path of the offending field in the JSON document. |
| detail | Human-readable contextual detail. |
| offset | 0-based byte offset within the JSON content where the error was detected. |
| line | 1-based line number derived from the byte offset. |
Variable Details
detail
std::string detail
Human-readable contextual detail.
For InvalidType: the expected type (e.g. "string", "unsigned integer"). For InvalidJson: the parser error description. Empty if no further context is available.
error
ConfigParseError error
Category of the failure.
field
std::string field
Path of the offending field in the JSON document.
Examples: "licensePath", "mapPaths", "mapPaths[2]". Empty for file-level (FileNotFound) and document-level (InvalidJson, NotAnObject) errors that cannot be attributed to a specific field.
line
std::optional<std::size_t> line
1-based line number derived from the byte offset.
Populated for InvalidJson; empty otherwise.
offset
std::optional<std::size_t> offset
0-based byte offset within the JSON content where the error was detected.
Populated for InvalidJson; empty otherwise.
raptor::CpuBudget
struct CpuBudget
Logical CPUs the SDK's threads may run on.
Restricts the threads the SDK starts to CPUs chosen, when the Context is created, from those available to the thread creating it. Application threads are not affected. Depending on the system, threads started by the GPU driver may not be restricted.
Variables
| Name | Description |
|---|---|
| allowed | Maximum number of logical CPUs to use, preferring separate physical cores and faster cores. |
Variable Details
allowed
std::vector<std::uint32_t> allowed
Maximum number of logical CPUs to use, preferring separate physical cores and faster cores. 0 uses all available ones.
Default: 0. Logical CPU indices to use. Empty uses all available ones.
Context construction throws std::runtime_error if any is not available.
Default: empty.
raptor::GpuPriority
enum class GpuPriority : std::uint8_t
Priority of the SDK's GPU work relative to other processes.
Decides how the GPU is shared between the SDK and other processes using the same GPU. While the GPU is congested, the driver tries to give more of it to higher-priority work; this is not a guarantee. Levels other than Medium require a GPU driver with Vulkan global priority support (VK_KHR_global_priority or VK_EXT_global_priority). The Vulkan requirements documentation shows how to check for it.
Priorities above Medium usually require elevated privileges. If the requested priority cannot be used, the SDK logs a warning and runs at Medium.
Low = 0 : Low priority.
Medium = 1 : Medium priority. This is the default.
High = 2 : High priority. Usually requires elevated privileges.
Realtime = 3 : Highest priority. Usually requires elevated privileges.
raptor::LogLevel
enum class LogLevel : std::uint8_t
Log severity levels.
Levels are ordered from least to most severe. Setting a minimum log level will enable that level and all higher levels.
The uppercase names (TRACE, DEBUG, INFO, WARNING, ERROR, CRITICAL, OFF) are deprecated aliases of the names above. They are not available on Windows or when RAPTOR_LOGGING_LEVEL_LEAN is defined, and may be removed in a future release.
Trace = 0 : Detailed trace information.
Debug = 1 : Debug information.
Info = 2 : Informational messages (default level).
Warning = 3 : Warning messages.
Error = 4 : Error messages.
Critical = 5 : Critical error messages.
Off = 6 : Disable all logging.
TRACE = Trace
: Deprecated, use Trace instead. Detailed trace information.
DEBUG = Debug
: Deprecated, use Debug instead. Debug information.
INFO = Info
: Deprecated, use Info instead. Informational messages (default level).
WARNING = Warning
: Deprecated, use Warning instead. Warning messages.
ERROR = Error
: Deprecated, use Error instead. Error messages.
CRITICAL = Critical
: Deprecated, use Critical instead. Critical error messages.
OFF = Off
: Deprecated, use Off instead. Disable all logging.
raptor::LogMessage
struct LogMessage
A formatted log message delivered to a custom log callback.
Variables
| Name | Description |
|---|---|
| level | Severity level of the message. |
| timestamp | Timestamp in nanoseconds since epoch. |
| imageTimestamp | Timestamp of the image associated with the message, if any. |
| message | Formatted message string. |
| name | Logger name. |
Variable Details
imageTimestamp
std::optional<std::chrono::nanoseconds> imageTimestamp
Timestamp of the image associated with the message, if any
level
LogLevel level
Severity level of the message
message
std::string message
Formatted message string
name
std::string name
Logger name
timestamp
std::chrono::nanoseconds timestamp
Timestamp in nanoseconds since epoch
raptor::Logger
struct Logger
Logger configuration.
Variables
| Name | Description |
|---|---|
| name | Name used for the logger. |
| level | Log level. |
| callback | Optional custom log callback. |
Variable Details
callback
LogCallback callback
Optional custom log callback.
The callback may be invoked from any thread and must be thread-safe. If left null, formatted messages are written to stdout.
level
LogLevel level
Log level.
Messages below this level are not logged.
name
std::string name
Name used for the logger.
Surfaced as the name field on every LogMessage delivered to a
custom log callback.
raptor::MemoryBudget
struct MemoryBudget
Memory headroom reserved outside the SDK's map-data caches.
These values are reserve targets, not maximum cache sizes. The SDK derives cache capacity from the reported memory budget, these reserves, and memory used by other consumers. They do not bound the SDK's total memory use.
Variables
| Name | Description |
|---|---|
| gpuReserveBytes | Target GPU (device-local) memory kept available outside the map cache, in bytes. |
| hostReserveBytes | Target host memory kept available outside the map cache, in bytes. |
Variable Details
gpuReserveBytes
std::size_t gpuReserveBytes
Target GPU (device-local) memory kept available outside the map cache, in bytes.
The SDK monitors total device-local memory usage and evicts cached map tiles when the reported free budget falls below this target. This is therefore not a maximum map-cache size; the cache capacity varies with other GPU memory use.
The effective reserve is capped at half the reported device-local budget, so an oversized value cannot prohibit all device-local usage. It is checked once per frame, so transient usage may enter the reserve.
Default: 256 MiB (268435456 bytes).
hostReserveBytes
std::size_t hostReserveBytes
Target host memory kept available outside the map cache, in bytes.
The SDK dynamically sizes the host-side map cache to leave this amount available under the machine's memory limit, or the process's cgroup limit where one applies. Memory used by the process outside the map cache is accounted for separately. This is therefore not a maximum map-cache size.
The budget is revised once per frame, so decoding and other transient allocations may enter the reserve. If the platform reports no host memory availability, this setting has no effect.
Default: 1 GiB (1073741824 bytes).