mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-13 00:08:26 -05:00
move parts to new common component to avoid circular dependency of zonecommon and objcommon
This commit is contained in:
30
src/Common/Image/TextureConverter.h
Normal file
30
src/Common/Image/TextureConverter.h
Normal file
@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include "Texture.h"
|
||||
|
||||
class TextureConverter
|
||||
{
|
||||
Texture* m_input_texture;
|
||||
Texture* m_output_texture;
|
||||
const ImageFormat* m_input_format;
|
||||
const ImageFormat* m_output_format;
|
||||
|
||||
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;
|
||||
|
||||
static constexpr uint64_t Mask1(unsigned length);
|
||||
void SetPixelFunctions(unsigned inBitCount, unsigned outBitCount);
|
||||
|
||||
void CreateOutputTexture();
|
||||
|
||||
void ReorderUnsignedToUnsigned() const;
|
||||
void ConvertUnsignedToUnsigned();
|
||||
|
||||
public:
|
||||
|
||||
TextureConverter(Texture* inputTexture, const ImageFormat* targetFormat);
|
||||
|
||||
Texture* Convert();
|
||||
};
|
Reference in New Issue
Block a user