|
Lightgraph
C++17 light-graph engine API reference
|
This document describes the supported public API in include/lightgraph/.
Compatibility and deprecation guarantees for this API are defined in docs/API_POLICY.md.
The umbrella header re-exports stable installable API headers:
lightgraph/engine.hpplightgraph/types.hpplightgraph/status.hpplightgraph/version.hppBuilt-in object selection enum:
Heptagon919Heptagon3024LineCrossTriangleEngine configuration fields:
object_typepixel_count (0 uses object default)auto_emitValue command for one emit request.
Key fields:
model, speed, length, trail, colornote_id, min_brightness, max_brightnessbehaviour_flags, emit_groups, emit_offsetduration_ms, from, linkedTyped error and result model used by Engine.
Version and deprecation surface:
LIGHTGRAPH_VERSION_MAJORLIGHTGRAPH_VERSION_MINORLIGHTGRAPH_VERSION_PATCHLIGHTGRAPH_VERSION_STRINGLIGHTGRAPH_DEPRECATED("message")Thread-safe runtime facade:
Result<int8_t> emit(const EmitCommand&)void update(uint64_t millis)void tick(uint64_t delta_millis)void stopAll()bool isOn() const, void setOn(bool)bool autoEmitEnabled() const, void setAutoEmitEnabled(bool)uint16_t pixelCount() constResult<Color> pixel(uint16_t index, uint8_t max_brightness = 255) constlightgraph::Engine is safe for concurrent calls on the same instance.emit/update/tick/pixel/... on one instance.lightgraph::integration::*) are not thread-safe by default.std::rand seed (std::srand(...)), lightgraph::Engine emits deterministic output.std::rand global-state behavior.Engine::pixelCount(): O(1)Engine::pixel(index): O(1)Engine::emit(...): O(MAX_LIGHT_LISTS + G) where G is grouped emitter lookup work.Engine::update(...) / Engine::tick(...): O(P + L) where P is pixel count and L is active runtime light count.Engine::stopAll(): O(MAX_LIGHT_LISTS)These headers expose broader topology/runtime/rendering integration types used by MeshLED. They are source-level integration headers and are not part of the installable stable package contract.
Primary integration umbrella:
For CMake source-tree consumers, link the dedicated target:
Namespace aliases:
lightgraph::integration::Object (TopologyObject)lightgraph::integration::Intersectionlightgraph::integration::Connectionlightgraph::integration::Modellightgraph::integration::Ownerlightgraph::integration::Port, lightgraph::integration::InternalPort, lightgraph::integration::ExternalPortlightgraph::integration::WeightNamespace aliases:
lightgraph::integration::EmitParamlightgraph::integration::EmitParamslightgraph::integration::Behaviourlightgraph::integration::RuntimeLightlightgraph::integration::Lightlightgraph::integration::LightListlightgraph::integration::BgLightlightgraph::integration::RuntimeStateNamespace aliases/helpers:
lightgraph::integration::Palettelightgraph::integration::kWrapNoWraplightgraph::integration::kWrapClampToEdgelightgraph::integration::kWrapRepeatlightgraph::integration::kWrapRepeatMirrorlightgraph::integration::paletteCount()lightgraph::integration::paletteAt(index)Namespace aliases/constants:
lightgraph::integration::Heptagon919, lightgraph::integration::Heptagon3024, lightgraph::integration::Line, lightgraph::integration::Cross, lightgraph::integration::TrianglekLinePixelCount, etc.)lightgraph::integration::BuiltinObjectTypelightgraph::integration::makeObject(...)LG_LOG*, LG_RANDOM, LG_STRING)lightgraph::integration::kPredefinedPaletteNameslightgraph::integration::predefinedPaletteNameCount()lightgraph::integration::predefinedPaletteNameAt(index)lightgraph::integration::AllocationFailureSitelightgraph::integration::AllocationFailureObserverlightgraph::integration::setAllocationFailureObserver(...)lightgraph::integration::reportAllocationFailure(...)lightgraph::integration::remote_snapshot for remote snapshot descriptors/buildersparseTopologySnapshotFromJson, serializeTopologySnapshotToJson)lightgraph::integration::layer_json::*Engine::pixel(...) returns ErrorCode::OutOfRange for invalid indices.EmitCommand::max_brightness must be >= min_brightness (InvalidArgument otherwise).Engine are mutex-protected.src/topologysrc/runtimesrc/renderingsrc/objectssrc/debugInternal headers under src/ are implementation details and may change.