ddt 1.2.1
|
#include <imageCoords.hpp>
Public Member Functions | |
virtual | ~ImageCoords ()=default |
Protected Attributes | |
ddt::DdtLogger * | logger |
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) |
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.
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
|
virtualdefault |
Destructor
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
wcs | the WCS object related to the image |
alpha | the world coordinates alpha value |
delta | the world coordinates delta value |
x_canvas | the resulting canvas x position |
y_canvas | the resulting canvas y position |
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
x_canvas | the canvas x position |
y_canvas | the canvas y position |
x_image | the resulting image x position |
y_image | the resulting image y position |
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
x_image | the image x position |
y_image | the image y position |
x_canvas | the resulting canvas x position |
y_canvas | the resulting canvas y position |
|
static |
Get declination from degrees as a +D:M:S string representation
deg | the declination in degrees |
|
static |
Get degrees from declination, given in a +D:M:S string representation
dms | string containing the declination converted into +D:M:S representation |
bool ImageCoords::get_FlipXFlag | ( | ) | const |
Get the flip X flag.
bool ImageCoords::get_FlipYFlag | ( | ) | const |
Get the flip Y flag.
int ImageCoords::get_ImageHeight | ( | ) | const |
Get the image height
int ImageCoords::get_ImageWidth | ( | ) | const |
Get the image width
bool ImageCoords::get_RotateFlag | ( | ) | const |
Get the rotate flag.
|
static |
Get degrees from right ascension, given in a H:M:S string representation
hms | string containing the right ascension converted into H:M:S representation |
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
wcs | the cpl_wcs object, containing the WCS information related to a CPL image |
alpha | world coordinates alpha value |
delta | world coordinates delta value |
x_image | the resulting image x position, or 0.0 on error |
y_image | the resulting image y position, or 0.0 on error |
|
static |
Get right ascension from degrees as a H:M:S string representation
deg | the right ascension in degrees |
void ImageCoords::set_FlipXFlag | ( | const bool | flip_flag | ) |
Set the flip X flag.
flip_flag | the flip x flag to set |
void ImageCoords::set_FlipYFlag | ( | const bool | flip_flag | ) |
Set the flip Y flag.
flip_flag | the flip y flag to set |
void ImageCoords::set_ImageHeight | ( | const int | in_image_height | ) |
Set the image height
in_image_height | the image height to set |
void ImageCoords::set_ImageWidth | ( | const int | in_image_width | ) |
Set the image width
in_image_width | the image width to set |
void ImageCoords::set_logger | ( | ddt::DdtLogger *const | in_logger | ) |
Set logger
in_logger | The logger object |
void ImageCoords::set_RotateFlag | ( | const bool | rot_flag | ) |
Set the rotate flag.
rot_flag | the rotate flag to set |
const cpl_matrix * ImageCoords::WorldCoordinatesCdMatrix | ( | const cpl_wcs *const | wcs | ) | const |
Get the CD matrix from the WCS data.
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
wcs | the WCS object related to the image |
x_canvas | the canvas x position |
y_canvas | the canvas y position |
alpha | the resulting world coordinates alpha value |
delta | the resulting world coordinates delta value |
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
wcs | the cpl_wcs object, containing the WCS information related to a CPL image |
x_image | the image x position |
y_image | the image y position |
alpha | the resulting world coordinates alpha value, or 0.0 on error |
delta | the resulting world coordinates delta value, or 0.0 on error |
|
protected |
The logger object