Sirius  0.0.0
Public Member Functions | Public Attributes | List of all members
sirius::Image Class Reference

Data class that represents an image (Size + Buffer) More...

#include <sirius/image.h>

Public Member Functions

 Image ()=default
 
 Image (const Size &size)
 Instanciate an image of the given size and pre-allocate its buffer with 0. More...
 
 Image (const Size &size, Buffer &&buffer)
 Instanciate an image of the given size with data. More...
 
 ~Image ()=default
 
 Image (const Image &)=default
 
Imageoperator= (const Image &)=default
 
 Image (Image &&)
 
Imageoperator= (Image &&)
 
int CellCount () const
 Get the cell count of the image (row x col) More...
 
Buffer::value_type Get (int row, int col) const
 Get the value at cell (row, col) Row and col starts at 0. More...
 
void Set (int row, int col, Buffer::value_type val)
 Set the value at cell (row, col) Row and col starts at 0. More...
 
bool IsLoaded () const
 Check that the image is loaded Row, col and data are set. More...
 
Image CreatePaddedImage (const Padding &padding) const
 Create padded image from the current image. More...
 
Image CreateZeroPaddedImage (const Padding &zero_padding) const
 Create a zero padded image from the current image. More...
 
Image CreateMirrorPaddedImage (const Padding &mirror_padding) const
 Create a padded image using mirroring on borders. More...
 
void CreateEvenImage ()
 add row and col according to odd dim of calling image More...
 

Public Attributes

Size size {0, 0}
 
Buffer data
 

Detailed Description

Data class that represents an image (Size + Buffer)

Constructor & Destructor Documentation

◆ Image() [1/5]

sirius::Image::Image ( )
default

◆ Image() [2/5]

sirius::Image::Image ( const Size size)
explicit

Instanciate an image of the given size and pre-allocate its buffer with 0.

Parameters
sizeimage size

◆ Image() [3/5]

sirius::Image::Image ( const Size size,
Buffer &&  buffer 
)

Instanciate an image of the given size with data.

Parameters
sizeimage size
bufferimage buffer

◆ ~Image()

sirius::Image::~Image ( )
default

◆ Image() [4/5]

sirius::Image::Image ( const Image )
default

◆ Image() [5/5]

sirius::Image::Image ( Image &&  )

Member Function Documentation

◆ CellCount()

int sirius::Image::CellCount ( ) const
inline

Get the cell count of the image (row x col)

Returns
cell count

◆ CreateEvenImage()

void sirius::Image::CreateEvenImage ( )

add row and col according to odd dim of calling image

◆ CreateMirrorPaddedImage()

Image sirius::Image::CreateMirrorPaddedImage ( const Padding mirror_padding) const

Create a padded image using mirroring on borders.

Parameters
padding_sizesize of the margins
Returns
generated image

◆ CreatePaddedImage()

Image sirius::Image::CreatePaddedImage ( const Padding padding) const

Create padded image from the current image.

Padding strategy is selected according to padding.type

Parameters
paddingpadding to apply
Returns
generated image

◆ CreateZeroPaddedImage()

Image sirius::Image::CreateZeroPaddedImage ( const Padding zero_padding) const

Create a zero padded image from the current image.

Parameters
zero_paddingpadding to apply
Returns
generated image

◆ Get()

Buffer::value_type sirius::Image::Get ( int  row,
int  col 
) const
inline

Get the value at cell (row, col) Row and col starts at 0.

Returns
value

◆ IsLoaded()

bool sirius::Image::IsLoaded ( ) const
inline

Check that the image is loaded Row, col and data are set.

Returns
bool

◆ operator=() [1/2]

Image& sirius::Image::operator= ( const Image )
default

◆ operator=() [2/2]

Image& sirius::Image::operator= ( Image &&  )

◆ Set()

void sirius::Image::Set ( int  row,
int  col,
Buffer::value_type  val 
)
inline

Set the value at cell (row, col) Row and col starts at 0.

Member Data Documentation

◆ data

Buffer sirius::Image::data

◆ size

Size sirius::Image::size {0, 0}

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