CARMA C++
|
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... | |
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.
|
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.
grossRotationInDegrees | The gross rotation is a 90 degree multiple representing the general rotation of the az/el cs, relative to the optical telescope mount. |
fineRotationInDegrees | Small scale rotation representing fine rotation necessary to align az/el coordinate system with raw frame. This is added directly to the grossRotation. |
maxRawFrameResolution | Maximum raw frame resolution as width height pair. |
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.
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.
w | Width of cropped frame in pixels |
h | Height of cropped frame in pixels |
x0 | X offset in pixels into frame (for cropping). |
y0 | Y offset in pixels into frame (for cropping). |
IllegalArgumentException | if dimensions exceed current resolution. |
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.
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.