libCZI
Reading and Writing CZI documents made easy
libCZI::CDimBounds Class Reference

Implementation of a class representing an interval (and implementing the libCZI::IDimBounds-interface). More...

#include <libCZI_DimCoordinate.h>

Inheritance diagram for libCZI::CDimBounds:
libCZI::CDimBase libCZI::IDimBounds

Public Member Functions

 CDimBounds ()
 Default constructor - the object will contain no valid dimension.
 
 CDimBounds (const IDimBounds *other)
 
 CDimBounds (std::initializer_list< DimensionAndStartSize > list)
 
void Set (libCZI::DimensionIndex dimension, int start, int size)
 
void EnumValidDimensions (const std::function< bool(libCZI::DimensionIndex dim, int start, int size)> &func) const
 
void Clear (libCZI::DimensionIndex dimension)
 
void Clear ()
 Clears this object to its blank/initial state. All dimensions will be set to invalid.
 
bool IsEmpty () const
 
bool TryGetInterval (libCZI::DimensionIndex dim, int *startIndex, int *size) const override
 
- Public Member Functions inherited from libCZI::IDimBounds
bool IsValid (DimensionIndex dim) const
 

Static Public Member Functions

static CDimBounds Parse (const char *str)
 

Additional Inherited Members

- Static Protected Member Functions inherited from libCZI::CDimBase
static std::underlying_type< libCZI::DimensionIndex >::type GetBitIndexForDimension (libCZI::DimensionIndex dim)
 

Detailed Description

Implementation of a class representing an interval (and implementing the libCZI::IDimBounds-interface).

Constructor & Destructor Documentation

◆ CDimBounds() [1/2]

libCZI::CDimBounds::CDimBounds ( const IDimBounds other)
inlineexplicit

Constructor which copies the content of the specified IDimBounds-object.

Parameters
otherThe IDimBounds-object to copy information from.

◆ CDimBounds() [2/2]

libCZI::CDimBounds::CDimBounds ( std::initializer_list< DimensionAndStartSize list)
inline

Construct a libCZI::CDimBounds object from an initializer-list.

Parameters
listThe list of "dimension, start and size".

Member Function Documentation

◆ Clear()

void libCZI::CDimBounds::Clear ( libCZI::DimensionIndex  dimension)
inline

Clears the validity of the specified dimension.

Parameters
dimensionThe dimension.

◆ EnumValidDimensions()

void libCZI::CDimBounds::EnumValidDimensions ( const std::function< bool(libCZI::DimensionIndex dim, int start, int size)> &  func) const
inline

Enumerate valid dimensions.

Parameters
funcThe functor which will be called for all valid dimensions.

◆ IsEmpty()

bool libCZI::CDimBounds::IsEmpty ( ) const
inline

Query if this object is empty - no valid dimensions contained.

Returns
True if empty, false if not.

◆ Parse()

static CDimBounds libCZI::CDimBounds::Parse ( const char *  str)
static

Parse the specified string and construct a CDimBounds-object from the information. The syntax for the string is - a character identifying the dimension (one of 'Z', 'C', 'T', 'R', 'S', 'I', 'H', 'V', 'B') followed by an integer (possibly with a + or -) specifying the start-index, followed by a colon ':', then followed by an integer specifying the size. There can be more than one dimension given, in which case the above sequence is repeated for a different dimension. It is illegal to give the same dimension multiple times. Examples: "T0:10", "T0:5Z0:10", "C0:2T0:10Z0:5".

Exceptions
LibCZIStringParseExceptionThrown when the specified string cannot be parsed because of a syntactical error.
Parameters
strThe string to parse.
Returns
A CDimBounds object constructed from the string.

◆ Set()

void libCZI::CDimBounds::Set ( libCZI::DimensionIndex  dimension,
int  start,
int  size 
)
inline

Sets (for the specified dimension) the start and the size.

Parameters
dimensionThe dimension.
startThe start.
sizeThe size.

◆ TryGetInterval()

bool libCZI::CDimBounds::TryGetInterval ( libCZI::DimensionIndex  dim,
int *  startIndex,
int *  size 
) const
inlineoverridevirtual

Attempts to get interval and size for the specified dimension.

Parameters
dimThe dimemension.
[out]startIndexIf non-null, it will receive the start index.
[out]sizeIf non-null, it will receive the size.
Returns
True if it succeeds, false if it fails.

Implements libCZI::IDimBounds.


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