OpenEnroth 73e68f7
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
Image< T > Class Template Reference

#include <Image.h>

Inheritance diagram for Image< T >:
detail::ImageBase< T, std::unique_ptr< T, FreeDeleter > >

Public Member Functions

 Image ()=default
 
 Image (const Image &)=delete
 
 Image (Image &&)=default
 
Imageoperator= (const Image &)=delete
 
Imageoperator= (Image &&)=default
 
Imageoperator= (const Image< std::remove_const_t< T > > &&other)
 
- Public Member Functions inherited from detail::ImageBase< T, std::unique_ptr< T, FreeDeleter > >
std::span< T > pixels ()
 
std::span< const T > pixels () const
 
ssize_t width () const
 
ssize_t height () const
 
Sizei size () const
 
std::span< T > operator[] (ssize_t y)
 
std::span< const T > operator[] (ssize_t y) const
 
T & operator[] (Pointi point)
 
const T & operator[] (Pointi point) const
 
 operator bool () const
 
void reset ()
 
void fill (const T &color)
 

Static Public Member Functions

static Image uninitialized (ssize_t width, ssize_t height)
 
static Image solid (ssize_t width, ssize_t height, T color)
 
static Image copy (ssize_t width, ssize_t height, const T *pixels)
 
static Image copy (const Image &other)
 

Additional Inherited Members

- Protected Attributes inherited from detail::ImageBase< T, std::unique_ptr< T, FreeDeleter > >
ssize_t _width
 
ssize_t _height
 
std::unique_ptr< T, FreeDeleter_pixels
 

Detailed Description

template<class T>
class Image< T >

Image is a class holding a 2d image, with pixels of type T.

See also
ImageView

Constructor & Destructor Documentation

◆ Image() [1/3]

template<class T >
Image< T >::Image ( )
default

◆ Image() [2/3]

template<class T >
Image< T >::Image ( const Image< T > &  )
delete

◆ Image() [3/3]

template<class T >
Image< T >::Image ( Image< T > &&  )
default

Member Function Documentation

◆ copy() [1/2]

template<class T >
static Image Image< T >::copy ( const Image< T > &  other)
inlinestatic

Creates a copy of another image.

Parameters
otherImage to copy.
Returns
Newly allocated Image containing a copy of other.

◆ copy() [2/2]

template<class T >
static Image Image< T >::copy ( ssize_t  width,
ssize_t  height,
const T *  pixels 
)
inlinestatic

Creates an image by copying the provided pixel buffer.

Parameters
widthPixel buffer width.
heightPixel buffer height.
pixelsPixel buffer to copy.
Returns
Newly allocated Image containing a copy of the provided pixel buffer.

◆ operator=() [1/3]

template<class T >
Image & Image< T >::operator= ( const Image< T > &  )
delete

◆ operator=() [2/3]

template<class T >
Image & Image< T >::operator= ( const Image< std::remove_const_t< T > > &&  other)
inline

◆ operator=() [3/3]

template<class T >
Image & Image< T >::operator= ( Image< T > &&  )
default

◆ solid()

template<class T >
static Image Image< T >::solid ( ssize_t  width,
ssize_t  height,
color 
)
inlinestatic

Creates a solid-filled image of given size.

Parameters
widthRequired image width.
heightRequired image height.
colorColor to use to fill the image.
Returns
Solid-filled image of given size. If width or height is zero, then returns an empty image.

◆ uninitialized()

template<class T >
static Image Image< T >::uninitialized ( ssize_t  width,
ssize_t  height 
)
inlinestatic

Constructs an uninitialized image of given size.

Parameters
widthRequired image width.
heightRequired image height.
Returns
Uninitialized image of given size. If width or height is zero, then returns an empty image.

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