2022-09-05 04:24:50 -04:00
|
|
|
//
|
|
|
|
// EuropaTools
|
|
|
|
//
|
2025-01-07 14:17:50 -05:00
|
|
|
// (C) 2021-2025 modeco80 <lily.modeco80@protonmail.ch>
|
2022-09-05 04:24:50 -04:00
|
|
|
//
|
2025-01-07 18:02:27 -05:00
|
|
|
// SPDX-License-Identifier: MIT
|
2022-09-05 04:24:50 -04:00
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef EUROPA_IO_YATFREADER_H
|
|
|
|
#define EUROPA_IO_YATFREADER_H
|
|
|
|
|
|
|
|
#include <pixel/RgbaImage.h>
|
|
|
|
|
2022-09-21 03:59:16 -04:00
|
|
|
#include <europa/structs/Yatf.hpp>
|
2022-09-05 20:59:46 -04:00
|
|
|
#include <iosfwd>
|
|
|
|
|
2025-01-15 21:53:34 -05:00
|
|
|
namespace europa::io::yatf {
|
2022-09-05 04:24:50 -04:00
|
|
|
|
2025-01-15 21:53:34 -05:00
|
|
|
/// Reader for PS2 Europa .tex (YATF - Yet Another Texture Format) files.
|
|
|
|
struct Reader {
|
|
|
|
explicit Reader(std::istream& is);
|
2022-09-05 04:24:50 -04:00
|
|
|
|
2025-01-08 13:08:42 -05:00
|
|
|
void InitFromStream(std::istream& is);
|
2022-09-05 04:24:50 -04:00
|
|
|
|
|
|
|
void ReadImage();
|
|
|
|
|
|
|
|
pixel::RgbaImage& GetImage();
|
|
|
|
|
|
|
|
const structs::YatfHeader& GetHeader() const;
|
|
|
|
|
|
|
|
[[nodiscard]] bool Invalid() const {
|
|
|
|
return invalid;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::istream& stream;
|
2022-09-05 20:59:46 -04:00
|
|
|
bool invalid { false };
|
2022-09-05 04:24:50 -04:00
|
|
|
|
|
|
|
structs::YatfHeader header;
|
|
|
|
pixel::RgbaImage image;
|
|
|
|
};
|
|
|
|
|
2022-09-05 20:59:46 -04:00
|
|
|
} // namespace europa::io
|
2022-09-05 04:24:50 -04:00
|
|
|
|
|
|
|
#endif // EUROPA_IO_YATFREADER_H
|