hyperion.ng
Public Types | Public Member Functions | List of all members
Image< Pixel_T > Class Template Reference

Public Types

typedef Pixel_T pixel_type
 

Public Member Functions

 Image ()
 Default constructor for an image.
 
 Image (const unsigned width, const unsigned height)
 Constructor for an image with specified width and height. More...
 
 Image (const unsigned width, const unsigned height, const Pixel_T background)
 Constructor for an image with specified width and height. More...
 
 Image (const Image &other)
 Copy constructor for an image.
 
Imageoperator= (Image rhs)
 
void swap (Image &s) noexcept
 
 Image (Image &&src) noexcept
 
Imageoperator= (Image &&src) noexcept
 
 ~Image ()
 Destructor.
 
unsigned width () const
 Returns the width of the image. More...
 
unsigned height () const
 Returns the height of the image. More...
 
uint8_t red (const unsigned pixel) const
 
uint8_t green (const unsigned pixel) const
 
uint8_t blue (const unsigned pixel) const
 
const Pixel_T & operator() (const unsigned x, const unsigned y) const
 Returns a const reference to a specified pixel in the image. More...
 
Pixel_T & operator() (const unsigned x, const unsigned y)
 Returns a reference to a specified pixel in the image. More...
 
void resize (const unsigned width, const unsigned height)
 Resize the image. More...
 
void copy (const Image< Pixel_T > &other)
 Copies another image into this image. More...
 
Pixel_T * memptr ()
 Returns a memory pointer to the first pixel in the image. More...
 
const Pixel_T * memptr () const
 Returns a const memory pointer to the first pixel in the image. More...
 
void toRgb (Image< ColorRgb > &image)
 Convert image of any color order to a RGB image. More...
 
ssize_t size () const
 get size of buffer
 

Constructor & Destructor Documentation

§ Image() [1/2]

template<typename Pixel_T>
Image< Pixel_T >::Image ( const unsigned  width,
const unsigned  height 
)
inline

Constructor for an image with specified width and height.

Parameters
widthThe width of the image
heightThe height of the image

§ Image() [2/2]

template<typename Pixel_T>
Image< Pixel_T >::Image ( const unsigned  width,
const unsigned  height,
const Pixel_T  background 
)
inline

Constructor for an image with specified width and height.

Parameters
widthThe width of the image
heightThe height of the image
backgroundThe color of the image

Member Function Documentation

§ copy()

template<typename Pixel_T>
void Image< Pixel_T >::copy ( const Image< Pixel_T > &  other)
inline

Copies another image into this image.

The images should have exactly the same size.

Parameters
otherThe image to copy into this

§ height()

template<typename Pixel_T>
unsigned Image< Pixel_T >::height ( ) const
inline

Returns the height of the image.

Returns
The height of the image

§ memptr() [1/2]

template<typename Pixel_T>
Pixel_T* Image< Pixel_T >::memptr ( )
inline

Returns a memory pointer to the first pixel in the image.

Returns
The memory pointer to the first pixel

§ memptr() [2/2]

template<typename Pixel_T>
const Pixel_T* Image< Pixel_T >::memptr ( ) const
inline

Returns a const memory pointer to the first pixel in the image.

Returns
The const memory pointer to the first pixel

§ operator()() [1/2]

template<typename Pixel_T>
const Pixel_T& Image< Pixel_T >::operator() ( const unsigned  x,
const unsigned  y 
) const
inline

Returns a const reference to a specified pixel in the image.

Parameters
xThe x index
yThe y index
Returns
const reference to specified pixel

§ operator()() [2/2]

template<typename Pixel_T>
Pixel_T& Image< Pixel_T >::operator() ( const unsigned  x,
const unsigned  y 
)
inline

Returns a reference to a specified pixel in the image.

Parameters
xThe x index
yThe y index
Returns
reference to specified pixel

§ resize()

template<typename Pixel_T>
void Image< Pixel_T >::resize ( const unsigned  width,
const unsigned  height 
)
inline

Resize the image.

Parameters
widthThe width of the image
heightThe height of the image

§ toRgb()

template<typename Pixel_T>
void Image< Pixel_T >::toRgb ( Image< ColorRgb > &  image)
inline

Convert image of any color order to a RGB image.

Parameters
[out]imageThe image that buffers the output

§ width()

template<typename Pixel_T>
unsigned Image< Pixel_T >::width ( ) const
inline

Returns the width of the image.

Returns
The width of the image

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