#pragma once #include #include #include #include #include struct Color { uint8_t l{}; }; class Bitmap { public: Bitmap(size_t width, size_t height, const Color& clearColor) : m_width(width), m_height(height), m_data(width * height, clearColor) { } // std::span operator[](size_t row) // { // return {&m_data[row * m_width], m_width}; // }; // std::span operator[](size_t row) const // { // return {&m_data[row * m_width], m_width}; // }; Color* operator[](size_t row) { return &m_data[row * m_width]; }; const Color* operator[](size_t row) const { return &m_data[row * m_width]; }; size_t GetWidth() const { return m_width; } size_t GetHeight() const { return m_height; } private: size_t m_width, m_height; std::vector m_data; };