EuropaTools/include/europa/io/YatfReader.hpp

46 lines
786 B
C++
Raw Normal View History

//
// EuropaTools
//
2025-01-07 14:17:50 -05:00
// (C) 2021-2025 modeco80 <lily.modeco80@protonmail.ch>
//
2025-01-07 14:17:50 -05:00
// SPDX-License-Identifier: LGPL-3.0-or-later
//
#ifndef EUROPA_IO_YATFREADER_H
#define EUROPA_IO_YATFREADER_H
#include <pixel/RgbaImage.h>
#include <europa/structs/Yatf.hpp>
#include <iosfwd>
namespace europa::io {
2025-01-07 15:13:10 -05:00
/// Reader for PS2 Europa .tex files.
struct YatfReader {
explicit YatfReader(std::istream& is);
void Init(std::istream& is);
void ReadImage();
pixel::RgbaImage& GetImage();
const structs::YatfHeader& GetHeader() const;
[[nodiscard]] bool Invalid() const {
return invalid;
}
private:
std::istream& stream;
bool invalid { false };
structs::YatfHeader header;
pixel::RgbaImage image;
};
} // namespace europa::io
#endif // EUROPA_IO_YATFREADER_H