1#ifndef INCLUDE_TINYURDF_CORE_IMAGE_H_
2#define INCLUDE_TINYURDF_CORE_IMAGE_H_
10template <
typename T =
double, std::
size_t Channels = 4>
33 const T*
data() const noexcept;
35 std::
size_t width() const;
37 std::
size_t height() const;
39 constexpr std::
size_t channels() const;
41 constexpr std::
size_t size() const;
43 T& operator[](std::
size_t offset);
44 const T& operator[](std::
size_t offset) const;
48 std::vector<T> m_data;
constexpr std::size_t size() const
Get the size of the data array containing the image.
Definition image.cc:48
T value_type
Alias for the type used to represent individual pixel values.
Definition image.h:14
T * data() noexcept
Get direct access to the underlying data.
Definition image.cc:23
constexpr std::size_t channels() const
Get the number of channels in the image.
Definition image.cc:43
Image()
Default-construct a new image object.
Definition image.cc:4
std::size_t width() const
Get the width of the image.
Definition image.cc:33
std::size_t height() const
Get the height of the image.
Definition image.cc:38