Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  
igtl_colortable.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: OpenIGTLink Library
4  Module: $HeadURL: http://svn.na-mic.org/NAMICSandBox/trunk/OpenIGTLink2_beta/Source/igtlutil/igtl_position.h $
5  Language: C
6  Date: $Date: 2009-11-13 11:37:44 -0500 (Fri, 13 Nov 2009) $
7  Version: $Revision: 5335 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10 
11  This software is distributed WITHOUT ANY WARRANTY; without even
12  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13  PURPOSE. See the above copyright notices for more information.
14 
15 =========================================================================*/
16 
17 #ifndef __IGTL_COLORTABLE_H
18 #define __IGTL_COLORTABLE_H
19 
20 #include "igtl_win32header.h"
21 #include "igtl_util.h"
22 #include "igtl_types.h"
23 
24 #define IGTL_COLORTABLE_HEADER_SIZE 2
25 
26 #define IGTL_COLORTABLE_INDEX_UINT8 3
27 #define IGTL_COLORTABLE_INDEX_UINT16 5
28 #define IGTL_COLORTABLE_MAP_UINT8 3
29 #define IGTL_COLORTABLE_MAP_UINT16 5
30 #define IGTL_COLORTABLE_MAP_RGB 19
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 #pragma pack(1) /* For 1-byte boundary in memroy */
37 /*
38  * Status data header for OpenIGTLinik protocol
39  *
40  */
41 
42 typedef struct {
43  igtl_int8 indexType; /* Index Type: 3:uint8 5:uint16 */
44  igtl_int8 mapType; /* 3: uint8 5:uint16 19:RGB color */
46 
47 #pragma pack()
48 
49 
50 /*
51  * Colortable data size
52  *
53  * igtl_colortable_get_data_size(n) calculates the size of body based on the index
54  * and map types. The size of body is used in the message header.
55  * igtl_colortable_get_data_n(size) calculates the number of images in the body, based on
56  * the body size. This function may be used when a client program parses a COLORTABLE message.
57  *
58  */
59 
61 
62 
63 /*
64  * Byte order conversion for an array of colortable data structure
65  *
66  * This function converts endianness of each element in an array of
67  * igtl_igtl_colortable_header and color table from host byte order to network byte order,
68  * or vice versa (if necessary). The function automatically determins the endian type of the host.
69  */
70 
72 
73 
74 /*
75  * CRC calculation
76  *
77  * This function calculates CRC of color table message
78  *
79  */
80 
81 igtl_uint64 igtl_export igtl_colortable_get_crc(igtl_colortable_header* header, void* table);
82 
83 #ifdef __cplusplus
84 }
85 #endif
86 
87 #endif /* __IGTL_COLORTABLE_H */
88 
89 
90 

Generated at Thu Mar 20 2014 16:32:06 for OpenIGTLink by doxygen 1.8.1.2 written by Dimitri van Heesch, © 1997-2000