#pragma once #include "Common.h" #include "Palette.h" #include namespace Feather { // A container that maps values from a local palette to a template struct PalettedContainer { //const Palette& globalPalette; static constexpr size_t NUM_LONGS = Math::CeilDiv(MaxSize * MaxBits, bitsizeof(uint64)); std::array data; // TODO: this could eventually be Palette to avoid double lookup // Palette of local indexs to indexs in the global palette IDMapper palette; uint size = MaxSize; uint8 bits = MaxBits; public: PalettedContainer(uint size, uint8 bits) : size(size), bits(bits), data() {} inline void SetBits(uint8 nbits) { bits = nbits; } inline constexpr size_t GetNumLongs() { return NUM_LONGS; } }; }