9 typedef std::pair<T, uint16_t>
RLEPair;
24 m_data.push_back(std::make_pair(data[0], 1));
25 for(
size_t i = 1; i < size; ++i)
27 if(data[i] == m_data.back().first && m_data.back().second < std::numeric_limits<uint16_t>::max())
28 m_data.back().second++;
30 m_data.push_back(std::make_pair(data[i], 1));
43 for (
auto [value, count] : m_data)
45 for(
size_t j = 0; j < count; ++j)
54 m_data.resize(new_raw_size /
sizeof(
RLEPair));
69 return m_data.size() *
sizeof(
RLEPair);
72 const std::vector<RLEPair> &
getRaw()
const
82 std::vector<RLEPair> m_data;
Definition: RLE_TEST.hpp:7
void resize(size_t new_raw_size)
Definition: RLE_TEST.hpp:52
std::pair< T, uint16_t > RLEPair
Definition: RLE_TEST.hpp:9
std::vector< RLEPair > & getRaw()
Definition: RLE_TEST.hpp:77
void compressData(const T *data, const size_t &size)
Definition: RLE_TEST.hpp:21
std::size_t getRawSize() const
Get the size in bytes of the underlying compressed data.
Definition: RLE_TEST.hpp:67
RLE_TEST()
Definition: RLE_TEST.hpp:11
std::size_t getSize() const
Definition: RLE_TEST.hpp:57
const std::vector< RLEPair > & getRaw() const
Definition: RLE_TEST.hpp:72
static size_t sizeOfPair()
Definition: RLE_TEST.hpp:16
std::vector< T > getData() const
Definition: RLE_TEST.hpp:40
void setContent(const void *data, const size_t &size)
Definition: RLE_TEST.hpp:34