aether::compression::packed_writer Class Reference

#include <compression.hh>

Public Member Functions

 packed_writer (std::unique_ptr< compression_config > config)
 
uint8_t & operator[] (size_t i)
 
const uint8_t & operator[] (size_t i) const
 
template<typename T >
void append_N_bits (const T *data, size_t size)
 Set of methods used to compress specific properties into bytearray. More...
 
void append (const uint8_t *_bulk_data, size_t size, uint64_t starting_bit=0)
 
void append_quat (const net_quat &quat)
 
void append_velocity (const aether::vec3f &vel)
 
void append_4_b (const uint32_t *bytes)
 
void append_1_b (const uint8_t *byte)
 
void append_4_b_packed (const uint32_t *bytess, int32_t max_val, int32_t min_val)
 
void append_float_packed (const float *bytes, float max_val, float min_val, uint32_t precision)
 
void reserve_bits (size_t n)
 
const uint8_t * get_data () const
 Set of methods used to decompress specific properties from bytearray. More...
 
size_t get_size_bits () const
 
size_t get_size_bytes () const
 
const compression_configget_config () const
 

Static Public Member Functions

static uint32_t get_precision (int32_t max_val, int32_t min_val)
 
static uint32_t get_float_precision (float max_val, float min_val, uint32_t precision)
 

Protected Attributes

size_t cursor
 
size_t size
 
std::vector< uint8_t > bulk_data
 
std::unique_ptr< compression_configconfig
 

Constructor & Destructor Documentation

aether::compression::packed_writer::packed_writer ( std::unique_ptr< compression_config config)

Member Function Documentation

void aether::compression::packed_writer::append ( const uint8_t *  _bulk_data,
size_t  size,
uint64_t  starting_bit = 0 
)
void aether::compression::packed_writer::append_1_b ( const uint8_t *  byte)
void aether::compression::packed_writer::append_4_b ( const uint32_t *  bytes)
void aether::compression::packed_writer::append_4_b_packed ( const uint32_t *  bytess,
int32_t  max_val,
int32_t  min_val 
)
void aether::compression::packed_writer::append_float_packed ( const float *  bytes,
float  max_val,
float  min_val,
uint32_t  precision 
)
template<typename T >
void aether::compression::packed_writer::append_N_bits ( const T *  data,
size_t  size 
)

Set of methods used to compress specific properties into bytearray.

void aether::compression::packed_writer::append_quat ( const net_quat &  quat)
void aether::compression::packed_writer::append_velocity ( const aether::vec3f &  vel)
const compression_config& aether::compression::packed_writer::get_config ( ) const
const uint8_t* aether::compression::packed_writer::get_data ( ) const
inline

Set of methods used to decompress specific properties from bytearray.

static uint32_t aether::compression::packed_writer::get_float_precision ( float  max_val,
float  min_val,
uint32_t  precision 
)
static
static uint32_t aether::compression::packed_writer::get_precision ( int32_t  max_val,
int32_t  min_val 
)
static
size_t aether::compression::packed_writer::get_size_bits ( ) const
inline
size_t aether::compression::packed_writer::get_size_bytes ( ) const
inline
uint8_t& aether::compression::packed_writer::operator[] ( size_t  i)
inline
const uint8_t& aether::compression::packed_writer::operator[] ( size_t  i) const
inline
void aether::compression::packed_writer::reserve_bits ( size_t  n)

Member Data Documentation

std::vector<uint8_t> aether::compression::packed_writer::bulk_data
protected
std::unique_ptr<compression_config> aether::compression::packed_writer::config
protected
size_t aether::compression::packed_writer::cursor
protected
size_t aether::compression::packed_writer::size
protected