IOLink  IOL_v1.2.0_release
iolink::ImageType Class Reference

A flag system that describes the dimensions of an image. More...

#include <iolink/ImageType.h>

Public Member Functions

 ImageType ()
 Create an ImageType with no known dimensions.
 
 ImageType (ImageDimension dimension)
 Create an ImageType with only one given dimension.
 
 ImageType (const ImageDimension *dimensionsList, size_t count)
 Create an ImageType with a list of dimensions (C array style)
 
 ImageType (std::initializer_list< ImageDimension > dimensionsList)
 Create an ImageType with a list of dimensions.
 
 ImageType (uint64_t val)
 Create an ImageType from an 64-bits integer.
 
bool has (ImageDimension dimension) const
 Checks if the ImageType has the given dimension. More...
 
void add (ImageDimension dimension)
 Add the given dimension to the ImageType. More...
 
size_t dimensionCount () const
 Give the number of dimensions in the ImageType.
 
void add (ImageType other)
 Add all the dimensions from given ImageType to current ImageType. More...
 
void remove (ImageDimension dimension)
 Remove the given dimension to the ImageType. More...
 
void remove (size_t index)
 Remove the nth dimension to the ImageType. More...
 
void remove (ImageType other)
 Remove all the given dimensions to the ImageType. More...
 
ImageDimension dimension (size_t index) const
 Return the nth dimension at the given position. More...
 
size_t indexDimension (ImageDimension dimension)
 Return the position of given dimension in the current ImageType. More...
 
ImageType operator| (ImageDimension rhs) const
 Equivalent to add. More...
 
bool operator== (ImageType other) const
 Equality operator. More...
 
bool operator!= (ImageType other) const
 Not-Equality operator. More...
 
std::string toString () const
 Return string interpretation.
 
uint64_t value () const
 Return internal 64-bit integer value.
 

Friends

ImageType operator| (ImageDimension lhs, ImageDimension rhs)
 Binary Operator to combine two dimensions. More...
 
ImageType operator| (ImageDimension lhs, ImageType rhs)
 Binary Operator to combine a dimension with an ImageType. More...
 

Detailed Description

A flag system that describes the dimensions of an image.

An image is firstly defined by its dimensions.

i.e.

  • a classic Image has COLUMN and ROW dimensions
  • a volume has COLUMN, ROW and SLICE dimensions Concerning the order of dimensions, it follows ImageDimension values order.

Member Function Documentation

◆ add() [1/2]

void iolink::ImageType::add ( ImageDimension  dimension)

Add the given dimension to the ImageType.

Parameters
dimensiondimension to add in the ImageType

◆ add() [2/2]

void iolink::ImageType::add ( ImageType  other)

Add all the dimensions from given ImageType to current ImageType.

Parameters
otherImageType whose dimensions must be added into the current ImageType

◆ dimension()

ImageDimension iolink::ImageType::dimension ( size_t  index) const

Return the nth dimension at the given position.

e.g. in an IMAGE_SEQUENCE: COLUMN is the dimension returned for index = 0 ROW is the dimension returned for index = 1 SEQUENCE is the dimension returned for index = 2

Exceptions
Errorif index does not exist in current ImageType
Parameters
indexdimension index in the ImageType
Returns
the dimension corresponding to the given index

◆ has()

bool iolink::ImageType::has ( ImageDimension  dimension) const

Checks if the ImageType has the given dimension.

Parameters
dimensiondimension presence to be checked
Returns
TRUE if dimension is present in the ImageType

◆ indexDimension()

size_t iolink::ImageType::indexDimension ( ImageDimension  dimension)

Return the position of given dimension in the current ImageType.

e.g. in an IMAGE_SEQUENCE: COLUMN is the first dimension (idx = 0 is returned) ROW is the second dimension (idx = 1 is returned) SEQUENCE is the 3th dimension (idx= 2 is returned)

Parameters
dimensionthe dimension whom you want to get the index in the current ImageType
Returns
-1 if the dimension is not present, otherwise the position (index) in current ImageType

◆ operator!=()

bool iolink::ImageType::operator!= ( ImageType  other) const

Not-Equality operator.

Parameters
otherRight operand which represents a ImageType to compare to current one
Returns
TRUE if ImageType is NOT equal to current one

◆ operator==()

bool iolink::ImageType::operator== ( ImageType  other) const

Equality operator.

Parameters
otherRight operand which represents a ImageType to compare to current one
Returns
TRUE if ImageType is equal to current one

◆ operator|()

ImageType iolink::ImageType::operator| ( ImageDimension  rhs) const

Equivalent to add.

Parameters
rhsRight operand which represents a dimension to add to current ImageType
Returns
ImageType with new given dimension

◆ remove() [1/3]

void iolink::ImageType::remove ( ImageDimension  dimension)

Remove the given dimension to the ImageType.

Parameters
dimensiondimension to remove from ImageType

◆ remove() [2/3]

void iolink::ImageType::remove ( ImageType  other)

Remove all the given dimensions to the ImageType.

Parameters
otherImageType whose dimensions must be removed from current ImageType

◆ remove() [3/3]

void iolink::ImageType::remove ( size_t  index)

Remove the nth dimension to the ImageType.

Parameters
indexindex of the dimension to remove

Friends And Related Function Documentation

◆ operator| [1/2]

ImageType operator| ( ImageDimension  lhs,
ImageDimension  rhs 
)
friend

Binary Operator to combine two dimensions.

Parameters
lhsleft operand - ImageDimension
rhsright operand - ImageDimension
Returns
a ImageType which contains dimensions from left and right operands

◆ operator| [2/2]

ImageType operator| ( ImageDimension  lhs,
ImageType  rhs 
)
friend

Binary Operator to combine a dimension with an ImageType.

Parameters
lhsleft operand - ImageDimension
rhsleft operand - ImageType
Returns
a ImageType which contains dimensions from left operand and dimensions contained in right operand

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