37 using reference = value_type&;
38 using const_reference = value_type
const&;
39 using pointer = value_type *;
40 using const_pointer = value_type
const *;
41 using row_type = std::span<value_type>;
42 using const_row_type = std::span<value_type const>;
43 using nc_value_type = std::remove_const_t<value_type>;
44 using size_type = size_t;
46 template<
typename PixmapView>
58 constexpr row_iterator &operator++()
noexcept { ++_y;
return *
this; }
59 constexpr row_iterator &operator++(
int)
noexcept {
auto tmp = *
this; ++_y;
return tmp; }
60 constexpr row_iterator &operator--()
noexcept { --_y;
return *
this; }
61 constexpr row_iterator &operator--(
int)
noexcept {
auto tmp = *
this; --_y;
return tmp; }
62 [[
nodiscard]]
constexpr auto operator*()
const noexcept {
return (*_ptr)[_y]; }
66 template<
typename PixmapView>
89 _data(data), _width(width), _height(height), _stride(stride)
98 template<std::same_as<std::remove_const_t<value_type>> O,
typename Allocator>
104 template<std::same_as<std::remove_const_t<value_type>> O,
typename Allocator>
110 template<std::same_as<std::remove_const_t<value_type>> O,
typename Allocator>
115 return _width == 0
and _height == 0;
143 constexpr reference operator()(size_type x, size_type y)
noexcept
145 hi_axiom(x < _width);
146 hi_axiom(y < _height);
147 return _data[y * _stride + x];
150 constexpr const_reference operator()(size_type x, size_type y)
const noexcept
152 hi_axiom(x < _width);
153 hi_axiom(y < _height);
154 return _data[y * _stride + x];
157 [[
nodiscard]]
constexpr row_type operator[](size_type y)
noexcept
159 hi_axiom(y < _height);
160 return {_data + y * _stride, _width};
163 [[
nodiscard]]
constexpr const_row_type operator[](size_type y)
const noexcept
165 hi_axiom(y < _height);
166 return {_data + y * _stride, _width};
171 return row_range{
this};
176 return row_range{
this};
185 subimage(size_type x, size_type y, size_type
new_width, size_type
new_height)
const noexcept
190 constexpr friend void copy(pixmap_span
src, pixmap_span<std::remove_const_t<value_type>>
dst)
noexcept
192 hi_axiom(
src.width() ==
dst.width());
193 hi_axiom(
src.height() ==
dst.height());
198 for (
auto y = 0
_uz; y !=
src.height(); ++y) {
206 constexpr friend void fill(pixmap_span
dst, value_type value = value_type{})
noexcept
208 if (
dst._width ==
dst._stride) {
211 for (
auto line:
dst.rows()) {
212 std::fill(line.begin(), line.end(), value);
218 value_type *_data =
nullptr;
219 size_type _width = 0;
220 size_type _height = 0;
221 size_type _stride = 0;