mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-23 14:57:29 +00:00
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:
@@ -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__*/
|
||||
|
Reference in New Issue
Block a user