CARTA Backend
The backend component of CARTA
Loading...
Searching...
No Matches
AxisRange Struct Reference

Represents a range along an axis. More...

#include <Image.h>

Collaboration diagram for AxisRange:
[legend]

Public Member Functions

 AxisRange ()
 Default constructor initialising the range from 0 to ALL_Z.
 
 AxisRange (int from_and_to_)
 Constructs a range with the same start and end value.
 
 AxisRange (int from_, int to_)
 Constructs a range with a specified start and end.
 
bool operator== (const AxisRange &rhs) const
 Checks if two AxisRange objects are equal.
 
bool operator!= (const AxisRange &rhs) const
 Checks if two AxisRange objects are not equal.
 
bool is_in_range (int val) const
 Determines if a value falls within the range.
 

Public Attributes

int from
 The start of the range.
 
int to
 The end of the range.
 

Detailed Description

Represents a range along an axis.

This struct stores a range with from and to values, providing constructors for different initialization scenarios and utility functions for comparison and range checking.

Constructor & Destructor Documentation

◆ AxisRange() [1/3]

AxisRange::AxisRange ( )
inline

Default constructor initialising the range from 0 to ALL_Z.

◆ AxisRange() [2/3]

AxisRange::AxisRange ( int  from_and_to_)
inline

Constructs a range with the same start and end value.

Parameters
from_and_to_The value for both from and to.

◆ AxisRange() [3/3]

AxisRange::AxisRange ( int  from_,
int  to_ 
)
inline

Constructs a range with a specified start and end.

Parameters
from_The start of the range.
to_The end of the range.

Member Function Documentation

◆ is_in_range()

bool AxisRange::is_in_range ( int  val) const
inline

Determines if a value falls within the range.

Parameters
valThe value to check.
Returns
true if val is within the range [from, to], false otherwise.

◆ operator!=()

bool AxisRange::operator!= ( const AxisRange rhs) const
inline

Checks if two AxisRange objects are not equal.

Two AxisRange objects are considered not equal if either their from or to values differ.

Parameters
rhsThe AxisRange to compare.
Returns
true if the two ranges are not equal, false otherwise.

◆ operator==()

bool AxisRange::operator== ( const AxisRange rhs) const
inline

Checks if two AxisRange objects are equal.

Two AxisRange objects are considered equal if both their from and to values match.

Parameters
rhsThe AxisRange to compare.
Returns
true if the two ranges are equal, false otherwise.

Member Data Documentation

◆ from

int AxisRange::from

The start of the range.

◆ to

int AxisRange::to

The end of the range.


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