24#include "rawspeedconfig.h"
56 [[nodiscard]]
int RAWSPEED_READONLY
pitch() const;
57 [[nodiscard]]
int RAWSPEED_READONLY
width() const;
58 [[nodiscard]]
int RAWSPEED_READONLY
height() const;
67 template <typename T2>
68 requires(std::is_const_v<T2> && !std::is_const_v<
T>)
72 template <typename T2>
73 requires(!(std::is_const_v<T2> && !std::is_const_v<
T>) &&
74 !std::is_same_v<std::remove_const_t<
T>, std::remove_const_t<T2>> &&
75 !std::is_same_v<std::remove_const_t<
T>, std::
byte>)
79 template <typename T2>
80 requires(!std::is_const_v<T2> && std::is_const_v<
T> &&
81 std::is_same_v<std::remove_const_t<
T>, std::remove_const_t<T2>>)
86 template <
typename T2>
88 !(std::is_const_v<T2> && !std::is_const_v<T>) &&
89 !(std::is_same_v<std::remove_const_t<T>, std::remove_const_t<T2>>) &&
90 std::is_same_v<std::remove_const_t<T>, std::byte>)
93 sizeof(T2) * RHS.
_pitch) {}
95 template <
typename AllocatorType =
96 typename std::vector<cvless_value_type>::allocator_type>
98 create(std::vector<cvless_value_type, AllocatorType>& storage,
int width,
100 using VectorTy = std::remove_reference_t<
decltype(storage)>;
134 invariant((_width == 0) == (_height == 0));
135 invariant(data.size() == _pitch * _height);
140 const int height_,
const int pitch_)
141 : data(data_), _pitch(pitch_), _width(width_), _height(height_) {
142 establishClassInvariants();
148 :
Array2DRef({data_, pitch_ * height_}, width_, height_, pitch_) {
149 establishClassInvariants();
154 :
Array2DRef(data_, width_, height_, width_) {
160 establishClassInvariants();
166 establishClassInvariants();
172 establishClassInvariants();
179 establishClassInvariants();
180 if (height() == 1 || _pitch == width())
181 return data.getCrop(0, width() * height()).getAsArray1DRef();
187 establishClassInvariants();
190 return data.getCrop(row * _pitch, width()).getAsArray1DRef();
196 establishClassInvariants();
199 return (
operator[](row))(col);
Array2DRef(Array1DRef< T > data, int width, int height, int pitch)
T & operator()(int row, int col) const
Array2DRef(Array2DRef< T2 > RHS)
int RAWSPEED_READONLY height() const
Array1DRef< T > operator[](int row) const
std::remove_cv_t< value_type > cvless_value_type
static Array2DRef< T > create(std::vector< cvless_value_type, AllocatorType > &storage, int width, int height)
int RAWSPEED_READONLY pitch() const
Optional< Array1DRef< T > > getAsArray1DRef() const
void establishClassInvariants() const noexcept
int RAWSPEED_READONLY width() const
Array2DRef(Array1DRef< T > data, int width, int height, int pitch) -> Array2DRef< T >
__attribute__((noinline)) __attribute__((visibility("default"))) JPEGStuffedByteStreamGenerator