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

Represents a 2D point with floating-point coordinates. More...

#include <Image.h>

Collaboration diagram for PointXy:
[legend]

Public Member Functions

 PointXy ()
 Default constructor initialising point to (-1.0, -1.0).
 
 PointXy (float x_, float y_)
 Constructor initialising point with given coordinates.
 
void operator= (const PointXy &other)
 Assignment operator.
 
bool operator== (const PointXy &rhs) const
 Equality comparison operator.
 
void ToIndex (int &x_index, int &y_index)
 Converts floating-point coordinates to integer indices.
 
bool InImage (int xrange, int yrange)
 Checks if the point is within the given image axis ranges.
 

Public Attributes

float x
 X-coordinate of the point.
 
float y
 Y-coordinate of the point.
 

Detailed Description

Represents a 2D point with floating-point coordinates.

This struct provides basic operations for handling 2D points, such as assignment, comparison, and checking if a point is within image bounds.

Constructor & Destructor Documentation

◆ PointXy() [1/2]

PointXy::PointXy ( )
inline

Default constructor initialising point to (-1.0, -1.0).

◆ PointXy() [2/2]

PointXy::PointXy ( float  x_,
float  y_ 
)
inline

Constructor initialising point with given coordinates.

Parameters
x_The x-coordinate.
y_The y-coordinate.

Member Function Documentation

◆ InImage()

bool PointXy::InImage ( int  xrange,
int  yrange 
)
inline

Checks if the point is within the given image axis ranges.

Parameters
xrangeThe width of the image.
yrangeThe height of the image.
Returns
True if the point is within the image bounds, false otherwise.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

void PointXy::operator= ( const PointXy other)
inline

Assignment operator.

Parameters
otherThe point to assign from.

◆ operator==()

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

Equality comparison operator.

Parameters
rhsThe point to compare with.
Returns
True if the points have the same coordinates, false otherwise.

◆ ToIndex()

void PointXy::ToIndex ( int &  x_index,
int &  y_index 
)
inline

Converts floating-point coordinates to integer indices.

Parameters
x_indexReference to store the X-coordinate index.
y_indexReference to store the Y-coordinate index.
Here is the caller graph for this function:

Member Data Documentation

◆ x

float PointXy::x

X-coordinate of the point.

◆ y

float PointXy::y

Y-coordinate of the point.


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