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: 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 __igtlColorTableMessage_h
16 #define __igtlColorTableMessage_h
17 
18 #include "igtlObject.h"
19 #include "igtlMacro.h"
20 #include "igtlMath.h"
21 #include "igtlMessageBase.h"
22 
23 namespace igtl
24 {
25 
28 {
29 public:
34 
37 
38 protected:
39  GetColorTableMessage() : MessageBase() { this->m_DefaultBodyType = "GET_COLORT"; };
41 
42 protected:
43  virtual int GetBodyPackSize() { return 0; };
44  virtual int PackBody() { AllocatePack(); return 1; };
45  virtual int UnpackBody() { return 1; };
46 };
47 
48 
51 {
52 public:
57 
60 
61 public:
62 
64  enum {
65  INDEX_UINT8 = 3,
66  INDEX_UINT16 = 5,
67  MAP_UINT8 = 3,
68  MAP_UINT16 = 5,
69  MAP_RGB = 19,
70  };
71 
72 public:
73 
75  void SetIndexType(int t) { indexType = t; };
76 
78  void SetIndexTypeToUint8() { indexType = INDEX_UINT8; };
79 
81  void SetIndexTypeToUint16() { indexType = INDEX_UINT16; };
82 
84  int GetIndexType() { return indexType; };
85 
87  void SetMapType(int t) { mapType = t; };
88 
90  void SetMapTypeToUint8() { mapType = MAP_UINT8; };
91 
93  void SetMapTypeToUint16() { mapType = MAP_UINT16; };
94 
96  int GetMapType() { return mapType; };
97 
99  int GetColorTableSize();
100 
102  void AllocateTable();
103 
105  void* GetTablePointer();
106 
107 protected:
110 
111 protected:
112 
113  virtual int GetBodyPackSize();
114  virtual int PackBody();
115  virtual int UnpackBody();
116 
119 
121  int mapType;
122 
124  unsigned char* m_ColorTableHeader;
125 
127  unsigned char* m_ColorTable;
128 
129 };
130 
131 
132 } // namespace igtl
133 
134 #endif // _igtlColorTableMessage_h
135 
136 
void SetMapType(int t)
Sets the scalar type of the map.
SmartPointer< Self > Pointer
#define igtlTypeMacro(thisClass, superclass)
Definition: igtlMacro.h:486
A class for the COLORT message type.
SmartPointer< const Self > ConstPointer
A class for the GET_COLORT message type.
virtual int PackBody()
Packs (serialize) the body. Must be implemented in a child class.
unsigned char * m_ColorTableHeader
A pointer to the header for the color table.
virtual int GetBodyPackSize()
Gets the size of the serialized body.
virtual int UnpackBody()
Unpacks (deserialize) the body. Must be implemented in a child class.
#define IGTLCommon_EXPORT
int GetMapType()
Gets the type of the map.
void SetIndexTypeToUint8()
Sets the index type for the color type to 8-bit unsigned integer.
SmartPointer< const Self > ConstPointer
int mapType
A variable to store the type of the map. Either MAP_UINT8, MAP_UINT16 or MAP_RGB. ...
int GetIndexType()
Gets the index type. Returns either INDEX_UINT8 or INDEX_UINT16.
void SetMapTypeToUint8()
Sets the scalar type of the map to 8-bit unsigned integer.
unsigned char * m_ColorTable
A pointer to the color table data.
void SetMapTypeToUint16()
Sets the scalar type of the map to 16-bit unsigned integer.
void SetIndexType(int t)
Sets the index type for the color type.
#define igtlNewMacro(x)
Definition: igtlMacro.h:431
void SetIndexTypeToUint16()
Sets the index type for the color type to 16-bit unsigned integer.
int indexType
A variable to store the index type. Either INDEX_UINT8 or INDEX_UINT16.

Generated at Wed Dec 4 2013 03:48:27 for OpenIGTLink by doxygen 1.8.5 written by Dimitri van Heesch, © 1997-2012