Rerun C++ SDK
Loading...
Searching...
No Matches
rerun Namespace Reference

All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces. More...

Namespaces

namespace  archetypes
 All built-in archetypes. See Types in the Rerun manual.
 
namespace  blueprint
 All blueprint types. This is still experimental and subject to change!
 
namespace  components
 All built-in components. See Types in the Rerun manual.
 
namespace  datatypes
 All built-in datatypes. See Types in the Rerun manual.
 
namespace  traits
 Type trait utilities.
 

Classes

class  Collection
 Generic collection of elements that are roughly contiguous in memory. More...
 
struct  CollectionAdapter
 The rerun::CollectionAdapter trait is responsible for mapping an input argument to a rerun::Collection. More...
 
struct  ComponentBatch
 Arrow-encoded data of a single batch components for a single entity. More...
 
struct  ComponentColumn
 Arrow-encoded data of a column of components. More...
 
struct  ComponentType
 A type of component that can be registered. More...
 
class  Error
 Status outcome object (success or error) returned for fallible operations. More...
 
struct  half
 IEEE 754 16-bit half-precision floating point number. More...
 
struct  Loggable
 The Loggable trait is used by all built-in implementation of rerun::AsComponents to serialize a collection for logging. More...
 
class  RecordingStream
 A RecordingStream handles everything related to logging data into Rerun. More...
 
struct  RerunGlobalConfig
 Configuration singleton that applies to the entire SDK. More...
 
class  Result
 A class for representing either a usable value, or an error. More...
 
struct  Rotation3D
 Utility for representing a single 3D rotation, agnostic to the underlying representation. More...
 
struct  SpawnOptions
 Options to control the behavior of spawn. More...
 
struct  TimeColumn
 Arrow-encoded data for a column of time points. More...
 
struct  Timeline
 Definition of a timeline. More...
 
struct  WidthHeight
 The width and height of an image. More...
 

Typedefs

using ComponentTypeHandle = uint32_t
 Handle to a registered component types.
 
using StatusLogHandler = void(*)(const class Error &status, void *userdata)
 Callback function type for log handlers.
 

Enumerations

enum class  CollectionOwnership { Borrowed , VectorOwned }
 Type of ownership of a collection's data. More...
 
enum class  ErrorCode : uint32_t {
  Ok = 0x0000'0000 , OutOfMemory , NotImplemented , SdkVersionMismatch ,
  _CategoryArgument = 0x0000'0010 , UnexpectedNullArgument , InvalidStringArgument , InvalidEnumValue ,
  InvalidRecordingStreamHandle , InvalidSocketAddress , InvalidComponentTypeHandle , InvalidTensorDimension ,
  FileRead , _CategoryRecordingStream = 0x0000'0100 , RecordingStreamRuntimeFailure , RecordingStreamCreationFailure ,
  RecordingStreamSaveFailure , RecordingStreamStdoutFailure , RecordingStreamSpawnFailure , RecordingStreamChunkValidationFailure ,
  _CategoryArrow = 0x0000'1000 , ArrowFfiSchemaImportError , ArrowFfiArrayImportError , _CategoryUtilities = 0x0001'0000 ,
  VideoLoadError , _CategoryFileIO = 0x0010'0000 , FileOpenFailure , _CategoryArrowCppStatus = 0x1000'0000 ,
  ArrowStatusCode_KeyError , ArrowStatusCode_TypeError , ArrowStatusCode_Invalid , ArrowStatusCode_IOError ,
  ArrowStatusCode_CapacityError , ArrowStatusCode_IndexError , ArrowStatusCode_Cancelled , ArrowStatusCode_UnknownError ,
  ArrowStatusCode_NotImplemented , ArrowStatusCode_SerializationError , ArrowStatusCode_RError , ArrowStatusCode_CodeGenError ,
  ArrowStatusCode_ExpressionValidationError , ArrowStatusCode_ExecutionError , ArrowStatusCode_AlreadyExists , Unknown = 0xFFFF'FFFF
}
 Status codes returned by the SDK as part of Status. More...
 
enum class  StoreKind { Recording , Blueprint }
 
enum class  SortingStatus { Unknown = 0 , Sorted = 1 , Unsorted = 2 }
 Describes whether an array is known to be sorted or not. More...
 
enum class  TimeType { Time = 0 , Sequence = 1 }
 Describes the type of a timeline or time point.
 

Functions

template<typename T >
std::shared_ptr< arrow::Buffer > arrow_buffer_from_vector (std::vector< T > vec)
 Creates an arrow buffer from a vector without allocating new memory.
 
template<typename TElement >
Collection< TElement > borrow (const TElement *data, size_t num_instances=1)
 Borrows binary data into a Collection from a pointer.
 
template<typename TElement >
Collection< TElement > borrow (const std::vector< TElement > &data)
 Borrows binary data into the collection from a vector.
 
template<typename TElement >
Collection< TElement > take_ownership (std::vector< TElement > data)
 Takes ownership of a temporary std::vector, moving it into the collection.
 
template<typename TElement >
Collection< TElement > take_ownership (TElement data)
 Takes ownership of a single element, moving it into the collection.
 
void set_default_enabled (bool default_enabled)
 Change whether RecordingStreams are enabled by default.
 
bool is_default_enabled ()
 Check if Rerun is enabled.
 
std::string escape_entity_path_part (std::string_view str)
 Escape an individual part of an entity path.
 
std::string new_entity_path (const std::vector< std::string_view > &path)
 Construct an entity path by escaping each part of the path.
 
size_t datatype_bits (datatypes::ChannelDatatype value)
 Number of bits used by this element type.
 
size_t num_bytes (WidthHeight resolution, datatypes::ChannelDatatype datatype)
 
template<typename TElement >
datatypes::ChannelDatatype get_datatype (const TElement *_unused)
 
template<>
datatypes::ChannelDatatype get_datatype (const uint8_t *_unused)
 
template<>
datatypes::ChannelDatatype get_datatype (const uint16_t *_unused)
 
template<>
datatypes::ChannelDatatype get_datatype (const uint32_t *_unused)
 
template<>
datatypes::ChannelDatatype get_datatype (const uint64_t *_unused)
 
template<>
datatypes::ChannelDatatype get_datatype (const int8_t *_unused)
 
template<>
datatypes::ChannelDatatype get_datatype (const int16_t *_unused)
 
template<>
datatypes::ChannelDatatype get_datatype (const int32_t *_unused)
 
template<>
datatypes::ChannelDatatype get_datatype (const int64_t *_unused)
 
template<>
datatypes::ChannelDatatype get_datatype (const rerun::half *_unused)
 
template<>
datatypes::ChannelDatatype get_datatype (const float *_unused)
 
template<>
datatypes::ChannelDatatype get_datatype (const double *_unused)
 
size_t color_model_channel_count (datatypes::ColorModel color_model)
 Returns the number of channels for a given color model.
 
size_t pixel_format_num_bytes (WidthHeight resolution, datatypes::PixelFormat pixel_format)
 
const char * version_string ()
 Returns a human-readable version string of the Rerun C SDK.
 
Error check_binary_and_header_version_match ()
 Internal check whether the version reported by the rerun_c binary matches sdk_version_string.
 
Error spawn (const SpawnOptions &options={})
 Spawns a new Rerun Viewer process from an executable available in PATH, ready to listen for incoming TCP connections.
 

Variables

const int EXTERNAL_DATA_LOADER_INCOMPATIBLE_EXIT_CODE = 66
 When an external [DataLoader] is asked to load some data that it doesn't know how to load, it should exit with this exit code.
 
template<typename T >
constexpr bool is_loggable = detail::is_loggable<T>()
 True for any type that implements the Loggable trait.
 

Detailed Description

All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.

Enumeration Type Documentation

◆ CollectionOwnership

enum class rerun::CollectionOwnership
strong

Type of ownership of a collection's data.

User access to this is typically only needed for debugging and testing.

Enumerator
Borrowed 

The collection does not own the data and only has a pointer and a size.

VectorOwned 

The collection batch owns the data via an std::vector.

◆ ErrorCode

enum class rerun::ErrorCode : uint32_t
strong

Status codes returned by the SDK as part of Status.

Category codes are used to group errors together, but are never returned directly.

◆ SortingStatus

enum class rerun::SortingStatus
strong

Describes whether an array is known to be sorted or not.

Enumerator
Unknown 

It's not known whether the array is sorted or not.

Sorted 

The array is known to be sorted.

Unsorted 

The array is known to be unsorted.

Function Documentation

◆ arrow_buffer_from_vector()

template<typename T >
std::shared_ptr< arrow::Buffer > rerun::arrow_buffer_from_vector ( std::vector< T >  vec)
inline

Creates an arrow buffer from a vector without allocating new memory.

Newer version of the arrow sdk have this builtin as arrow::Buffer::FromVector.

◆ borrow() [1/2]

template<typename TElement >
Collection< TElement > rerun::borrow ( const TElement *  data,
size_t  num_instances = 1 
)
inline

Borrows binary data into a Collection from a pointer.

Borrowed data must outlive the collection! (If the pointer passed is into an std::vector or similar, this std::vector mustn't be resized.) The passed type must be binary compatible with the collection type.

Since rerun::Collection does not provide write access, data is guaranteed to be unchanged by any function or operation taking on a Collection.

◆ borrow() [2/2]

template<typename TElement >
Collection< TElement > rerun::borrow ( const std::vector< TElement > &  data)
inline

Borrows binary data into the collection from a vector.

Borrowed data must outlive the collection! The referenced vector must not be resized and musn't be temporary.

Since rerun::Collection does not provide write access, data is guaranteed to be unchanged by any function or operation taking on a rerun::Collection.

◆ take_ownership()

template<typename TElement >
Collection< TElement > rerun::take_ownership ( std::vector< TElement >  data)
inline

Takes ownership of a temporary std::vector, moving it into the collection.

Takes ownership of the data and moves it into the collection.

◆ set_default_enabled()

void rerun::set_default_enabled ( bool  default_enabled)
inline

Change whether RecordingStreams are enabled by default.

This governs the creation of new RecordingStreams. If default_enabled is false, RecordingStreams will be created in the disabled state. Changing the value of default_enabled will not affect existing RecordingStreams.

Note that regardless of usage of this API, the value of default_enabled will be overridden by the RERUN environment variable.

If RERUN is set to 1, true, or yes, then Rerun is enabled. If RERUN is set to 0, false, or no, then Rerun is disabled.

◆ escape_entity_path_part()

std::string rerun::escape_entity_path_part ( std::string_view  str)

Escape an individual part of an entity path.

For instance, escape_entity_path_path("my image!") will return "my\ image\!".

◆ new_entity_path()

std::string rerun::new_entity_path ( const std::vector< std::string_view > &  path)

Construct an entity path by escaping each part of the path.

For instance, rerun::new_entity_path({"world", 42, "unescaped string!"}) will return "world/42/escaped\ string\!".

◆ color_model_channel_count()

size_t rerun::color_model_channel_count ( datatypes::ColorModel  color_model)
inline

Returns the number of channels for a given color model.

This is the number of expected elements per pixel.

◆ version_string()

const char * rerun::version_string ( )

Returns a human-readable version string of the Rerun C SDK.

This should match the string in RERUN_SDK_HEADER_VERSION. If not, the SDK's binary and the C++ headers are out of sync.

◆ check_binary_and_header_version_match()

Error rerun::check_binary_and_header_version_match ( )

Internal check whether the version reported by the rerun_c binary matches sdk_version_string.

This method is called on various C++ API entry points, calling Error::handle on the return value. There is no need to call this method yourself unless you want to ensure that rerun_c binary and rerun_c header versions match ahead of time.

◆ spawn()

Error rerun::spawn ( const SpawnOptions options = {})

Spawns a new Rerun Viewer process from an executable available in PATH, ready to listen for incoming TCP connections.

If a Rerun Viewer is already listening on this TCP port, the stream will be redirected to that viewer instead of starting a new one.

options: See rerun::SpawnOptions for more information.