TinyURDF 1.0.0
|
base image class definition
More...
#include <image.h>
Public Types | |
using | value_type = T |
Alias for the type used to represent individual pixel values. | |
Public Member Functions | |
Image () | |
Default-construct a new image object. | |
Image (const Image &other) | |
Copy-construct a new image object. | |
Image (Image &&other) noexcept | |
Move-construct a new image object. | |
Image (std::size_t width, std::size_t height) | |
Construct a new image object with the given width and height. | |
Image (const T *data, std::size_t width, std::size_t height) | |
construct a new image object with the given width and height and initialize it with the provided data. The data array is assumed to have the following properties: | |
Image & | imread (const std::string &filename) |
Load an image from a file. | |
T * | data () noexcept |
get direct access to the underlying data | |
const T * | data () const noexcept |
get direct access to the underlying data | |
std::size_t | width () const |
Get the width of the image. | |
std::size_t | height () const |
Get the height of the image. | |
constexpr std::size_t | channels () const |
Get the number of channels in the image. | |
constexpr std::size_t | size () const |
Get the size of the data array containing the image. | |
T & | operator[] (std::size_t offset) |
Get a reference to the sample at the specified offset. | |
const T & | operator[] (std::size_t offset) const |
Get a reference to the sample at the specified offset. | |
Image & | operator= (const Image &other) |
copy assign operator | |
base image class definition
T | image data type storage |
Channels |
using Image< T, Channels >::value_type = T |
Alias for the type used to represent individual pixel values.
Default-construct a new image object.
Image< T, Channels >::Image | ( | const Image< T, Channels > & | other | ) |
Copy-construct a new image object.
|
noexcept |
Move-construct a new image object.
Image< T, Channels >::Image | ( | std::size_t | width, |
std::size_t | height | ||
) |
Construct a new image object with the given width and height.
Image< T, Channels >::Image | ( | const T * | data, |
std::size_t | width, | ||
std::size_t | height | ||
) |
construct a new image object with the given width and height and initialize it with the provided data. The data array is assumed to have the following properties:
|
constexpr |
Get the number of channels in the image.
|
noexcept |
get direct access to the underlying data
|
noexcept |
get direct access to the underlying data
std::size_t Image< T, Channels >::height | ( | ) | const |
Get the height of the image.
Image< T, Channels > & Image< T, Channels >::imread | ( | const std::string & | filename | ) |
Load an image from a file.
Image< T, Channels > & Image< T, Channels >::operator= | ( | const Image< T, Channels > & | other | ) |
copy assign operator
T & Image< T, Channels >::operator[] | ( | std::size_t | offset | ) |
Get a reference to the sample at the specified offset.
const T & Image< T, Channels >::operator[] | ( | std::size_t | offset | ) | const |
Get a reference to the sample at the specified offset.
|
constexpr |
Get the size of the data array containing the image.
std::size_t Image< T, Channels >::width | ( | ) | const |
Get the width of the image.