Formatted code (#1007)

* Updated style

* Updated files

* fixed new line

* Updated spacing

* File fix WIP

* Updated to clang 13

* updated comment style

* Removed old comment code
This commit is contained in:
jLynx
2023-05-19 08:16:05 +12:00
committed by GitHub
parent 7aca7ce74d
commit 033c4e9a5b
599 changed files with 70746 additions and 66896 deletions

View File

@@ -32,33 +32,33 @@
#include "crc.hpp"
class PNGWriter {
public:
~PNGWriter();
public:
~PNGWriter();
Optional<File::Error> create(const std::filesystem::path& filename);
void write_scanline(const std::array<ui::ColorRGB888, 240>& scanline);
Optional<File::Error> create(const std::filesystem::path& filename);
private:
// TODO: These constants are baked in a few places, do not change blithely.
static constexpr int width { 240 };
static constexpr int height { 320 };
void write_scanline(const std::array<ui::ColorRGB888, 240>& scanline);
File file { };
int scanline_count { 0 };
CRC<32, true, true> crc { 0x04c11db7, 0xffffffff, 0xffffffff };
Adler32 adler_32 { };
private:
// TODO: These constants are baked in a few places, do not change blithely.
static constexpr int width{240};
static constexpr int height{320};
void write_chunk_header(const size_t length, const std::array<uint8_t, 4>& type);
void write_chunk_content(const void* const p, const size_t count);
File file{};
int scanline_count{0};
CRC<32, true, true> crc{0x04c11db7, 0xffffffff, 0xffffffff};
Adler32 adler_32{};
template<size_t N>
void write_chunk_content(const std::array<uint8_t, N>& data) {
write_chunk_content(data.data(), sizeof(data));
}
void write_chunk_header(const size_t length, const std::array<uint8_t, 4>& type);
void write_chunk_content(const void* const p, const size_t count);
void write_chunk_crc();
void write_uint32_be(const uint32_t v);
template <size_t N>
void write_chunk_content(const std::array<uint8_t, N>& data) {
write_chunk_content(data.data(), sizeof(data));
}
void write_chunk_crc();
void write_uint32_be(const uint32_t v);
};
#endif/*__PNG_WRITER_H__*/
#endif /*__PNG_WRITER_H__*/