This class implements read and write functions for Ocean frames.
More...
|
static Frame | decodeImage (const void *buffer, const size_t size) |
| Decodes a OCN image from a given binary buffer. More...
|
|
static bool | encodeImage (const Frame &frame, std::vector< uint8_t > &buffer) |
| Encodes a given frame as OCN image to a resulting buffer. More...
|
|
|
template<typename T > |
static bool | readValue (const uint8_t *&data, size_t &remainingSize, T &value) |
| Reads a value from memory. More...
|
|
static bool | readValue (const uint8_t *&data, size_t &remainingSize, const size_t numberCharacters, std::string &value) |
| Reads a string from memory. More...
|
|
template<typename T > |
static bool | writeValue (const T &value, uint8_t *&data, size_t &remainingSize) |
| Writes a value to memory. More...
|
|
static bool | writeValue (const std::string &value, const size_t numberCharacters, uint8_t *&data, size_t &remainingSize) |
| Writes a string to memory and fills remaining memory with zero values. More...
|
|
This class implements read and write functions for Ocean frames.
◆ decodeImage()
static Frame Ocean::Media::Special::ImageOcn::decodeImage |
( |
const void * |
buffer, |
|
|
const size_t |
size |
|
) |
| |
|
static |
Decodes a OCN image from a given binary buffer.
- Parameters
-
buffer | The buffer from which the image will be loaded, must be valid |
size | The size of the given buffer in bytes, with range [1, infinity) |
- Returns
- The frame containing the image information, an invalid frame if the image could not be loaded
◆ encodeImage()
static bool Ocean::Media::Special::ImageOcn::encodeImage |
( |
const Frame & |
frame, |
|
|
std::vector< uint8_t > & |
buffer |
|
) |
| |
|
static |
Encodes a given frame as OCN image to a resulting buffer.
- Parameters
-
frame | The frame to be written, must be valid |
buffer | The resulting buffer storing the binary information of the OCN image |
- Returns
- True, if succeeded
◆ readValue() [1/2]
static bool Ocean::Media::Special::ImageOcn::readValue |
( |
const uint8_t *& |
data, |
|
|
size_t & |
remainingSize, |
|
|
const size_t |
numberCharacters, |
|
|
std::string & |
value |
|
) |
| |
|
staticprotected |
Reads a string from memory.
- Parameters
-
data | The memory from which the string will be read, will be moved, must be valid |
remainingSize | The remaining size of the memory, in bytes, will be adjusted, with range [numberCharacters, infinity) |
numberCharacters | The maximal size of the string to read, in bytes, with range [1, remainingSize] |
value | The resulting string |
- Returns
- True, if succeeded
◆ readValue() [2/2]
template<typename T >
static bool Ocean::Media::Special::ImageOcn::readValue |
( |
const uint8_t *& |
data, |
|
|
size_t & |
remainingSize, |
|
|
T & |
value |
|
) |
| |
|
staticprotected |
Reads a value from memory.
- Parameters
-
data | The memory from which the value will be read, will be moved, must be valid |
remainingSize | The remaining size of the memory, in bytes, will be adjusted, with range [sizeof(T), infinity) |
value | The resulting value |
- Returns
- True, if succeeded
- Template Parameters
-
T | The data type of the value |
◆ writeValue() [1/2]
static bool Ocean::Media::Special::ImageOcn::writeValue |
( |
const std::string & |
value, |
|
|
const size_t |
numberCharacters, |
|
|
uint8_t *& |
data, |
|
|
size_t & |
remainingSize |
|
) |
| |
|
staticprotected |
Writes a string to memory and fills remaining memory with zero values.
- Parameters
-
value | The string to write |
numberCharacters | The number of characters that will be written, with range [value.size(), infinity) |
data | The memory receiving the value, will be moved, must be valid |
remainingSize | The remaining size of the memory, in bytes, will be adjusted, with range [numberCharacters, infinity) |
- Returns
- True, if succeeded
◆ writeValue() [2/2]
template<typename T >
static bool Ocean::Media::Special::ImageOcn::writeValue |
( |
const T & |
value, |
|
|
uint8_t *& |
data, |
|
|
size_t & |
remainingSize |
|
) |
| |
|
staticprotected |
Writes a value to memory.
- Parameters
-
value | The value to write |
data | The memory receiving the value, will be moved, must be valid |
remainingSize | The remaining size of the memory, in bytes, will be adjusted, with range [sizeof(T), infinity) |
- Returns
- True, if succeeded
- Template Parameters
-
T | The data type of the value |
◆ headerDataTypeSize_
constexpr size_t Ocean::Media::Special::ImageOcn::headerDataTypeSize_ = 32 |
|
staticconstexprprotected |
The size of the data type header part in bytes.
◆ headerMagicNumberSize_
constexpr size_t Ocean::Media::Special::ImageOcn::headerMagicNumberSize_ = 4 |
|
staticconstexprprotected |
The size of the magic number header part in bytes.
◆ headerPixelFormatSize_
constexpr size_t Ocean::Media::Special::ImageOcn::headerPixelFormatSize_ = 40 |
|
staticconstexprprotected |
The size of the pixel format header part in bytes.
◆ headerPixelOriginSize_
constexpr size_t Ocean::Media::Special::ImageOcn::headerPixelOriginSize_ = 16 |
|
staticconstexprprotected |
The size of the pixel origin header part in bytes.
The documentation for this class was generated from the following file: