Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  
igtl_util.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: The OpenIGTLink Library
4  Language: C
5  Web page: http://openigtlink.org/
6 
7  Copyright (c) Insight Software Consortium. All rights reserved.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notices for more information.
12 
13 =========================================================================*/
14 
15 #ifndef __IGTL_UTIL_H
16 #define __IGTL_UTIL_H
17 
18 #include <stdio.h>
19 #include "igtl_win32header.h"
20 #include "igtl_types.h"
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 
27 
28 /* Scalar type for point data */
29 #define IGTL_SCALAR_INT8 2
30 #define IGTL_SCALAR_UINT8 3
31 #define IGTL_SCALAR_INT16 4
32 #define IGTL_SCALAR_UINT16 5
33 #define IGTL_SCALAR_INT32 6
34 #define IGTL_SCALAR_UINT32 7
35 #define IGTL_SCALAR_FLOAT32 10
36 #define IGTL_SCALAR_FLOAT64 11
37 #define IGTL_SCALAR_COMPLEX 13
38 
39 
41 #define BYTE_SWAP_INT16(S) (((S) & 0xFF) << 8 \
42  | (((S) >> 8) & 0xFF))
43 #define BYTE_SWAP_INT32(L) ((BYTE_SWAP_INT16 ((L) & 0xFFFF) << 16) \
44  | BYTE_SWAP_INT16 (((L) >> 16) & 0xFFFF))
45 #define BYTE_SWAP_INT64(LL) ((BYTE_SWAP_INT32 ((LL) & 0xFFFFFFFF) << 32) \
46  | BYTE_SWAP_INT32 (((LL) >> 32) & 0xFFFFFFFF))
47 
50 igtl_uint64 igtl_export crc64(unsigned char *data, igtl_uint64 len, igtl_uint64 crc);
52 
54 igtl_uint32 igtl_export igtl_nanosec_to_frac(igtl_uint32 nanosec);
55 igtl_uint32 igtl_export igtl_frac_to_nanosec(igtl_uint32 frac);
56 void igtl_export igtl_message_dump_hex(FILE* stream, const void* message, int max_size);
58 
60 igtl_uint32 igtl_export igtl_get_scalar_size(int type);
61 
62 #ifdef __cplusplus
63 }
64 #endif
65 
66 #endif /*__IGTL_UTIL_H*/
67 
#define igtl_export
igtl_uint64 igtl_export crc64(unsigned char *data, igtl_uint64 len, igtl_uint64 crc)
void igtl_export igtl_message_dump_hex(FILE *stream, const void *message, int max_size)
igtl_uint32 igtl_export igtl_nanosec_to_frac(igtl_uint32 nanosec)
igtl_uint32 igtl_export igtl_frac_to_nanosec(igtl_uint32 frac)
igtl_uint32 igtl_export igtl_get_scalar_size(int type)
int igtl_export igtl_is_little_endian()

Generated at Mon Nov 11 2013 00:36:44 for OpenIGTLink by doxygen 1.8.5 written by Dimitri van Heesch, © 1997-2012