00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __OMNICONVERSION_HH__
00021 #define __OMNICONVERSION_HH__
00022
00023
00024 #include "OmniAngle.hh"
00025
00030 #define PI 3.141592654
00031
00035 #ifndef NULL
00036 #define NULL 0
00037 #endif
00038
00048 template <class ConverterT, class AngleT, class ImageT, class PointT>
00049 class OmniConversion {
00050
00051 public:
00057 OmniConversion(ConverterT *conv);
00058 virtual ~OmniConversion ();
00059
00065 template <class OtherAngleT>
00066 ImageT* omni2pano( ImageT* omni_frame, OmniAngle<OtherAngleT> &IN_interval );
00067
00068
00069
00076 template <class FromAngleT, class ToAngleT>
00077 void angle_type_conversion( OmniAngle<FromAngleT> &omniangle_from, OmniAngle<ToAngleT> &omniangle_to );
00078
00089 void pano2omni_xy( PointT *pano_point,
00090 AngleT theta_start,
00091 PointT *OUT_omni_point );
00092
00094 bool is_initialized ();
00095
00096 AngleT get_omni_center_x ();
00097 AngleT get_omni_center_y();
00098 AngleT get_min_radius();
00099 AngleT get_max_radius();
00100
00101 private:
00102 ConverterT *_conv;
00103 };
00104
00105
00106
00110
00111
00112 template <class ConverterT, class AngleT, class ImageT, class PointT>
00113 OmniConversion <ConverterT, AngleT, ImageT, PointT>::OmniConversion( ConverterT* conv )
00114 {
00115 this->_conv = conv;
00116 }
00117
00118 template <class ConverterT, class AngleT, class ImageT, class PointT>
00119 OmniConversion <ConverterT, AngleT, ImageT, PointT>::~OmniConversion ()
00120 {
00121 if (_conv != NULL)
00122 delete _conv;
00123 }
00124
00125 template <class ConverterT, class AngleT, class ImageT, class PointT>
00126 template <class OtherAngleT>
00127 ImageT* OmniConversion <ConverterT, AngleT, ImageT, PointT>::omni2pano( ImageT* omni_frame,
00128 OmniAngle<OtherAngleT> &IN_interval )
00129 {
00130 if (_conv == NULL)
00131 return NULL;
00132
00133 return _conv->omni2pano( omni_frame, IN_interval );
00134 }
00135
00136
00137 template <class ConverterT, class AngleT, class ImageT, class PointT>
00138 template <class FromAngleT, class ToAngleT>
00139 void OmniConversion <ConverterT, AngleT, ImageT, PointT>::angle_type_conversion( OmniAngle<FromAngleT> &omniangle_from,
00140 OmniAngle<ToAngleT> &omniangle_to )
00141 {
00142 _conv->angle_type_conversion( omniangle_from, omniangle_to );
00143 }
00144
00145 template <class ConverterT, class AngleT, class ImageT, class PointT>
00146 void OmniConversion <ConverterT, AngleT, ImageT, PointT>::pano2omni_xy( PointT *pano_point,
00147 AngleT theta_start,
00148 PointT *OUT_omni_point )
00149 {
00150 _conv->pano2omni_xy( pano_point, theta_start, OUT_omni_point );
00151 }
00152
00153 template <class ConverterT, class AngleT, class ImageT, class PointT>
00154 AngleT OmniConversion <ConverterT, AngleT, ImageT, PointT>::get_omni_center_x ()
00155 {
00156 return _conv->get_omni_center_x ();
00157 }
00158
00159 template <class ConverterT, class AngleT, class ImageT, class PointT>
00160 AngleT OmniConversion <ConverterT, AngleT, ImageT, PointT>::get_omni_center_y ()
00161 {
00162 return _conv->get_omni_center_y ();
00163 }
00164
00165 template <class ConverterT, class AngleT, class ImageT, class PointT>
00166 AngleT OmniConversion <ConverterT, AngleT, ImageT, PointT>::get_max_radius ()
00167 {
00168 return _conv->get_max_radius ();
00169 }
00170
00171 template <class ConverterT, class AngleT, class ImageT, class PointT>
00172 AngleT OmniConversion <ConverterT, AngleT, ImageT, PointT>::get_min_radius ()
00173 {
00174 return _conv->get_min_radius ();
00175 }
00176
00177 template <class ConverterT, class AngleT, class ImageT, class PointT>
00178 bool OmniConversion <ConverterT, AngleT, ImageT, PointT>::is_initialized ()
00179 {
00180 return _conv->is_initialized ();
00181 }
00182
00183
00184
00185 #endif
00186