51 #ifndef OPENMESH_SR_RBO_HH 52 #define OPENMESH_SR_RBO_HH 59 #if defined(OM_CC_MIPS) 68 #include <OpenMesh/Core/IO/SR_types.hh> 69 #include <OpenMesh/Core/Utils/GenProg.hh> 91 template <
size_t N >
inline 101 _val[0] ^= _val[1]; _val[1] ^= _val[0]; _val[0] ^= _val[1];
108 _val[0] ^= _val[3]; _val[3] ^= _val[0]; _val[0] ^= _val[3];
109 _val[1] ^= _val[2]; _val[2] ^= _val[1]; _val[1] ^= _val[2];
116 _val[0] ^= _val[7]; _val[7] ^= _val[0]; _val[0] ^= _val[7];
117 _val[1] ^= _val[6]; _val[6] ^= _val[1]; _val[1] ^= _val[6];
118 _val[2] ^= _val[5]; _val[5] ^= _val[2]; _val[2] ^= _val[5];
119 _val[3] ^= _val[4]; _val[4] ^= _val[3]; _val[3] ^= _val[4];
126 _val[0] ^= _val[11]; _val[11] ^= _val[0]; _val[0] ^= _val[11];
127 _val[1] ^= _val[10]; _val[10] ^= _val[1]; _val[1] ^= _val[10];
128 _val[2] ^= _val[ 9]; _val[ 9] ^= _val[2]; _val[2] ^= _val[ 9];
129 _val[3] ^= _val[ 8]; _val[ 8] ^= _val[3]; _val[3] ^= _val[ 8];
130 _val[4] ^= _val[ 7]; _val[ 7] ^= _val[4]; _val[4] ^= _val[ 7];
131 _val[5] ^= _val[ 6]; _val[ 6] ^= _val[5]; _val[5] ^= _val[ 6];
166 omerr() <<
"Not defined for type " <<
typeid(T).name() << std::endl;
173 #if defined(OM_CC_GCC) 179 #define REVERSE_FUNDAMENTAL_TYPE( T ) \ 180 template <> inline T& reverse_byte_order( T& _t ) {\ 181 _reverse_byte_order_N<sizeof(T)>( reinterpret_cast<uint8_t*>(&_t) ); \ 188 REVERSE_FUNDAMENTAL_TYPE(
int16_t)
193 REVERSE_FUNDAMENTAL_TYPE(
unsigned long)
194 REVERSE_FUNDAMENTAL_TYPE(
int32_t)
196 REVERSE_FUNDAMENTAL_TYPE(
int64_t)
198 REVERSE_FUNDAMENTAL_TYPE(
float)
199 REVERSE_FUNDAMENTAL_TYPE(
double)
200 REVERSE_FUNDAMENTAL_TYPE(
long double)
202 #undef REVERSE_FUNDAMENTAL_TYPE 206 #define REVERSE_VECTORT_TYPE( T ) \ 207 template <> inline T& reverse_byte_order(T& _v) {\ 208 for (size_t i; i< T::size_; ++i) \ 209 _reverse_byte_order_N< sizeof(T::value_type) >( reinterpret_cast<uint8_t*>(&_v[i])); \ 213 #define REVERSE_VECTORT_TYPES( N ) \ 214 REVERSE_VECTORT_TYPE( Vec##N##c ) \ 215 REVERSE_VECTORT_TYPE( Vec##N##uc ) \ 216 REVERSE_VECTORT_TYPE( Vec##N##s ) \ 217 REVERSE_VECTORT_TYPE( Vec##N##us ) \ 218 REVERSE_VECTORT_TYPE( Vec##N##i ) \ 219 REVERSE_VECTORT_TYPE( Vec##N##ui ) \ 220 REVERSE_VECTORT_TYPE( Vec##N##f ) \ 221 REVERSE_VECTORT_TYPE( Vec##N##d ) \ 223 REVERSE_VECTORT_TYPES(1)
224 REVERSE_VECTORT_TYPES(2)
225 REVERSE_VECTORT_TYPES(3)
226 REVERSE_VECTORT_TYPES(4)
227 REVERSE_VECTORT_TYPES(6)
229 #undef REVERSE_VECTORT_TYPES 230 #undef REVERSE_VECTORT_TYPE 234 template <
typename T>
inline 237 compile_timer_error__const_means_const(a);
249 #endif // OPENMESH_SR_RBO_HH defined T * reverse_byte_order(T *t)
void _reverse_byte_order_N(uint8_t *_val)
unsigned long long uint64_t
void compile_time_error__no_fundamental_type()
void _reverse_byte_order_N< 1 >(uint8_t *)
void _reverse_byte_order_N< 4 >(uint8_t *_val)
void _reverse_byte_order_N< 12 >(uint8_t *_val)
void _reverse_byte_order_N< 2 >(uint8_t *_val)
void _reverse_byte_order_N< 16 >(uint8_t *_val)
void _reverse_byte_order_N< 8 >(uint8_t *_val)