ddt 1.2.1
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
ddt::ImageCoords Class Reference

#include <imageCoords.hpp>

Public Member Functions

virtual ~ImageCoords ()=default
 

Protected Attributes

ddt::DdtLoggerlogger
 
 ImageCoords (const int image_width, const int image_height, const bool rotate_flag, const bool flip_x_flag, const bool flip_y_flag)
 
void set_logger (ddt::DdtLogger *const in_logger)
 
bool WorldCoordinatesDegreesFromCanvas (const cpl_wcs *const wcs, const double x_canvas, const double y_canvas, double *alpha, double *delta)
 
bool CanvasCoordinatesFromWorldCoordinatesDegrees (const cpl_wcs *const wcs, const double alpha, const double delta, double *const x_canvas, double *const y_canvas)
 
bool WorldCoordinatesDegreesFromImage (const cpl_wcs *const wcs, const double x_image, const double y_image, double *const alpha, double *const delta) const
 
bool ImageCoordinatesFromWorldCoordinatesDegrees (const cpl_wcs *const wcs, const double alpha, const double delta, double *const x_image, double *const y_image) const
 
const cpl_matrix * WorldCoordinatesCdMatrix (const cpl_wcs *const wcs) const
 
void ConvertCanvasToImage (const double x_canvas, const double y_canvas, double *const x_image, double *const y_image) const
 
void ConvertImageToCanvas (const double x_image, const double y_image, double *const x_canvas, double *const y_canvas) const
 
void set_RotateFlag (const bool rot_flag)
 
bool get_RotateFlag () const
 
void set_FlipXFlag (const bool flip_flag)
 
bool get_FlipXFlag () const
 
void set_FlipYFlag (const bool flip_flag)
 
bool get_FlipYFlag () const
 
int get_ImageWidth () const
 
void set_ImageWidth (const int in_image_width)
 
int get_ImageHeight () const
 
void set_ImageHeight (const int in_image_height)
 
static std::string RaDegToHMS (double deg)
 
static double HMSToRaDeg (const std::string hms)
 
static std::string DecDegToDMS (double deg)
 
static double DMSToDecDeg (const std::string dms)
 

Detailed Description

This file is part of the DDT Image Handling Library and provides functions for coordinate conversion purposes.

It offers functions to convert canvas coordinates to image coordinates and to retrieve world coordinates from canvas coordinates.

Constructor & Destructor Documentation

◆ ImageCoords()

ImageCoords::ImageCoords ( const int image_width,
const int image_height,
const bool rotate_flag,
const bool flip_x_flag,
const bool flip_y_flag )

Constructor

◆ ~ImageCoords()

virtual ddt::ImageCoords::~ImageCoords ( )
virtualdefault

Destructor

Member Function Documentation

◆ CanvasCoordinatesFromWorldCoordinatesDegrees()

bool ImageCoords::CanvasCoordinatesFromWorldCoordinatesDegrees ( const cpl_wcs *const wcs,
const double alpha,
const double delta,
double *const x_canvas,
double *const y_canvas )

Get the canvas coordinates from the world coordinates in degrees

Parameters
wcsthe WCS object related to the image
alphathe world coordinates alpha value
deltathe world coordinates delta value
x_canvasthe resulting canvas x position
y_canvasthe resulting canvas y position
Returns
bool indicating success or failure of coordinate fetching

◆ ConvertCanvasToImage()

void ImageCoords::ConvertCanvasToImage ( const double x_canvas,
const double y_canvas,
double *const x_image,
double *const y_image ) const

Converts canvas coordinates to image coordinates

Parameters
x_canvasthe canvas x position
y_canvasthe canvas y position
x_imagethe resulting image x position
y_imagethe resulting image y position

◆ ConvertImageToCanvas()

void ImageCoords::ConvertImageToCanvas ( const double x_image,
const double y_image,
double *const x_canvas,
double *const y_canvas ) const

Converts image coordinates to canvas coordinates

Parameters
x_imagethe image x position
y_imagethe image y position
x_canvasthe resulting canvas x position
y_canvasthe resulting canvas y position

◆ DecDegToDMS()

std::string ImageCoords::DecDegToDMS ( double deg)
static

Get declination from degrees as a +D:M:S string representation

Parameters
degthe declination in degrees
Returns
string containing the declination converted into +D:M:S representation

◆ DMSToDecDeg()

double ImageCoords::DMSToDecDeg ( const std::string dms)
static

Get degrees from declination, given in a +D:M:S string representation

Parameters
dmsstring containing the declination converted into +D:M:S representation
Returns
the declination in degrees

◆ get_FlipXFlag()

bool ImageCoords::get_FlipXFlag ( ) const

Get the flip X flag.

Returns
the flip X flag (indicating if the image had been flipped horizontally)

◆ get_FlipYFlag()

bool ImageCoords::get_FlipYFlag ( ) const

Get the flip Y flag.

Returns
the flip Y flag (indicating if the image had been flipped vertically)

◆ get_ImageHeight()

int ImageCoords::get_ImageHeight ( ) const

Get the image height

◆ get_ImageWidth()

int ImageCoords::get_ImageWidth ( ) const

Get the image width

◆ get_RotateFlag()

bool ImageCoords::get_RotateFlag ( ) const

Get the rotate flag.

Returns
the rotate flag (indicating if the image had been rotated)

◆ HMSToRaDeg()

double ImageCoords::HMSToRaDeg ( const std::string hms)
static

Get degrees from right ascension, given in a H:M:S string representation

Parameters
hmsstring containing the right ascension converted into H:M:S representation
Returns
the right ascension in degrees

◆ ImageCoordinatesFromWorldCoordinatesDegrees()

bool ImageCoords::ImageCoordinatesFromWorldCoordinatesDegrees ( const cpl_wcs *const wcs,
const double alpha,
const double delta,
double *const x_image,
double *const y_image ) const

Get the image coordinates from world coordinates in degrees

Parameters
wcsthe cpl_wcs object, containing the WCS information related to a CPL image
alphaworld coordinates alpha value
deltaworld coordinates delta value
x_imagethe resulting image x position, or 0.0 on error
y_imagethe resulting image y position, or 0.0 on error
Returns
bool indicating success or failure of coordinate fetching

◆ RaDegToHMS()

std::string ImageCoords::RaDegToHMS ( double deg)
static

Get right ascension from degrees as a H:M:S string representation

Parameters
degthe right ascension in degrees
Returns
string containing the right ascension converted into H:M:S representation

◆ set_FlipXFlag()

void ImageCoords::set_FlipXFlag ( const bool flip_flag)

Set the flip X flag.

Parameters
flip_flagthe flip x flag to set

◆ set_FlipYFlag()

void ImageCoords::set_FlipYFlag ( const bool flip_flag)

Set the flip Y flag.

Parameters
flip_flagthe flip y flag to set

◆ set_ImageHeight()

void ImageCoords::set_ImageHeight ( const int in_image_height)

Set the image height

Parameters
in_image_heightthe image height to set

◆ set_ImageWidth()

void ImageCoords::set_ImageWidth ( const int in_image_width)

Set the image width

Parameters
in_image_widththe image width to set

◆ set_logger()

void ImageCoords::set_logger ( ddt::DdtLogger *const in_logger)

Set logger

Parameters
in_loggerThe logger object

◆ set_RotateFlag()

void ImageCoords::set_RotateFlag ( const bool rot_flag)

Set the rotate flag.

Parameters
rot_flagthe rotate flag to set

◆ WorldCoordinatesCdMatrix()

const cpl_matrix * ImageCoords::WorldCoordinatesCdMatrix ( const cpl_wcs *const wcs) const

Get the CD matrix from the WCS data.

Returns
a cpl_matrix with the CD information from the WCS data, or NULL on error

◆ WorldCoordinatesDegreesFromCanvas()

bool ImageCoords::WorldCoordinatesDegreesFromCanvas ( const cpl_wcs *const wcs,
const double x_canvas,
const double y_canvas,
double * alpha,
double * delta )

Get the world coordinates in degrees from canvas coordinates

Parameters
wcsthe WCS object related to the image
x_canvasthe canvas x position
y_canvasthe canvas y position
alphathe resulting world coordinates alpha value
deltathe resulting world coordinates delta value
Returns
bool indicating success or failure of coordinate fetching

◆ WorldCoordinatesDegreesFromImage()

bool ImageCoords::WorldCoordinatesDegreesFromImage ( const cpl_wcs *const wcs,
const double x_image,
const double y_image,
double *const alpha,
double *const delta ) const

Get the world coordinates in degrees from image coordinates

Parameters
wcsthe cpl_wcs object, containing the WCS information related to a CPL image
x_imagethe image x position
y_imagethe image y position
alphathe resulting world coordinates alpha value, or 0.0 on error
deltathe resulting world coordinates delta value, or 0.0 on error
Returns
bool indicating success or failure of coordinate fetching

Member Data Documentation

◆ logger

ddt::DdtLogger* ddt::ImageCoords::logger
protected

The logger object


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