2022-09-05 04:24:50 -04:00
|
|
|
//
|
|
|
|
// EuropaTools
|
|
|
|
//
|
|
|
|
// (C) 2021-2022 modeco80 <lily.modeco80@protonmail.ch>
|
|
|
|
//
|
2022-09-21 03:49:57 -04:00
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
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>
|
|
|
|
|
2022-09-05 04:24:50 -04:00
|
|
|
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;
|
2022-09-05 20:59:46 -04:00
|
|
|
bool invalid { false };
|
2022-09-05 04:24:50 -04:00
|
|
|
|
|
|
|
structs::YatfHeader header;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* converted image.
|
|
|
|
*/
|
|
|
|
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
|