This commit is contained in:
2025-08-06 13:29:28 +08:00
commit 957a372209
230 changed files with 43801 additions and 0 deletions

View File

@ -0,0 +1,32 @@
//
// Created by sfd on 25-8-5.
//
#ifndef IMAGEREADER_H
#define IMAGEREADER_H
#include "BinaryReader.h"
#include "../Tex/TexImageContainer.h"
namespace PKG
{
class PKG_API ImageReader
{
public:
static TexImage ReadFrom(BinaryReader& reader, const TexImageContainer& container, TexFormat format);
static TexImageContainer ImageContainerReaderReadFrom(BinaryReader& reader, TexFormat texFormat);
private:
static TexMipMap ReadMipMapV1(BinaryReader& reader);
static TexMipMap ReadMipMapV2AndV3(BinaryReader& reader);
static TexMipMap ReadMipMapV4(BinaryReader& reader);
static std::vector<uint8_t> ReadBytes(BinaryReader& reader);
static MipmapFormat GetFormatFromTex(FreeImageFormat imageFormat, TexFormat format);
static MipmapFormat FreeImageFormatToMipmapFormat(FreeImageFormat imageFormat);
};
}
#endif //IMAGEREADER_H