![]() |
VRS
A file format for sensor data.
|
Specification of a VRS record content block. More...
#include <RecordFormat.h>
Public Member Functions | |
ContentBlock (ContentType type=ContentType::EMPTY, size_t size=kSizeUnknown) | |
Very generic block description. | |
ContentBlock (const string &formatStr) | |
Factory-style reconstruct from persisted description as string on disk. | |
ContentBlock (ImageFormat imageFormat, uint32_t width=0, uint32_t height=0) | |
Image formats with encoding (png, jpeg, etc). | |
ContentBlock (const std::string &codecName, uint8_t codecQuality, PixelFormat pixelFormat=PixelFormat::UNDEFINED, uint32_t width=0, uint32_t height=0, uint32_t stride=0, uint32_t stride2=0) | |
Image formats with custom codec encoding. | |
ContentBlock (PixelFormat pixelFormat, uint32_t width, uint32_t height, uint32_t stride=0, uint32_t stride2=0) | |
Raw image formats: a PixelFormat and maybe resolutions & raw stride. | |
ContentBlock (const ImageContentBlockSpec &imageSpec, size_t size=kSizeUnknown) | |
ContentBlock (const ContentBlock &imageContentBlock, double keyFrameTimestamp, uint32_t keyFrameIndex) | |
ContentBlock (AudioFormat audioFormat, uint8_t channelCount=0) | |
Very generic audio block description. | |
ContentBlock (const AudioContentBlockSpec &audioSpec, size_t size) | |
ContentBlock (AudioFormat audioFormat, AudioSampleFormat sampleFormat, uint8_t numChannels=0, uint8_t sampleFrameStride=0, uint32_t sampleRate=0, uint32_t sampleCount=0, uint8_t stereoPairCount=0) | |
Audio block description. | |
ContentBlock (const ContentBlock &)=default | |
Default copy constructor. | |
ContentBlock (const ContentBlock &other, size_t size) | |
Copy constructor, except for the size. | |
ContentBlock & | operator= (const ContentBlock &rhs)=default |
Default copy assignment. | |
string | asString () const |
Conversion to string, to store on disk & reconstruct later using constructor. | |
size_t | getBlockSize () const |
Get the content block size, if available or calculable. | |
ContentType | getContentType () const |
Get the ContentType of the block. | |
string | getCustomContentBlockFormat () const |
bool | operator== (const ContentBlock &rhs) const |
bool | operator!= (const ContentBlock &rhs) const |
RecordFormat | operator+ (const ContentBlock &) const |
Assembly operator, to construct a RecordFormat for ContentBlock parts. | |
const ImageContentBlockSpec & | image () const |
Get the image content spec. Requires the content block to be of type ContentType::IMAGE. | |
const AudioContentBlockSpec & | audio () const |
Get the audio content spec. Requires the content block to be of type ContentType::AUDIO. | |
Static Public Attributes | |
static const size_t | kSizeUnknown = numeric_limits<size_t>::max() |
Special value used to represent an unknown block size. | |
Protected Attributes | |
ContentType | contentType_ = ContentType::EMPTY |
size_t | size_ = kSizeUnknown |
ImageContentBlockSpec | imageSpec_ |
AudioContentBlockSpec | audioSpec_ |
string | customContentBlockFormat_ |
Specification of a VRS record content block.
VRS records are described by RecordFormat as a succession of ContentBlocks, which each describe the data they contain.
Each ContentBlock has a type, described by a ContentType. Typical types are:
Each block may have a fixed size, or an unknown size if the size might vary between records.
|
inline |
Get format for custom blocks, as a free-form string, provided on creation by using: ContentBlock("custom/format=my_custom_content_block_format_name").