ddt  0.1
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
ddt::ImageCoords Class Reference

#include <imageCoords.hpp>

Public Member Functions

 ImageCoords (int image_width, int image_height, bool rotate_flag, bool flip_x_flag, bool flip_y_flag)
 
virtual ~ImageCoords ()=default
 
void set_logger (ddt::DdtLogger *logger)
 
bool WorldCoordinatesDegreesFromCanvas (cpl_wcs *wcs, const double x_canvas, const double y_canvas, double *alpha, double *delta)
 
bool WorldCoordinatesDegreesFromImage (const cpl_wcs *wcs, const double x_image, const double y_image, double *alpha, double *delta)
 
const cpl_matrix * WorldCoordinatesCdMatrix (const cpl_wcs *wcs)
 
void ConvertCanvasToImage (const double x_canvas, const double y_canvas, double *x_image, double *y_image)
 
void ConvertImageToCanvas (const double x_image, const double y_image, double *x_canvas, double *y_canvas)
 
void set_RotateFlag (const bool rot_flag)
 
bool get_RotateFlag ()
 
void set_FlipXFlag (const bool flip_flag)
 
bool get_FlipXFlag ()
 
void set_FlipYFlag (const bool flip_flag)
 
bool get_FlipYFlag ()
 
int get_ImageWidth ()
 
void set_ImageWidth (const int image_width)
 
int get_ImageHeight ()
 
void set_ImageHeight (const int image_height)
 

Static Public Member Functions

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

Protected Attributes

ddt::DdtLoggerlogger
 

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 ( int  image_width,
int  image_height,
bool  rotate_flag,
bool  flip_x_flag,
bool  flip_y_flag 
)

Constructor

◆ ~ImageCoords()

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

Destructor

Member Function Documentation

◆ ConvertCanvasToImage()

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

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 *  x_canvas,
double *  y_canvas 
)

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

◆ get_FlipXFlag()

bool ImageCoords::get_FlipXFlag ( )

Get the flip X flag.

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

◆ get_FlipYFlag()

bool ImageCoords::get_FlipYFlag ( )

Get the flip Y flag.

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

◆ get_ImageHeight()

int ImageCoords::get_ImageHeight ( )

Get the image height

◆ get_ImageWidth()

int ImageCoords::get_ImageWidth ( )

Get the image width

◆ get_RotateFlag()

bool ImageCoords::get_RotateFlag ( )

Get the rotate flag.

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

◆ 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  image_height)

Set the image height

Parameters
image_heightthe image height to set

◆ set_ImageWidth()

void ImageCoords::set_ImageWidth ( const int  image_width)

Set the image width

Parameters
image_widththe image width to set

◆ set_logger()

void ImageCoords::set_logger ( ddt::DdtLogger logger)

Set logger

Parameters
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 *  wcs)

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 ( cpl_wcs *  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 *  wcs,
const double  x_image,
const double  y_image,
double *  alpha,
double *  delta 
)

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: