mirror of
https://github.com/aurora-opensource/xviz.git
synced 2026-01-18 14:07:46 +00:00
A 'Frame' is often overloaded, and in nearly all case in XVIZ we mean an XVIZ Message. We have created a distinction where if we use 'Frame' it is not an individual message but the set of data that constitutes a visual 'Frame' which could come from multiple messages. Therefore, 'Frame' is still used in @xviz/parse
1.5 KiB
1.5 KiB
XVIZBinaryReader
XVIZBinaryReader supports the Binary GLB based format for XVIZ data.
Example
import {XVIZBinaryReader, MemorySource} from '@xviz/io';
const source = new MemorySource();
// XVIZ data added to source
const reader = new XVIZBinaryReader(source);
Constructor
Parameters:
source(Object) - XVIZ data source
Methods
readMetadata()
Reads a log metadata from the source.
Returns: (Object|Buffer) - XVIZ metadata
readMessage(messageIndex)
Reads an XVIZ message from the source.
Parameters:
messageIndex(Number) - the index of this message. XVIZBuilder.getMessage().
Returns: (Object|Buffer) - XVIZ message
timeRange()
Returns:
- (Object)
startTime(Number) - Start time of the the source if knownendTime(Number) - End time of the the source if known
messageCount()
Returns: (Number) - Number of messages available in the data
findMessage(timestamp)
Returns an object with the message indices for the first and last indices that are the boundaries for this timestamp.
Parameters:
timestamp(Number) - Timestamp used to find the message index boundaries
Returns:
- (Object)
first(Number) - First message index that is >= timestamp, or the first index if timestamp < the start of the time rangelast(Number) - Last message index that is <= timestamp, or the last index if timestamp > the end of the time range
close()
Close the reader and the underlying source.