56 #ifndef OPENMESH_SR_RBO_HH
57 #define OPENMESH_SR_RBO_HH
62 #include <OpenMesh/Core/System/config.h>
64 #if defined(OM_CC_MIPS)
73 #include <OpenMesh/Core/IO/SR_types.hh>
74 #include <OpenMesh/Core/Utils/GenProg.hh>
96 template <
size_t N >
inline
106 _val[0] ^= _val[1]; _val[1] ^= _val[0]; _val[0] ^= _val[1];
113 _val[0] ^= _val[3]; _val[3] ^= _val[0]; _val[0] ^= _val[3];
114 _val[1] ^= _val[2]; _val[2] ^= _val[1]; _val[1] ^= _val[2];
121 _val[0] ^= _val[7]; _val[7] ^= _val[0]; _val[0] ^= _val[7];
122 _val[1] ^= _val[6]; _val[6] ^= _val[1]; _val[1] ^= _val[6];
123 _val[2] ^= _val[5]; _val[5] ^= _val[2]; _val[2] ^= _val[5];
124 _val[3] ^= _val[4]; _val[4] ^= _val[3]; _val[3] ^= _val[4];
131 _val[0] ^= _val[11]; _val[11] ^= _val[0]; _val[0] ^= _val[11];
132 _val[1] ^= _val[10]; _val[10] ^= _val[1]; _val[1] ^= _val[10];
133 _val[2] ^= _val[ 9]; _val[ 9] ^= _val[2]; _val[2] ^= _val[ 9];
134 _val[3] ^= _val[ 8]; _val[ 8] ^= _val[3]; _val[3] ^= _val[ 8];
135 _val[4] ^= _val[ 7]; _val[ 7] ^= _val[4]; _val[4] ^= _val[ 7];
136 _val[5] ^= _val[ 6]; _val[ 6] ^= _val[5]; _val[5] ^= _val[ 6];
171 omerr() <<
"Not defined for type " <<
typeid(T).name() << std::endl;
178 #if defined(OM_CC_GCC)
184 #define REVERSE_FUNDAMENTAL_TYPE( T ) \
185 template <> inline T& reverse_byte_order( T& _t ) {\
186 _reverse_byte_order_N<sizeof(T)>( reinterpret_cast<uint8_t*>(&_t) ); \
198 REVERSE_FUNDAMENTAL_TYPE(
unsigned long)
203 REVERSE_FUNDAMENTAL_TYPE(
float)
204 REVERSE_FUNDAMENTAL_TYPE(
double)
205 REVERSE_FUNDAMENTAL_TYPE(
long double)
207 #undef REVERSE_FUNDAMENTAL_TYPE
211 #define REVERSE_VECTORT_TYPE( T ) \
212 template <> inline T& reverse_byte_order(T& _v) {\
213 for (size_t i; i< T::size_; ++i) \
214 _reverse_byte_order_N< sizeof(T::value_type) >( reinterpret_cast<uint8_t*>(&_v[i])); \
218 #define REVERSE_VECTORT_TYPES( N ) \
219 REVERSE_VECTORT_TYPE( Vec##N##c ) \
220 REVERSE_VECTORT_TYPE( Vec##N##uc ) \
221 REVERSE_VECTORT_TYPE( Vec##N##s ) \
222 REVERSE_VECTORT_TYPE( Vec##N##us ) \
223 REVERSE_VECTORT_TYPE( Vec##N##i ) \
224 REVERSE_VECTORT_TYPE( Vec##N##ui ) \
225 REVERSE_VECTORT_TYPE( Vec##N##f ) \
226 REVERSE_VECTORT_TYPE( Vec##N##d ) \
228 REVERSE_VECTORT_TYPES(1)
229 REVERSE_VECTORT_TYPES(2)
230 REVERSE_VECTORT_TYPES(3)
231 REVERSE_VECTORT_TYPES(4)
232 REVERSE_VECTORT_TYPES(6)
234 #undef REVERSE_VECTORT_TYPES
235 #undef REVERSE_VECTORT_TYPE
239 template <
typename T>
inline
242 compile_timer_error__const_means_const(a);
254 #endif // OPENMESH_SR_RBO_HH defined
unsigned short uint16_t
Binary read a short from _is and perform byte swapping if _swap is true.
Definition: SR_types.hh:86
unsigned char uint8_t
Binary read a short from _is and perform byte swapping if _swap is true.
Definition: SR_types.hh:85
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:129
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:161
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:111
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:104
long long int64_t
Binary read a short from _is and perform byte swapping if _swap is true.
Definition: SR_types.hh:94
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:100
unsigned long long uint64_t
Binary read a short from _is and perform byte swapping if _swap is true.
Definition: SR_types.hh:94
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:119
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:64
unsigned char uchar
Binary read a short from _is and perform byte swapping if _swap is true.
Definition: SR_types.hh:81
unsigned int uint32_t
Binary read a short from _is and perform byte swapping if _swap is true.
Definition: SR_types.hh:90
short int16_t
Binary read a short from _is and perform byte swapping if _swap is true.
Definition: SR_types.hh:86
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 ...
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:90
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:141
This file provides the streams omlog, omout, and omerr.