Grid2¶
File: samarium/util/Grid2.hpp
Hold values on a (contiguous) 2d grid
-
namespace sm
Typedefs
Functions
-
constexpr auto convert_1d_to_2d(Dimensions dims, u64 index)¶
-
constexpr auto convert_2d_to_1d(Dimensions dims, Indices coordinates)¶
-
inline auto iota_view_2d(Dimensions dims)¶
-
inline auto subdivide_box(Box2<f64> box, Dimensions rows_cols, f64 scale = 1.0)¶
Variables
-
static constexpr auto dims4K = Dimensions{3840UL, 2160UL}¶
-
static constexpr auto dimsFHD = Dimensions{1920UL, 1080UL}¶
-
static constexpr auto dims720 = Dimensions{1280UL, 720UL}¶
-
static constexpr auto dims480 = Dimensions{640UL, 480UL}¶
-
static constexpr auto dimsP2 = Dimensions{2048UL, 1024UL}¶
-
template<typename T>
class Grid2¶ -
Public Functions
-
inline explicit Grid2(Dimensions dims_)¶
-
inline Grid2(Dimensions dims_, T init_value)¶
-
inline explicit Grid2(std::span<const T> span, Dimensions dims_)¶
-
inline auto operator[](Indices indices) const -> const_reference¶
-
inline auto operator[](u64 index) const noexcept -> const_reference¶
-
inline auto at(Indices indices) const -> const_reference¶
-
inline auto at(u64 index) const -> const_reference¶
-
inline auto begin()¶
-
inline auto end()¶
-
inline auto begin() const¶
-
inline auto end() const¶
-
inline auto cbegin() const¶
-
inline auto cend() const¶
-
inline auto front() const -> const_reference¶
-
inline auto back() const -> const_reference¶
-
inline auto size() const¶
-
inline auto empty() const¶
-
inline auto bounding_box() const¶
-
inline auto span()¶
-
inline const_iterator data() const¶
-
inline auto upscale(u64 upscale_factor) const¶
-
inline auto enumerate_1d()¶
-
inline auto enumerate_2d()¶
-
inline auto byte_size() const¶
Public Static Functions
-
template<typename Fn>
static inline auto generate(Dimensions dims, Fn &&fn)¶
-
inline explicit Grid2(Dimensions dims_)¶
-
constexpr auto convert_1d_to_2d(Dimensions dims, u64 index)¶