CARMA C++
carma::antenna::common::FrameContext Class Reference

Optical telescopes and cameras on Carma dishes are not mounted uniformly and thus plate scales vary substantially from dish to dish. More...

#include <carma/antenna/common/FrameContext.h>

Public Member Functions

 FrameContext (float grossRotationInDegrees, float fineRotationInDegrees,::std::pair< short, short > maxRawFrameResolution)
 Create a FrameContext. More...
 
std::pair< short, short > getDimensions () const
 Get dimensions as x,y pair (in pixels). More...
 
float getImageRotationInDegrees () const
 Get rotation in degrees. More...
 
::std::pair< short, short > getMaxResolution () const
 Get maximum resolution of frame within context. More...
 
std::pair< short, short > getOffset () const
 Get image offset (crop offset) in pixels. More...
 
::std::pair< short, short > getResolution () const
 Get resolution in context. More...
 
void rotateAndCrop (Image &image) const
 Rotate and crop image into context frame of reference. More...
 
void setDimensions (short w, short h, short x0, short y0)
 Set frame dimensions. More...
 
void setImageRotation (float degrees)
 Set fine scale image rotation angle. More...
 
void setRawFrameResolution (short w, short h)
 Set raw frame resolution. More...
 

Detailed Description

Optical telescopes and cameras on Carma dishes are not mounted uniformly and thus plate scales vary substantially from dish to dish.

This class maintains state information and provides methods for alligning a raw frame grabber image with a common az/el coordinate system.

Definition at line 19 of file FrameContext.h.

Constructor & Destructor Documentation

carma::antenna::common::FrameContext::FrameContext ( float  grossRotationInDegrees,
float  fineRotationInDegrees,
::std::pair< short, short >  maxRawFrameResolution 
)
explicit

Create a FrameContext.

Rotation assumes standard image processing coordinate system where the top left of an image is defined as the (x,y) origin. Max frame resolution refers to the maximum unrotated resolution.

Parameters
grossRotationInDegreesThe gross rotation is a 90 degree multiple representing the general rotation of the az/el cs, relative to the optical telescope mount.
fineRotationInDegreesSmall scale rotation representing fine rotation necessary to align az/el coordinate system with raw frame. This is added directly to the grossRotation.
maxRawFrameResolutionMaximum raw frame resolution as width height pair.

Member Function Documentation

std::pair< short, short > carma::antenna::common::FrameContext::getDimensions ( ) const

Get dimensions as x,y pair (in pixels).

float carma::antenna::common::FrameContext::getImageRotationInDegrees ( ) const

Get rotation in degrees.

::std::pair<short, short> carma::antenna::common::FrameContext::getMaxResolution ( ) const

Get maximum resolution of frame within context.

std::pair< short, short > carma::antenna::common::FrameContext::getOffset ( ) const

Get image offset (crop offset) in pixels.

::std::pair<short, short> carma::antenna::common::FrameContext::getResolution ( ) const

Get resolution in context.

Returns
resolution as width height pair.
void carma::antenna::common::FrameContext::rotateAndCrop ( Image &  image) const

Rotate and crop image into context frame of reference.

void carma::antenna::common::FrameContext::setDimensions ( short  w,
short  h,
short  x0,
short  y0 
)

Set frame dimensions.

Parameters
wWidth of cropped frame in pixels
hHeight of cropped frame in pixels
x0X offset in pixels into frame (for cropping).
y0Y offset in pixels into frame (for cropping).
Exceptions
IllegalArgumentExceptionif dimensions exceed current resolution.
See Also
setResolution
void carma::antenna::common::FrameContext::setImageRotation ( float  degrees)

Set fine scale image rotation angle.

Rotation is about the center of the image in a standard image coordinate system (orgin at top left of image). In this CS clockwise is positive. The frame is rotated on top of a rectangular canvas which is sized according to the rotation angle. This routine resets dimensions to this canvas size and offsets to 0.

See Also
setDimensions
void carma::antenna::common::FrameContext::setRawFrameResolution ( short  w,
short  h 
)

Set raw frame resolution.

Set current resolution of the raw frames being returned by the frame grabber.


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