USGS

Isis 3.0 Application Source Code Reference

Home

Trans2d3p.h

Go to the documentation of this file.
00001 #include "Cube.h"
00002 #include "Transform.h"
00003 #include <math.h>
00004 
00005 /**                                                                       
00006  * @file                                                                  
00007  * $Revision: 1.7 $                                                             
00008  * $Date: 2005/10/03 22:43:39 $                                                                 
00009  *                                                                        
00010  *   Unless noted otherwise, the portions of Isis written by the USGS are 
00011  *   public domain. See individual third-party library and package descriptions 
00012  *   for intellectual property information, user agreements, and related  
00013  *   information.                                                         
00014  *                                                                        
00015  *   Although Isis has been used by the USGS, no warranty, expressed or   
00016  *   implied, is made by the USGS as to the accuracy and functioning of such 
00017  *   software and related material nor shall the fact of distribution     
00018  *   constitute any such warranty, and no responsibility is assumed by the
00019  *   USGS in connection therewith.                                        
00020  *                                                                        
00021  *   For additional information, launch                                   
00022  *   $ISISROOT/doc//documents/Disclaimers/Disclaimers.html                
00023  *   in a browser or see the Privacy &amp; Disclaimers page on the Isis website,
00024  *   http://isis.astrogeology.usgs.gov, and the USGS privacy and disclaimers on
00025  *   http://www.usgs.gov/privacy.html.                                    
00026  */                                                                       
00027 
00028 
00029 using namespace Isis;
00030 
00031 /**                                                                       
00032  * @brief Brief coming soon
00033  *                                                                        
00034  * Description coming soon
00035  *                                                                        
00036  * @author 2011-09-19 Orrin Thomas
00037  *                                                                        
00038  * @internal                                                              
00039  *   @history 2011-09-19 Orrin Thomas - Original version
00040  */        
00041 class Trans2d3p : public Transform {
00042 public: 
00043   Trans2d3p(double theta, double sampOffset, double lineOffset,int samples, int lines) {
00044     m_lines = lines;
00045     m_samples = samples;
00046     m_ct = cos(theta);
00047     m_st = sin(theta);
00048     m_lineOffset = lineOffset;
00049     m_sampOffset = sampOffset;
00050   }
00051 
00052   ~Trans2d3p() {}
00053 
00054   bool Xform(double &inSample, double &inLine, const double outSample, const double outLine) {
00055     inSample  = outSample*m_ct - outLine*m_st + m_sampOffset;
00056     inLine    = outSample*m_st + outLine*m_ct + m_lineOffset;
00057 
00058     return true;
00059   }
00060 
00061   int OutputSamples() const {
00062     return m_samples;
00063   }
00064 
00065   int OutputLines() const {
00066     return m_lines;
00067   }
00068 
00069 private:
00070   double m_sampOffset;
00071   double m_lineOffset;
00072   double m_ct;
00073   double m_st;
00074   int m_lines;
00075   int m_samples;
00076 };