#pragma once #include #include #include #include #include #include "../../inc/gl/glew.h" template class CompressedTexture { public: virtual ~CompressedTexture() {} // Uncompress and retrieve the texture (possibly from a certain index) virtual T operator[](size_t i) const = 0; virtual unsigned64 size() const = 0; virtual std::vector GetTexture(size_t fromIndex = 0) = 0; // Compresses the texture, replacing everything after fromIndex by whatever is in texture virtual void SetTexture(const std::vector& texture, size_t fromIndex = 0) = 0; // Replace all materials by other colors. This could be useful as some methods don't need to fully decompress and compress the whole texture to do this. virtual void ReplaceMaterials(const std::unordered_map& replacers) = 0; virtual void Recompress() { SetTexture(GetTexture()); } virtual void ReadFromFile(std::istream& file) = 0; virtual void WriteToFile(std::ostream& file) const = 0; // Use this method to output the compressed texture as a vector of one byte characters virtual std::vector GetTexturePool() const = 0; virtual size_t GetTexturePoolSize() const = 0; // Use this method to output any addition information that might be needed. virtual std::vector GetAdditionalTexturePool() const { return std::vector(); }; virtual size_t GetAdditionalTexturePoolSize() const { return 0; }; virtual std::map GetAdditionalProperties() const = 0; };