Moved header structs and some methods to cpp files, reading pnm images upside-down
This commit is contained in:
@@ -9,24 +9,11 @@
|
||||
|
||||
namespace OpenVulkano::Image
|
||||
{
|
||||
struct PnmHeader
|
||||
{
|
||||
char magic = 0; // 1 for P1, 2 for P2 etc
|
||||
int width = 0;
|
||||
int height = 0;
|
||||
int maxVal = 255; // Only used for formats P2, P3, P5, P6
|
||||
};
|
||||
|
||||
class ImageLoaderPnm : public IImageLoader
|
||||
{
|
||||
public:
|
||||
std::unique_ptr<Image> loadFromFile(const std::string& filePath) override;
|
||||
std::unique_ptr<Image> loadFromMemory(const std::vector<uint8_t>& buffer) override;
|
||||
Math::Vector2i GetImageDimensions(const std::string& filename) override;
|
||||
|
||||
private:
|
||||
PnmHeader parseHeader(std::istream& stream);
|
||||
Array<uint8_t> readBinaryData(std::istream& stream, const PnmHeader& header);
|
||||
Array<uint8_t> readTextData(std::istream& stream, const PnmHeader& header);
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user