EuropaTools/include/europa/io/YatfReader.hpp
modeco80 341f914e1d *: Add some hardening compile options.
Also fix some warnings and potential issues that building the entire EuropaTools codebase under those flags showed.

Later on once we drop the libpixel and stbiw dependencies, we can probably turn on -Werror for release builds.
2025-01-08 13:08:49 -05:00

45 lines
782 B
C++

//
// EuropaTools
//
// (C) 2021-2025 modeco80 <lily.modeco80@protonmail.ch>
//
// SPDX-License-Identifier: MIT
//
#ifndef EUROPA_IO_YATFREADER_H
#define EUROPA_IO_YATFREADER_H
#include <pixel/RgbaImage.h>
#include <europa/structs/Yatf.hpp>
#include <iosfwd>
namespace europa::io {
/// Reader for PS2 Europa .tex files.
struct YatfReader {
explicit YatfReader(std::istream& is);
void InitFromStream(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