1#ifndef INCLUDE_TINYURDF_CORE_IMAGE_H_
2#define INCLUDE_TINYURDF_CORE_IMAGE_H_
8#include <stb/stb_image.h>
9#include <loguru/loguru.hpp>
17template <
typename T =
double, std::
size_t Channels = 4>
51 const T*
data() const noexcept;
54 std::
size_t width() const;
57 std::
size_t height() const;
60 constexpr std::
size_t channels() const;
63 constexpr std::
size_t size() const;
66 T& operator[](std::
size_t offset);
69 const T& operator[](std::
size_t offset) const;
77 std::vector<T> m_data;
base image class definition
Definition image.h:18
constexpr std::size_t size() const
Get the size of the data array containing the image.
Definition image.cc:49
T value_type
Alias for the type used to represent individual pixel values.
Definition image.h:21
T * data() noexcept
get direct access to the underlying data
Definition image.cc:29
constexpr std::size_t channels() const
Get the number of channels in the image.
Definition image.cc:44
Image & imread(const std::string &filename)
Load an image from a file.
Definition image.cc:75
Image()
Default-construct a new image object.
Definition image.cc:5
std::size_t width() const
Get the width of the image.
Definition image.cc:34
std::size_t height() const
Get the height of the image.
Definition image.cc:39