EuropaTools/include/europa/io/YatfReader.hpp

52 lines
829 B
C++
Raw Permalink Normal View History

//
// EuropaTools
//
// (C) 2021-2022 modeco80 <lily.modeco80@protonmail.ch>
//
// SPDX-License-Identifier: GPL-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 {
/**
* 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;
/**
* converted image.
*/
pixel::RgbaImage image;
};
} // namespace europa::io
#endif // EUROPA_IO_YATFREADER_H