8 #ifndef META_OCEAN_IO_UTILITIES_H
9 #define META_OCEAN_IO_UTILITIES_H
65 static inline Buffer encodeHomogenousMatrix4(
const HomogenousMatrix4& matrix,
const size_t reservedHeaderSize = 0);
103 static inline Buffer encodeVectors2(
const Vector2* vectors,
const size_t size,
const size_t reservedHeaderSize = 0);
122 static inline bool decodeVectors2(
const Buffer& buffer,
Vectors2& vectors);
141 static inline Buffer encodeVectors3(
const Vector3* vectors,
const size_t size,
const size_t reservedHeaderSize = 0);
160 static inline bool decodeVectors3(
const Buffer& buffer,
Vectors3& vectors);
179 static inline Buffer encodeVectors4(
const Vector4* vectors,
const size_t size,
const size_t reservedHeaderSize = 0);
198 static inline bool decodeVectors4(
const Buffer& buffer,
Vectors4& vectors);
203 Buffer result(reservedHeaderSize);
212 const uint8_t* data = buffer.data();
213 size_t size = buffer.size();
220 Buffer result(reservedHeaderSize);
229 const uint8_t* data = buffer.data();
230 size_t size = buffer.size();
237 Buffer result(reservedHeaderSize);
246 const uint8_t* data = buffer.data();
247 size_t size = buffer.size();
254 Buffer result(reservedHeaderSize);
263 const uint8_t* data = buffer.data();
264 size_t size = buffer.size();
This class implements utility functions for input and output operations.
Definition: io/Utilities.h:31
static bool decodeVectors2(const uint8_t *&data, size_t &size, Vectors2 &vectors)
Decodes a set of 2D vectors.
static void encodeVectors3(const Vector3 *vectors, const size_t size, Buffer &buffer)
Encodes a set of given 3D vectors.
static bool decodeVectors4(const uint8_t *&data, size_t &size, Vectors4 &vectors)
Decodes a set of 4D vectors.
static bool decodeHomogenousMatrix4(const uint8_t *&data, size_t &size, HomogenousMatrix4 &matrix)
Decodes a 4x4 homogeneous matrix.
std::vector< uint8_t > Buffer
Definition of a vector holding 8 bit elements.
Definition: io/Utilities.h:37
static bool readFile(const std::string &filename, Buffer &buffer)
Reads a file and copies the data into a buffer.
static void encodeHomogenousMatrix4(const HomogenousMatrix4 &matrix, Buffer &buffer)
Encodes a 4x4 homogeneous matrix.
static void encodeVectors4(const Vector4 *vectors, const size_t size, Buffer &buffer)
Encodes a set of given 4D vectors.
static bool decodeVectors3(const uint8_t *&data, size_t &size, Vectors3 &vectors)
Decodes a set of 3D vectors.
static void encodeVectors2(const Vector2 *vectors, const size_t size, Buffer &buffer)
Encodes a set of given 2D vectors.
This class implements a vector with four elements.
Definition: Vector4.h:97
std::vector< Vector4 > Vectors4
Definition of a vector holding Vector4 objects.
Definition: Vector4.h:65
std::vector< Vector2 > Vectors2
Definition of a vector holding Vector2 objects.
Definition: Vector2.h:64
std::vector< Vector3 > Vectors3
Definition of a vector holding Vector3 objects.
Definition: Vector3.h:65
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15