Fawkes API  Fawkes Development Version
fuse.h
1 
2 /***************************************************************************
3  * fuse.h - FireVision Remote Control Protocol
4  *
5  * Generated: Mon Jan 09 15:47:58 2006
6  * Copyright 2005-2007 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #ifndef __FIREVISION_FVUTILS_NET_FUSE_H_
25 #define __FIREVISION_FVUTILS_NET_FUSE_H_
26 
27 #include <fvutils/color/colorspaces.h>
28 #include <stdint.h>
29 #include <fvutils/ipc/defs.h>
30 #include <netcomm/utils/dynamic_buffer.h>
31 
32 /* Present this e-a-s-t-e-r e-g-g to Tim and get one package of Maoam! */
33 
34 #pragma pack(push,4)
35 
36 namespace firevision {
37 #if 0 /* just to make Emacs auto-indent happy */
38 }
39 #endif
40 
41 /** FUSE version enum. */
42 typedef enum {
43  FUSE_VERSION_1 = 1, /**< Version 1 */
44  FUSE_VERSION_2 = 2, /**< Version 2 */
45  FUSE_VERSION_3 = 3 /**< Version 3 - current */
46 } FUSE_version_t;
47 
48 /** Current FUSE version */
49 #define FUSE_CURRENT_VERSION FUSE_VERSION_3
50 
51 /** FUSE packet types */
52 typedef enum {
53  /* bi-directional packages, 1-999 and 0xFFFFFFFE */
54  FUSE_MT_GREETING = 0xFFFFFFFE, /**< version */
55 
56  /* server to client, 1000-1999 */
57  FUSE_MT_IMAGE = 1000, /**< image */
58  FUSE_MT_LUT = 1001, /**< lookup table */
59  FUSE_MT_IMAGE_LIST = 1002, /**< image list */
60  FUSE_MT_LUT_LIST = 1003, /**< lut list */
61  FUSE_MT_GET_IMAGE_FAILED = 1004, /**< Fetching an image failed */
62  FUSE_MT_GET_LUT_FAILED = 1005, /**< Fetching a LUT failed */
63  FUSE_MT_SET_LUT_SUCCEEDED = 1006, /**< Setting a LUT succeeded */
64  FUSE_MT_SET_LUT_FAILED = 1007, /**< Setting a LUT failed */
65  FUSE_MT_IMAGE_INFO = 1008, /**< image info */
66  FUSE_MT_IMAGE_INFO_FAILED = 1009, /**< Retrieval of image info failed */
67 
68  /* client to server, 2000-2999 */
69  FUSE_MT_GET_IMAGE = 2000, /**< request image */
70  FUSE_MT_GET_LUT = 2001, /**< request lookup table */
71  FUSE_MT_SET_LUT = 2002, /**< set lookup table */
72  FUSE_MT_GET_IMAGE_LIST = 2003, /**< get image list */
73  FUSE_MT_GET_LUT_LIST = 2004, /**< get LUT list */
74  FUSE_MT_GET_IMAGE_INFO = 2005, /**< get image info */
75 
76 } FUSE_message_type_t;
77 
78 /** Image format. */
79 typedef enum {
80  FUSE_IF_RAW = 1, /**< Raw image */
81  FUSE_IF_JPEG = 2 /**< JPEG image */
82 } FUSE_image_format_t;
83 
84 
85 /** general packet header */
86 typedef struct {
87  uint32_t message_type; /**< packet type from FUSE_message_type_t */
88  uint32_t payload_size; /**< payload size */
90 
91 /** FUSE message. */
92 typedef struct {
93  FUSE_header_t header; /**< header */
94  void * payload; /**< payload */
96 
97 /** version packet, bi-directional */
98 typedef struct {
99  uint32_t version; /**< version from FUSE_version_t */
101 
102 /** Lookup table packet header.
103  * server to client: PT_LUT
104  * client to server: PT_SETLUT
105  */
106 typedef struct {
107  char lut_id[LUT_ID_MAX_LENGTH]; /**< LUT ID */
108  uint32_t width; /**< width of LUT */
109  uint32_t height; /**< height of LUT */
110  uint32_t depth; /**< depth of LUT */
111  uint32_t bytes_per_cell; /**< bytes per cell */
113 
114 
115 
116 // uint32_t next_header; /**< ID of next header. */
117 /** Image packet header.
118  * (server to client)
119  */
120 typedef struct {
121  char image_id[IMAGE_ID_MAX_LENGTH]; /**< image ID */
122  uint32_t format : 8; /**< Image format */
123  uint32_t colorspace : 16; /**< color space */
124  uint32_t reserved : 8; /**< reserved for future use */
125  uint32_t width; /**< width in pixels */
126  uint32_t height; /**< height in pixels */
127  uint32_t buffer_size; /**< size of following image buffer in bytes */
128  int64_t capture_time_sec; /**< capture time seconds part */
129  int64_t capture_time_usec; /**< capture time microseconds part */
131 
132 /*
133  uint32_t roi_x; *< ROI X coordinate
134  uint32_t roi_y; *< ROI Y coordinate
135  uint32_t roi_width; *< ROI width
136  uint32_t roi_height; *< ROI height
137  // Circle relative to ROI
138 
139  int32_t circle_x; *< circle x coordinate
140  int32_t circle_y; *< circle y coordinate
141  uint32_t circle_radius; *< circle radius
142  uint32_t flag_circle_found : 1; *< circle found, 1 if found
143  uint32_t flag_reserved : 31; *< reserved for future use
144 */
145 
146 /** Image request message. */
147 typedef struct {
148  char image_id[IMAGE_ID_MAX_LENGTH]; /**< image ID */
149  uint32_t format : 8; /**< requested image format, see FUSE_image_format_t */
150  uint32_t reserved : 24; /**< reserved for future use */
152 
153 
154 /** Image description message. */
155 typedef struct {
156  char image_id[IMAGE_ID_MAX_LENGTH]; /**< image ID */
158 
159 /** LUT description message. */
160 typedef struct {
161  char lut_id[LUT_ID_MAX_LENGTH]; /**< LUT ID */
163 
164 /** Image info message. */
165 typedef struct {
166  char image_id[IMAGE_ID_MAX_LENGTH]; /**< image ID */
167  uint32_t colorspace : 16; /**< color space */
168  uint32_t reserved : 16; /**< reserved for future use */
169  uint32_t width; /**< width in pixels */
170  uint32_t height; /**< height in pixels */
171  uint32_t buffer_size; /**< size of following image buffer in bytes */
173 
174 /** LUT info message. */
175 typedef struct {
176  char lut_id[LUT_ID_MAX_LENGTH]; /**< LUT ID */
177  uint32_t width; /**< width of LUT */
178  uint32_t height; /**< height of LUT */
179  uint32_t depth; /**< depth of LUT */
180  uint32_t bytes_per_cell; /**< bytes per cell */
182 
183 /** Image list message. */
184 typedef struct {
185  fawkes::dynamic_list_t image_list; /**< DynamicBuffer holding a list of FUSE_imageinfo_t */
187 
188 /** LUT list message. */
189 typedef struct {
190  fawkes::dynamic_list_t lut_list; /**< DynamicBuffer holding a list of FUSE_lutinfo_t */
192 
193 } // end namespace firevision
194 
195 #pragma pack(pop)
196 #endif
uint32_t bytes_per_cell
bytes per cell
Definition: fuse.h:180
void * payload
payload
Definition: fuse.h:94
uint32_t colorspace
color space
Definition: fuse.h:123
uint32_t reserved
reserved for future use
Definition: fuse.h:124
general packet header
Definition: fuse.h:86
uint32_t depth
depth of LUT
Definition: fuse.h:110
Image request message.
Definition: fuse.h:147
int64_t capture_time_sec
capture time seconds part
Definition: fuse.h:128
uint32_t buffer_size
size of following image buffer in bytes
Definition: fuse.h:127
Image info message.
Definition: fuse.h:165
LUT list message.
Definition: fuse.h:189
uint32_t width
width in pixels
Definition: fuse.h:125
uint32_t height
height of LUT
Definition: fuse.h:178
Image description message.
Definition: fuse.h:155
uint32_t width
width of LUT
Definition: fuse.h:177
Image packet header.
Definition: fuse.h:120
uint32_t format
Image format.
Definition: fuse.h:122
uint32_t width
width in pixels
Definition: fuse.h:169
fawkes::dynamic_list_t lut_list
DynamicBuffer holding a list of FUSE_lutinfo_t.
Definition: fuse.h:190
Dynamic list type.
uint32_t colorspace
color space
Definition: fuse.h:167
uint32_t version
version from FUSE_version_t
Definition: fuse.h:99
int64_t capture_time_usec
capture time microseconds part
Definition: fuse.h:129
uint32_t width
width of LUT
Definition: fuse.h:108
uint32_t bytes_per_cell
bytes per cell
Definition: fuse.h:111
fawkes::dynamic_list_t image_list
DynamicBuffer holding a list of FUSE_imageinfo_t.
Definition: fuse.h:185
LUT info message.
Definition: fuse.h:175
uint32_t height
height of LUT
Definition: fuse.h:109
version packet, bi-directional
Definition: fuse.h:98
uint32_t reserved
reserved for future use
Definition: fuse.h:168
Lookup table packet header.
Definition: fuse.h:106
uint32_t format
requested image format, see FUSE_image_format_t
Definition: fuse.h:149
FUSE message.
Definition: fuse.h:92
uint32_t height
height in pixels
Definition: fuse.h:170
uint32_t payload_size
payload size
Definition: fuse.h:88
uint32_t reserved
reserved for future use
Definition: fuse.h:150
uint32_t buffer_size
size of following image buffer in bytes
Definition: fuse.h:171
uint32_t height
height in pixels
Definition: fuse.h:126
uint32_t message_type
packet type from FUSE_message_type_t
Definition: fuse.h:87
Image list message.
Definition: fuse.h:184
uint32_t depth
depth of LUT
Definition: fuse.h:179
FUSE_header_t header
header
Definition: fuse.h:93
LUT description message.
Definition: fuse.h:160