Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  
igtl_ndarray.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_NDARRAY_H
16 #define __IGTL_NDARRAY_H
17 
18 #include "igtl_win32header.h"
19 #include "igtl_util.h"
20 #include "igtl_types.h"
21 #include "igtl_win32header.h"
22 
23 #define IGTL_NDARRAY_HEADER_SIZE 2
24 
25 /* Scalar type */
26 #define IGTL_NDARRAY_STYPE_TYPE_INT8 2
27 #define IGTL_NDARRAY_STYPE_TYPE_UINT8 3
28 #define IGTL_NDARRAY_STYPE_TYPE_INT16 4
29 #define IGTL_NDARRAY_STYPE_TYPE_UINT16 5
30 #define IGTL_NDARRAY_STYPE_TYPE_INT32 6
31 #define IGTL_NDARRAY_STYPE_TYPE_UINT32 7
32 #define IGTL_NDARRAY_STYPE_TYPE_FLOAT32 10
33 #define IGTL_NDARRAY_STYPE_TYPE_FLOAT64 11
34 #define IGTL_NDARRAY_STYPE_TYPE_COMPLEX 13
35 
36 #define IGTL_NDARRAY_HOST_TO_NETWORK 0
37 #define IGTL_NDARRAY_NETWORK_TO_HOST 1
38 
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43 
46 typedef struct {
47  igtl_uint8 type; /* Scalar type (2:int8 3:uint8 4:int16 5:uint16 6:int32
48  7:uint32 10:float32 11:float64 13:complex) */
49  igtl_uint8 dim; /* Dimension of array */
50  igtl_uint16 * size; /* Array size */
51  void * array;
53 
54 
57 
61 int igtl_export igtl_ndarray_alloc_info(igtl_ndarray_info * info, const igtl_uint16 * size);
62 
65 
70 int igtl_export igtl_ndarray_unpack(int type, void * byte_array, igtl_ndarray_info * info, igtl_uint64 pack_size);
71 
76 int igtl_export igtl_ndarray_pack(igtl_ndarray_info * info, void * byte_array, int type);
77 
80 igtl_uint64 igtl_export igtl_ndarray_get_size(igtl_ndarray_info * info, int type);
81 
83 igtl_uint64 igtl_export igtl_ndarray_get_crc(igtl_ndarray_info * info, int type, void* byte_array);
84 
85 
86 #ifdef __cplusplus
87 }
88 #endif
89 
90 #endif /* __IGTL_NDARRAY_H */
void igtl_export igtl_ndarray_init_info(igtl_ndarray_info *info)
#define igtl_export
igtl_uint16 * size
Definition: igtl_ndarray.h:50
igtl_uint8 dim
Definition: igtl_ndarray.h:49
igtl_uint64 igtl_export igtl_ndarray_get_size(igtl_ndarray_info *info, int type)
int igtl_export igtl_ndarray_unpack(int type, void *byte_array, igtl_ndarray_info *info, igtl_uint64 pack_size)
int igtl_export igtl_ndarray_pack(igtl_ndarray_info *info, void *byte_array, int type)
igtl_uint64 igtl_export igtl_ndarray_get_crc(igtl_ndarray_info *info, int type, void *byte_array)
int igtl_export igtl_ndarray_alloc_info(igtl_ndarray_info *info, const igtl_uint16 *size)
igtl_uint8 type
Definition: igtl_ndarray.h:47
int igtl_export igtl_ndarray_free_info(igtl_ndarray_info *info)

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