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
23namespace igtl
24{
25
28{
29public:
34
37
38protected:
39 GetColorTableMessage() : MessageBase() { this->m_DefaultBodyType = "GET_COLORT"; };
41
42protected:
43 virtual int GetBodyPackSize() { return 0; };
44 virtual int PackBody() { AllocatePack(); return 1; };
45 virtual int UnpackBody() { return 1; };
46};
47
48
51{
52public:
57
60
61public:
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
72public:
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
100
103
106
107protected:
110
111protected:
112
113 virtual int GetBodyPackSize();
114 virtual int PackBody();
115 virtual int UnpackBody();
116
119
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
A class for the COLORT message type.
void AllocateTable()
Allocates a memory area for the color table.
void * GetTablePointer()
Returns a pointer to the color table.
int mapType
A variable to store the type of the map. Either MAP_UINT8, MAP_UINT16 or MAP_RGB.
void SetMapTypeToUint8()
Sets the scalar type of the map to 8-bit unsigned integer.
virtual int PackBody()
Packs (serialize) the body. Must be implemented in a child class.
SmartPointer< const Self > ConstPointer
virtual int UnpackBody()
Unpacks (deserialize) the body. Must be implemented in a child class.
void SetIndexType(int t)
Sets the index type for the color type.
int GetColorTableSize()
Gets the size of the color table.
void SetIndexTypeToUint16()
Sets the index type for the color type to 16-bit unsigned integer.
int GetMapType()
Gets the type of the map.
unsigned char * m_ColorTable
A pointer to the color table data.
void SetMapType(int t)
Sets the scalar type of the map.
int GetIndexType()
Gets the index type. Returns either INDEX_UINT8 or INDEX_UINT16.
int indexType
A variable to store the index type. Either INDEX_UINT8 or INDEX_UINT16.
void SetIndexTypeToUint8()
Sets the index type for the color type to 8-bit unsigned integer.
void SetMapTypeToUint16()
Sets the scalar type of the map to 16-bit unsigned integer.
virtual int GetBodyPackSize()
Gets the size of the serialized body.
SmartPointer< Self > Pointer
unsigned char * m_ColorTableHeader
A pointer to the header for the color table.
A class for the GET_COLORT message type.
igtlNewMacro(igtl::GetColorTableMessage)
virtual int GetBodyPackSize()
Gets the size of the serialized body.
virtual int UnpackBody()
Unpacks (deserialize) the body. Must be implemented in a child class.
SmartPointer< const Self > ConstPointer
virtual int PackBody()
Packs (serialize) the body. Must be implemented in a child class.
igtlTypeMacro(igtl::GetColorTableMessage, igtl::MessageBase)
Implements transparent reference counting.
#define igtlTypeMacro(thisClass, superclass)
Definition igtlMacro.h:486
#define igtlNewMacro(x)
Definition igtlMacro.h:431
#define IGTLCommon_EXPORT
The "igtl" namespace contains all OpenIGTLink classes. There are several nested namespaces within the...

Generated for OpenIGTLink by Doxygen 1.9.8 written by Dimitri van Heesch, © 1997-2012