CARMA C++
FrameContext.h
1 #ifndef CARMA_ANTENNA_COMMON_FRAMECONTEXT_H
2 #define CARMA_ANTENNA_COMMON_FRAMECONTEXT_H
3 
4 #include "carma/antenna/common/Image_fwd.h"
5 
6 #include <memory>
7 #include <utility>
8 
9 namespace carma {
10 namespace antenna {
11 namespace common {
12 
19 class FrameContext {
20 public:
21 
36  explicit FrameContext( float grossRotationInDegrees,
37  float fineRotationInDegrees,
38  ::std::pair< short, short > maxRawFrameResolution );
39 
40  ~FrameContext( );
41 
47  void setRawFrameResolution( short w, short h );
48 
53  ::std::pair<short, short> getResolution( ) const;
54 
58  ::std::pair<short, short> getMaxResolution( ) const;
59 
69  void setDimensions( short w, short h, short x0, short y0 );
70 
74  std::pair< short, short > getDimensions( ) const;
75 
79  std::pair< short, short > getOffset( ) const;
80 
90  void setImageRotation( float degrees );
91 
95  float getImageRotationInDegrees( ) const;
96 
100  void rotateAndCrop( Image & image ) const;
101 
102 private:
103 
104  struct Impl;
105  ::std::auto_ptr< Impl > impl_;
106 
107 }; // class FrameContext
108 
109 }}} // namespace carma::antenna::common
110 #endif
::std::pair< short, short > getMaxResolution() const
Get maximum resolution of frame within context.
std::pair< short, short > getDimensions() const
Get dimensions as x,y pair (in pixels).
float getImageRotationInDegrees() const
Get rotation in degrees.
void setImageRotation(float degrees)
Set fine scale image rotation angle.
::std::pair< short, short > getResolution() const
Get resolution in context.
void setDimensions(short w, short h, short x0, short y0)
Set frame dimensions.
Optical telescopes and cameras on Carma dishes are not mounted uniformly and thus plate scales vary s...
Definition: FrameContext.h:19
std::pair< short, short > getOffset() const
Get image offset (crop offset) in pixels.
void setRawFrameResolution(short w, short h)
Set raw frame resolution.
void rotateAndCrop(Image &image) const
Rotate and crop image into context frame of reference.
FrameContext(float grossRotationInDegrees, float fineRotationInDegrees,::std::pair< short, short > maxRawFrameResolution)
Create a FrameContext.