mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2026-06-26 10:58:04 +00:00
255c424aac
* feat: dynamically decompress bc5 textures for modman * chore: restructure image format class * chore: keep dds file conversions * chore: convert all kinds of webgl unsupported formats * chore: add decompressors for remaining formats * chore: always set full alpha if available on bc4 and bc5 decompression
34 lines
885 B
C++
34 lines
885 B
C++
#pragma once
|
|
|
|
#include "Texture.h"
|
|
|
|
#include <functional>
|
|
#include <memory>
|
|
|
|
namespace image
|
|
{
|
|
class TextureConverter
|
|
{
|
|
public:
|
|
TextureConverter(const Texture* inputTexture, const ImageFormat* targetFormat);
|
|
|
|
std::unique_ptr<Texture> Convert();
|
|
|
|
private:
|
|
void SetPixelFunctions(unsigned inBitCount, unsigned outBitCount);
|
|
|
|
void CreateOutputTexture();
|
|
|
|
void ReorderUnsignedToUnsigned() const;
|
|
void ConvertUnsignedToUnsigned();
|
|
|
|
std::function<uint64_t(const void* offset, unsigned bitCount)> m_read_pixel_func;
|
|
std::function<void(void* offset, uint64_t pixel, unsigned bitCount)> m_write_pixel_func;
|
|
|
|
const Texture* m_input_texture;
|
|
std::unique_ptr<Texture> m_output_texture;
|
|
const ImageFormat* m_input_format;
|
|
const ImageFormat* m_output_format;
|
|
};
|
|
} // namespace image
|