OpenEnroth 0259030
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
 
int width () const
 
int height () const
 
Sizei size () const
 
Recti geometry () const
 
std::span< T > operator[] (size_t y)
 
std::span< const T > operator[] (size_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 (int width, int height)
 
static Image uninitialized (Sizei size)
 
static Image solid (T color, int width, int height)
 
static Image solid (T color, Sizei size)
 
static Image copy (const T *pixels, int width, int height)
 
static Image copy (const T *pixels, Sizei size)
 
static Image copy (const Image &other)
 

Additional Inherited Members

- Protected Attributes inherited from detail::ImageBase< T, std::unique_ptr< T, FreeDeleter > >
int _width
 
int _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/3]

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/3]

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

Creates an image by copying the provided pixel buffer.

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

◆ copy() [3/3]

template<class T >
static Image Image< T >::copy ( const T *  pixels,
Sizei  size 
)
inlinestatic

◆ 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() [1/2]

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

Creates a solid-filled image of given size.

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

◆ solid() [2/2]

template<class T >
static Image Image< T >::solid ( color,
Sizei  size 
)
inlinestatic

◆ uninitialized() [1/2]

template<class T >
static Image Image< T >::uninitialized ( int  width,
int  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.

◆ uninitialized() [2/2]

template<class T >
static Image Image< T >::uninitialized ( Sizei  size)
inlinestatic

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