Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  
igtlColorTableMessage.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Open IGT Link Library
4  Module: $HeadURL: http://svn.na-mic.org/NAMICSandBox/trunk/OpenIGTLink2_beta/Source/igtlColorTableMessage.h $
5  Language: C++
6  Date: $Date: 2009-02-03 16:48:16 -0500 (Tue, 03 Feb 2009) $
7  Version: $Revision: 3634 $
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 __igtlColorTableMessage_h
18 #define __igtlColorTableMessage_h
19 
20 #include "igtlObject.h"
21 //#include "igtlMacros.h"
22 #include "igtlMacro.h"
23 #include "igtlMath.h"
24 #include "igtlMessageBase.h"
25 
26 namespace igtl
27 {
28 
30 {
31 public:
36 
39 
40 protected:
41  GetColorTableMessage() : MessageBase() { this->m_DefaultBodyType = "GET_COLORT"; };
43 protected:
44  virtual int GetBodyPackSize() { return 0; };
45  virtual int PackBody() { AllocatePack(); return 1; };
46  virtual int UnpackBody() { return 1; };
47 };
48 
49 
51 {
52 public:
57 
60 
61 public:
62 
63  enum {
64  INDEX_UINT8 = 3,
65  INDEX_UINT16 = 5,
66  MAP_UINT8 = 3,
67  MAP_UINT16 = 5,
68  MAP_RGB = 19,
69  };
70 
71 public:
72 
73  // ColorTable index type
74  void SetIndexType(int t) { indexType = t; };
75  void SetIndexTypeToUint8() { indexType = INDEX_UINT8; };
76  void SetIndexTypeToUint16() { indexType = INDEX_UINT16; };
77  int GetIndexType() { return indexType; };
78 
79  // Map scalar type
80  void SetMapType(int t) { mapType = t; };
81  void SetMapTypeToUint8() { mapType = MAP_UINT8; };
82  void SetMapTypeToUint16() { mapType = MAP_UINT16; };
83  int GetMapType() { return mapType; };
84 
85  // Should returned value be 64-bit integer?
86  int GetColorTableSize();
87  void AllocateTable();
88  void* GetTablePointer();
89 
90 protected:
93 
94 protected:
95 
96  virtual int GetBodyPackSize();
97  virtual int PackBody();
98  virtual int UnpackBody();
99 
101  int mapType;
102 
103  unsigned char* m_ColorTableHeader;
104  unsigned char* m_ColorTable;
105 
106 };
107 
108 
109 } // namespace igtl
110 
111 #endif // _igtlColorTableMessage_h
112 
113 
114 

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