3.3.2.22. Class Image

3.3.2.22.1. Class Documentation

class Image

Data class that represents an image (Size + Buffer)

Public Functions

Image()
Image(const Size &size)

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

Parameters
  • size: image size

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

Instanciate an image of the given size with data.

Parameters
  • size: image size
  • buffer: image buffer

~Image()
Image(const Image&)
Image &operator=(const Image&)
Image(Image&&)
Image &operator=(Image&&)
int CellCount() const

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

Return
cell count

Buffer::value_type Get(int row, int col) const

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

Return
value

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

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

bool IsLoaded() const

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

Return
bool

Image CreatePaddedImage(const Padding &padding) const

Create padded image from the current image.

Padding strategy is selected according to padding.type

Return
generated image
Parameters
  • padding: padding to apply

Image CreateZeroPaddedImage(const Padding &zero_padding) const

Create a zero padded image from the current image.

Return
generated image
Parameters
  • zero_padding: padding to apply

Image CreateMirrorPaddedImage(const Padding &mirror_padding) const

Create a padded image using mirroring on borders.

Return
generated image
Parameters
  • padding_size: size of the margins

void CreateEvenImage()

add row and col according to odd dim of calling image

Public Members

Size size = {0, 0}
Buffer data