49 #ifndef OPENMESH_SR_RBO_HH
50 #define OPENMESH_SR_RBO_HH
55 #include <OpenMesh/Core/System/config.h>
57 #if defined(OM_CC_MIPS)
66 #include <OpenMesh/Core/IO/SR_types.hh>
67 #include <OpenMesh/Core/Utils/GenProg.hh>
89 template <
size_t N >
inline
99 _val[0] ^= _val[1]; _val[1] ^= _val[0]; _val[0] ^= _val[1];
106 _val[0] ^= _val[3]; _val[3] ^= _val[0]; _val[0] ^= _val[3];
107 _val[1] ^= _val[2]; _val[2] ^= _val[1]; _val[1] ^= _val[2];
114 _val[0] ^= _val[7]; _val[7] ^= _val[0]; _val[0] ^= _val[7];
115 _val[1] ^= _val[6]; _val[6] ^= _val[1]; _val[1] ^= _val[6];
116 _val[2] ^= _val[5]; _val[5] ^= _val[2]; _val[2] ^= _val[5];
117 _val[3] ^= _val[4]; _val[4] ^= _val[3]; _val[3] ^= _val[4];
124 _val[0] ^= _val[11]; _val[11] ^= _val[0]; _val[0] ^= _val[11];
125 _val[1] ^= _val[10]; _val[10] ^= _val[1]; _val[1] ^= _val[10];
126 _val[2] ^= _val[ 9]; _val[ 9] ^= _val[2]; _val[2] ^= _val[ 9];
127 _val[3] ^= _val[ 8]; _val[ 8] ^= _val[3]; _val[3] ^= _val[ 8];
128 _val[4] ^= _val[ 7]; _val[ 7] ^= _val[4]; _val[4] ^= _val[ 7];
129 _val[5] ^= _val[ 6]; _val[ 6] ^= _val[5]; _val[5] ^= _val[ 6];
164 omerr() <<
"Not defined for type " <<
typeid(T).name() << std::endl;
171 #if defined(OM_CC_GCC)
177 #define REVERSE_FUNDAMENTAL_TYPE( T ) \
178 template <> inline T& reverse_byte_order( T& _t ) {\
179 _reverse_byte_order_N<sizeof(T)>( reinterpret_cast<uint8_t*>(&_t) ); \
191 REVERSE_FUNDAMENTAL_TYPE(
unsigned long)
196 REVERSE_FUNDAMENTAL_TYPE(
float)
197 REVERSE_FUNDAMENTAL_TYPE(
double)
198 REVERSE_FUNDAMENTAL_TYPE(
long double)
200 #undef REVERSE_FUNDAMENTAL_TYPE
204 #define REVERSE_VECTORT_TYPE( T ) \
205 template <> inline T& reverse_byte_order(T& _v) {\
206 for (size_t i; i< T::size_; ++i) \
207 _reverse_byte_order_N< sizeof(T::value_type) >( reinterpret_cast<uint8_t*>(&_v[i])); \
211 #define REVERSE_VECTORT_TYPES( N ) \
212 REVERSE_VECTORT_TYPE( Vec##N##c ) \
213 REVERSE_VECTORT_TYPE( Vec##N##uc ) \
214 REVERSE_VECTORT_TYPE( Vec##N##s ) \
215 REVERSE_VECTORT_TYPE( Vec##N##us ) \
216 REVERSE_VECTORT_TYPE( Vec##N##i ) \
217 REVERSE_VECTORT_TYPE( Vec##N##ui ) \
218 REVERSE_VECTORT_TYPE( Vec##N##f ) \
219 REVERSE_VECTORT_TYPE( Vec##N##d ) \
221 REVERSE_VECTORT_TYPES(1)
222 REVERSE_VECTORT_TYPES(2)
223 REVERSE_VECTORT_TYPES(3)
224 REVERSE_VECTORT_TYPES(4)
225 REVERSE_VECTORT_TYPES(6)
227 #undef REVERSE_VECTORT_TYPES
228 #undef REVERSE_VECTORT_TYPE
232 template <
typename T>
inline
235 compile_timer_error__const_means_const(a);
247 #endif // OPENMESH_SR_RBO_HH defined
void _reverse_byte_order_N< 8 >(uint8_t *_val)
this does not compile for g++3.4 and higher, hence we comment the function body which will result in ...
Definition: SR_rbo.hh:112
unsigned int uint32_t
Binary read a short from _is and perform byte swapping if _swap is true.
Definition: SR_types.hh:83
short int16_t
Binary read a short from _is and perform byte swapping if _swap is true.
Definition: SR_types.hh:79
T * reverse_byte_order(T *t)
this does not compile for g++3.4 and higher, hence we comment the function body which will result in ...
unsigned char uchar
Binary read a short from _is and perform byte swapping if _swap is true.
Definition: SR_types.hh:74
This file provides the streams omlog, omout, and omerr.
void _reverse_byte_order_N(uint8_t *_val)
this does not compile for g++3.4 and higher, hence we comment the function body which will result in ...
int int32_t
Binary read a short from _is and perform byte swapping if _swap is true.
Definition: SR_types.hh:83
unsigned short uint16_t
Binary read a short from _is and perform byte swapping if _swap is true.
Definition: SR_types.hh:79
void _reverse_byte_order_N< 16 >(uint8_t *_val)
this does not compile for g++3.4 and higher, hence we comment the function body which will result in ...
Definition: SR_rbo.hh:134
unsigned char uint8_t
Binary read a short from _is and perform byte swapping if _swap is true.
Definition: SR_types.hh:78
void _reverse_byte_order_N< 12 >(uint8_t *_val)
this does not compile for g++3.4 and higher, hence we comment the function body which will result in ...
Definition: SR_rbo.hh:122
void _reverse_byte_order_N< 4 >(uint8_t *_val)
this does not compile for g++3.4 and higher, hence we comment the function body which will result in ...
Definition: SR_rbo.hh:104
void compile_time_error__no_fundamental_type()
this does not compile for g++3.4 and higher, hence we comment the function body which will result in ...
Definition: SR_rbo.hh:154
void _reverse_byte_order_N< 2 >(uint8_t *_val)
this does not compile for g++3.4 and higher, hence we comment the function body which will result in ...
Definition: SR_rbo.hh:97
void _reverse_byte_order_N< 1 >(uint8_t *)
this does not compile for g++3.4 and higher, hence we comment the function body which will result in ...
Definition: SR_rbo.hh:93
long long int64_t
Binary read a short from _is and perform byte swapping if _swap is true.
Definition: SR_types.hh:87
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:56
unsigned long long uint64_t
Binary read a short from _is and perform byte swapping if _swap is true.
Definition: SR_types.hh:87