13 using PACKED_WORD = uint32;
14 using GenericPalette = GenericPaletteBase<T>;
15 using VolumeView = ChunkVolume::VolumeOf<T>::ConstSubViewType;
17 static size_t const PALETTE_CAPACITY = 1UL << BITS_PER_ELEMENT;
19 static size_t const ELEMENT_PER_WORD = 32 / BITS_PER_ELEMENT;
21 PACKED_WORD mElement[(4096 + ELEMENT_PER_WORD - 1) / ELEMENT_PER_WORD];
26 MCAPI SubChunkStoragePaletted(
IDataInput& stream, RuntimeDeserializationLookup<T>
const& lookUp);
27 MCAPI SubChunkStoragePaletted(
IDataInput& stream, PersistentDeserializationLookup<T>
const& lookUp);
29 MCAPI SubChunkStoragePaletted(T
const& uniformElement);
30 MCAPI SubChunkStoragePaletted(VolumeView
const& view, GenericPalette
const& palette);
32 template <
unsigned long IN_CAPACITY>
33 MCAPI SubChunkStoragePaletted(
SubChunkStorage<T> const& toPrune, std::bitset<IN_CAPACITY>
const& usedIndices);
35 MCAPI
bool isUniform(T
const&)
const override;
37 MCAPI
bool isPaletteUniform(T
const&)
const override;
39 MCAPI T
const& getElement(uint16)
const override;
41 MCAPI
bool trySetElement(uint16, T
const&)
override;
43 MCAPI
size_t getElementTypeCapacity()
const override;
45 MCAPI
bool hasAvailableElementTypeCapacity()
const override;
47 MCAPI SubChunkStorageUnit::Type getType()
const override;
49 MCAPI
size_t getMemoryEstimate()
const override;
51 MCAPI std::unique_ptr<SubChunkStorage<T>> makePrunedCopy(SubChunkStorageUnit::PruneType)
const override;
53 MCAPI
void fetchElementInCylinder(
62 MCAPI
void fetchElementInBox(
69 MCAPI
bool hasAnyElementInBox(
75 MCAPI
bool hasAnyElementMatchingFilterInPalette(std::function<
bool(T
const&)>
const&)
const override;
77 MCAPI
void _serialize(
IDataOutput&, RuntimeSerializationLookup<T>
const&)
const override;
79 MCAPI
void _serialize(
IDataOutput&, PersistentSerializationLookup<T>
const&)
const override;
81 MCAPI gsl::span<unsigned int const> getPackedElement()
const override;
83 MCAPI
size_t getBitsPerElement()
const override;
85 MCAPI gsl::span<T const* const> getPaletteSnapshot()
const override;
87 MCAPI
void _zeroIndicesGreaterEqualThan(uint16 max);
93 using GenericPalette = GenericPaletteBase<T>;
94 using VolumeView = ChunkVolume::VolumeOf<T>::ConstSubViewType;
99 MCAPI SubChunkStoragePaletted(
IDataInput& stream, RuntimeDeserializationLookup<T>
const& lookUp);
100 MCAPI SubChunkStoragePaletted(
IDataInput& stream, PersistentDeserializationLookup<T>
const& lookUp);
102 MCAPI SubChunkStoragePaletted(T
const& uniformElement);
103 MCAPI SubChunkStoragePaletted(VolumeView
const& view, GenericPalette
const& palette);
105 MCAPI
bool isUniform(T
const&)
const override;
107 MCAPI
bool isPaletteUniform(T
const&)
const override;
109 MCAPI T
const& getElement(uint16)
const override;
111 MCAPI
bool trySetElement(uint16, T
const&)
override;
113 MCAPI
size_t getElementTypeCapacity()
const override;
115 MCAPI
bool hasAvailableElementTypeCapacity()
const override;
117 MCAPI SubChunkStorageUnit::Type getType()
const override;
119 MCAPI
size_t getMemoryEstimate()
const override;
121 MCAPI std::unique_ptr<SubChunkStorage<T>> makePrunedCopy(SubChunkStorageUnit::PruneType)
const override;
123 MCAPI
void fetchElementInCylinder(
132 MCAPI
void fetchElementInBox(
139 MCAPI
bool hasAnyElementInBox(
145 MCAPI
bool hasAnyElementMatchingFilterInPalette(std::function<
bool(T
const&)>
const&)
const override;
147 MCAPI
void _serialize(
IDataOutput&, RuntimeSerializationLookup<T>
const&)
const override;
149 MCAPI
void _serialize(
IDataOutput&, PersistentSerializationLookup<T>
const&)
const override;
151 MCAPI gsl::span<unsigned int const> getPackedElement()
const override;
153 MCAPI
size_t getBitsPerElement()
const override;
155 MCAPI gsl::span<T const* const> getPaletteSnapshot()
const override;
157 MCAPI
void _zeroIndicesGreaterEqualThan(uint16 max);