12#ifndef O2_MCH_RAW_IMPL_HELPERS_MOVEBUFFER_H
13#define O2_MCH_RAW_IMPL_HELPERS_MOVEBUFFER_H
25 std::vector<std::byte>& b8,
28 constexpr uint64_t
m = 0xFF;
30 b8.reserve(s8 + b64.size() / 8);
32 uint64_t
g =
b | prefix;
33 for (uint64_t
i = 0;
i < 64;
i += 8) {
35 b8.emplace_back(std::byte{
static_cast<uint8_t
>((
g &
w) >>
i)});
38 return b8.size() - s8;
44 std::vector<std::byte>& b8,
54 return (
static_cast<uint64_t
>(
buffer[
i + 0])) |
55 (
static_cast<uint64_t
>(
buffer[
i + 1]) << 8) |
56 (
static_cast<uint64_t
>(
buffer[
i + 2]) << 16) |
57 (
static_cast<uint64_t
>(
buffer[
i + 3]) << 24) |
58 (
static_cast<uint64_t
>(
buffer[
i + 4]) << 32) |
59 (
static_cast<uint64_t
>(
buffer[
i + 5]) << 40) |
60 (
static_cast<uint64_t
>(
buffer[
i + 6]) << 48) |
61 (
static_cast<uint64_t
>(
buffer[
i + 7]) << 56);
67 std::vector<uint64_t>& b64,
71 throw std::invalid_argument(
"b8 span must have a size that is a multiple of 8");
74 for (
auto i = 0;
i < b8.size();
i += 8) {
76 b64.emplace_back(
w | prefix);
78 return b64.size() - s;
GLboolean GLboolean GLboolean b
GLubyte GLubyte GLubyte GLubyte w
uint64_t b8to64(gsl::span< const std::byte > buffer, size_t i)
size_t copyBuffer(const std::vector< uint64_t > &b64, std::vector< std::byte > &b8, uint64_t prefix=0)
size_t moveBuffer(std::vector< uint64_t > &b64, std::vector< std::byte > &b8, uint64_t prefix=0)