aboutsummaryrefslogtreecommitdiff
path: root/src/openvic/utility/BMP.hpp
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2023-09-09 23:49:54 +0200
committer GitHub <noreply@github.com>2023-09-09 23:49:54 +0200
commit6278a35f4704574933464700026d8deb997da5c1 (patch)
treeeb36a9b030b263d825eb93638e64deb0dbd38a78 /src/openvic/utility/BMP.hpp
parentbec619fc8f554cb075fcef2428f3b6bdb5e88e82 (diff)
parent3d7fbd9b376811ca0ed226fa78bcc8b6279ba8dc (diff)
Merge pull request #14 from OpenVicProject/dataloading
Dataloading scaffolding + basic culture and pop history loading
Diffstat (limited to 'src/openvic/utility/BMP.hpp')
-rw-r--r--src/openvic/utility/BMP.hpp48
1 files changed, 0 insertions, 48 deletions
diff --git a/src/openvic/utility/BMP.hpp b/src/openvic/utility/BMP.hpp
deleted file mode 100644
index c6f5815..0000000
--- a/src/openvic/utility/BMP.hpp
+++ /dev/null
@@ -1,48 +0,0 @@
-#pragma once
-
-#include "../Types.hpp"
-
-namespace OpenVic {
- class BMP {
-#pragma pack(push)
-#pragma pack(1)
- struct header_t {
- uint16_t signature; // Signature: 0x4d42 (or 'B' 'M')
- uint32_t file_size; // File size in bytes
- uint16_t reserved1; // Not used
- uint16_t reserved2; // Not used
- uint32_t offset; // Offset to image data in bytes from beginning of file
- uint32_t dib_header_size; // DIB header size in bytes
- int32_t width_px; // Width of the image
- int32_t height_px; // Height of image
- uint16_t num_planes; // Number of colour planes
- uint16_t bits_per_pixel; // Bits per pixel
- uint32_t compression; // Compression type
- uint32_t image_size_bytes; // Image size in bytes
- int32_t x_resolution_ppm; // Pixels per meter
- int32_t y_resolution_ppm; // Pixels per meter
- uint32_t num_colours; // Number of colours
- uint32_t important_colours; // Important colours
- } header;
-#pragma pack(pop)
-
- FILE* file = nullptr;
- bool header_validated = false;
- uint32_t palette_size = 0;
- std::vector<colour_t> palette;
-
- public:
- static constexpr uint32_t PALETTE_COLOUR_SIZE = sizeof(colour_t);
-
- BMP() = default;
- ~BMP();
-
- return_t open(char const* filepath);
- return_t read_header();
- return_t read_palette();
- void close();
- void reset();
-
- std::vector<colour_t> const& get_palette() const;
- };
-}