TinyURDF 1.0.0
A Modern C++ Library for Parsing and Visualizing URDF Model Files
Loading...
Searching...
No Matches
Image< T, Channels > Class Template Reference

#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)
 
T * data () noexcept
 Get direct access to the underlying data.
 
const T * data () const noexcept
 
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
 

Member Typedef Documentation

◆ value_type

template<typename T = double, std::size_t Channels = 4>
using Image< T, Channels >::value_type = T

Alias for the type used to represent individual pixel values.

Constructor & Destructor Documentation

◆ Image() [1/5]

template<typename T , std::size_t Channels>
Image< T, Channels >::Image ( )

Default-construct a new image object.

◆ Image() [2/5]

template<typename T , std::size_t Channels>
Image< T, Channels >::Image ( const Image< T, Channels > &  other)

Copy-construct a new image object.

◆ Image() [3/5]

template<typename T , std::size_t Channels>
Image< T, Channels >::Image ( Image< T, Channels > &&  other)
noexcept

Move-construct a new image object.

◆ Image() [4/5]

template<typename T , std::size_t Channels>
Image< T, Channels >::Image ( std::size_t  width,
std::size_t  height 
)

Construct a new image object with the given width and height.

◆ Image() [5/5]

template<typename T , std::size_t Channels>
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:

  • Planar memory layout (i.e. all red samples before all green samples before all blue samples, etc.)

Member Function Documentation

◆ channels()

template<typename T , std::size_t Channels>
constexpr std::size_t Image< T, Channels >::channels ( ) const
constexpr

Get the number of channels in the image.

◆ data() [1/2]

template<typename T , std::size_t Channels>
const T * Image< T, Channels >::data ( ) const
noexcept

◆ data() [2/2]

template<typename T , std::size_t Channels>
T * Image< T, Channels >::data ( )
noexcept

Get direct access to the underlying data.

◆ height()

template<typename T , std::size_t Channels>
std::size_t Image< T, Channels >::height ( ) const

Get the height of the image.

◆ operator[]() [1/2]

template<typename T , std::size_t Channels>
T & Image< T, Channels >::operator[] ( std::size_t  offset)

Get a reference to the sample at the specified offset.

◆ operator[]() [2/2]

template<typename T , std::size_t Channels>
const T & Image< T, Channels >::operator[] ( std::size_t  offset) const

◆ size()

template<typename T , std::size_t Channels>
constexpr std::size_t Image< T, Channels >::size ( ) const
constexpr

Get the size of the data array containing the image.

◆ width()

template<typename T , std::size_t Channels>
std::size_t Image< T, Channels >::width ( ) const

Get the width of the image.


The documentation for this class was generated from the following files: