Gocator Vision Library
 All Classes Files Functions Variables Typedefs Friends Modules Pages
GvSurfaceMsg.h
Go to the documentation of this file.
1 /**
2 * @file GvSurfaceMsg.h
3 * @brief Declares the GvSurfaceMsg class.
4 *
5 * Copyright (C) 2017-2022 by LMI Technologies Inc. All rights reserved.
6 */
7 #ifndef GV_SURFACE_MSG_H
8 #define GV_SURFACE_MSG_H
9 
11 
12 /**
13 * Encapsulates a surface message.
14 *
15 * @class GvSurfaceMsg
16 * @extends GvDataMsg
17 * @ingroup GoVision-Data
18 */
19 typedef GvDataMsg GvSurfaceMsg;
20 
21 //Takes ownership of ranges and intensities data
22 GvFx(kStatus) GvSurfaceMsg_Construct(GvSurfaceMsg* msg, const kStamp* stamp, k64u time, k64s encoder, kArray2 ranges, kArray2 intensities,
23  const kPoint3d64f* offset, const kPoint3d64f* scale,
24  kAlloc allocator);
25 
26 //Takes ownership of ranges and intensities data
27 GvFx(kStatus) GvSurfaceMsg_ConstructUnresampled(GvSurfaceMsg* msg, const kStamp* stamp, k64u time, k64s encoder, kArray2 ranges, kArray2 intensities,
28  kAlloc allocator);
29 
30 GvFx(kStatus) GvSurfaceMsg_ConstructSimple(GvSurfaceMsg* msg, kSize width, kSize height, kAlloc alloc);
31 GvFx(kStatus) GvSurfaceMsg_ConstructUnresampledSimple(GvSurfaceMsg* msg, kSize width, kSize height, kAlloc alloc);
32 
33 /**
34  * Returns the width as number of columns.
35  *
36  * @public @memberof GvSurfaceMsg
37  * @param msg Message object.
38  * @return Column count.
39  */
41 
42 /**
43  * Returns the length as number of rows.
44  *
45  * @public @memberof GvSurfaceMsg
46  * @param msg Message object.
47  * @return Row count.
48  */
50 
51 /**
52  * Returns the x,y,z offset of the data message.
53  *
54  * @public @memberof GvSurfaceMsg
55  * @param msg Message object.
56  * @return Pointer to data offset.
57  */
59 
60 /**
61  * Sets the x,y,z offset of the data message.
62  *
63  * @public @memberof GvSurfaceMsg
64  * @param msg Message object.
65  * @param offset Pointer to data offset.
66  * @return Operation status.
67  */
68 GvFx(kStatus) GvSurfaceMsg_SetOffset(GvSurfaceMsg msg, const kPoint3d64f* offset);
69 
70 /**
71  * Returns the x,y,z scale of the data message.
72  *
73  * @public @memberof GvSurfaceMsg
74  * @param msg Message object.
75  * @return Pointer to data scale.
76  */
78 
79 /**
80  * Sets the x,y,z scale of the data message.
81  *
82  * @public @memberof GvSurfaceMsg
83  * @param msg Message object.
84  * @param scale Pointer to data scale.
85  * @return Operation status.
86  */
87 GvFx(kStatus) GvSurfaceMsg_SetScale(GvSurfaceMsg msg, const kPoint3d64f* scale);
88 
89 /**
90  * Returns the message point type.
91  *
92  * @public @memberof GvSurfaceMsg
93  * @param msg Message object.
94  * @return Point type.
95  */
97 
98 /**
99  * Returns a pointer to the points buffer.
100  *
101  * The buffer can be both read and written. The buffer is organized such that
102  * values in the same row are contiguous. In other words, the value at row i and
103  * column j is at address i * width + j.
104  *
105  * @public @memberof GvSurfaceMsg
106  * @param msg Message object.
107  * @return Buffer pointer.
108  */
109 GvFx(void*) GvSurfaceMsg_Points(GvSurfaceMsg msg);
110 
111 /**
112  * Copies the points buffer with the data from an array.
113  *
114  * The item type and dimensions of the array must match those of the message.
115  * Otherwise an error is returned.
116  *
117  * @public @memberof GvSurfaceMsg
118  * @param msg Message object.
119  * @param points Points array.
120  * @return Operation status.
121  */
123 
124 /**
125  * @deprecated. Use GvSurfaceMsg_CopyPointsArray() instead.
126  * Updates the points buffer with the data from an array.
127  *
128  * The item type and dimensions of the array must match those of the message.
129  * Otherwise an error is returned.
130  * Note: this does not transfer ownership of the passed array but only copies it
131  * into the message object.
132  *
133  * @public @memberof GvSurfaceMsg
134  * @param msg Message object.
135  * @param points Points array.
136  * @return Operation status.
137  */
139 
140 /**
141  * Returns an array object containing the points.
142  *
143  * The user must not free the returned array.
144  *
145  * The implementation reuses the points buffer so it is fairly efficient.
146  * A shell object is still constructed however so it is not as efficient as
147  * using the buffer directly.
148  *
149  * @public @memberof GvSurfaceMsg
150  * @param msg Message object.
151  * @return Buffer pointer.
152  */
154 
155 /**
156  * Returns whether or not this message contains intensity data.
157  *
158  * @public @memberof GvSurfaceMsg
159  * @param msg Message object.
160  * @return Presence of intensity data.
161  */
163 
164 /**
165  * Returns the message intensity type.
166  *
167  * @public @memberof GvSurfaceMsg
168  * @param msg Message object.
169  * @return Intensity type.
170  */
172 
173 /**
174  * Allocates an intensity buffer for the message.
175  *
176  * If the buffer already exists and is of the same type as requested, success
177  * is returned. If it exists but type does not match, kERROR_ALREADY_EXISTS is returned.
178  *
179  * @public @memberof GvSurfaceMsg
180  * @param msg Message object.
181  * @param type Type of intensity values.
182  * @return Operation status.
183  */
185 
186 /**
187  * Returns a pointer to the intensity buffer.
188  *
189  * The buffer can be both read and written.
190  *
191  * @public @memberof GvSurfaceMsg
192  * @param msg Message object.
193  * @return Buffer pointer.
194  */
195 GvFx(void*) GvSurfaceMsg_Intensity(GvSurfaceMsg msg);
196 
197 /**
198  * Copies the intensity buffer with the data from an array into the message.
199  *
200  * The item type and size of the array must match those of the message.
201  * Otherwise an error is returned.
202  *
203  * @public @memberof GvSurfaceMsg
204  * @param msg Message object.
205  * @param intensity Intensity array.
206  * @return Operation status.
207  */
209 
210 /**
211  * @deprecated. Use GvSurfaceMsg_CopyIntensityArray() instead.
212  * Updates the intensity buffer with the data from an array.
213  * Note: this does not transfer ownership of the passed array but only copies it
214  * into the message object.
215  *
216  * The item type and size of the array must match those of the message.
217  * Otherwise an error is returned.
218  *
219  * @public @memberof GvSurfaceMsg
220  * @param msg Message object.
221  * @param intensity Intensity array.
222  * @return Operation status.
223  */
225 
226 /**
227  * Returns an array object containing the intensity data.
228  *
229  * The user must not free the returned array.
230  *
231  * @public @memberof GvSurfaceMsg
232  * @param msg Message object.
233  * @return Array object.
234  */
236 
237 /**
238 * Returns true if this is a resampled surface msg
239 *
240 * @public @memberof GvSurfaceMsg
241 * @param msg Message object.
242 * @return kBool.
243 */
245 
246 /**
247 * Sets if the data in a surface msg is adjacent (renderable)
248 * Default: kFALSE
249 *
250 * @public @memberof GvSurfaceMsg
251 * @param msg Message object.
252 * @param isAdjacent Is the data adjacent?
253 * @return kBool.
254 */
256 
257 /**
258 * Returns true if the surface data in the message is adjacent
259 *
260 * @public @memberof GvSurfaceMsg
261 * @param msg Message object.
262 * @return kBool.
263 */
265 
266 /**
267  * Sets the rendering object within the message.
268  *
269  * @public @memberof GvSurfaceMsg
270  * @param msg Message object.
271  * @param object GdkGraphic object (ownership is transferred).
272  * @return Operation status.
273  */
275 
276 /**
277  * Retrieves the rendering object from the message.
278  *
279  * @public @memberof GvSurfaceMsg
280  * @param msg Message object.
281  * @return GdkGraphic object (ownership is transferred).
282  */
284 
285 /**
286 * Copies the surface start information from the provided table into the
287 * the surface message.
288 *
289 * @public @memberof GvSurfaceMsg
290 * @param msg Message object.
291 * @param startTable Table containing the surface start information to copy
292 * into the surface message.
293 * @return Operation status.
294 */
296 
297 /**
298 * Returns a handle to the surface message's start info table.
299 *
300 * @public @memberof GvSurfaceMsg
301 * @param msg Message object.
302 * @return Handle to surface message's kArray2 start info table.
303 */
305 
306 /**
307  * Returns the x,y,z offset with respect to frame of reference for the surface message .
308  *
309  * @public @memberof GvSurfaceMsg
310  * @param msg Message object.
311  * @return Surface offset.
312  */
314 
315 #include <GoVision/Data/GvSurfaceMsg.x.h>
316 
317 #endif
kStatus GvSurfaceMsg_SetPointsArray(GvSurfaceMsg msg, kArray2 points)
kStatus GvSurfaceMsg_SetRendering(GvSurfaceMsg msg, kObject object)
Sets the rendering object within the message.
kBool GvSurfaceMsg_IsAdjacent(GvSurfaceMsg msg)
Returns true if the surface data in the message is adjacent.
kObject GvSurfaceMsg_Rendering(GvSurfaceMsg msg)
Retrieves the rendering object from the message.
Encapsulates a surface message.
kArray2 GvSurfaceMsg_PointsArray(GvSurfaceMsg msg)
Returns an array object containing the points.
kStatus GvSurfaceMsg_SetOffset(GvSurfaceMsg msg, const kPoint3d64f *offset)
Sets the x,y,z offset of the data message.
kBool GvSurfaceMsg_HasIntensity(GvSurfaceMsg msg)
Returns whether or not this message contains intensity data.
kStatus GvSurfaceMsg_SetIntensityArray(GvSurfaceMsg msg, kArray2 intensity)
Base class for data messages.
kStatus GvSurfaceMsg_AllocateIntensity(GvSurfaceMsg msg, kType type)
Allocates an intensity buffer for the message.
kArray2 GvSurfaceMsg_IntensityArray(GvSurfaceMsg msg)
Returns an array object containing the intensity data.
kSize GvSurfaceMsg_Width(GvSurfaceMsg msg)
Returns the width as number of columns.
void * GvSurfaceMsg_Intensity(GvSurfaceMsg msg)
Returns a pointer to the intensity buffer.
Declares the GvDataMsg class.
kSize GvSurfaceMsg_Length(GvSurfaceMsg msg)
Returns the length as number of rows.
kStatus GvSurfaceMsg_CopyPointsArray(GvSurfaceMsg msg, kArray2 points)
Copies the points buffer with the data from an array.
kPoint3d64f GvSurfaceMsg_OffsetWithRef(GvSurfaceMsg msg)
Returns the x,y,z offset with respect to frame of reference for the surface message ...
kStatus GvSurfaceMsg_SetIsAdjacent(GvSurfaceMsg msg, kBool isAdjacent)
Sets if the data in a surface msg is adjacent (renderable) Default: kFALSE.
kType GvSurfaceMsg_IntensityType(GvSurfaceMsg msg)
Returns the message intensity type.
kStatus GvSurfaceMsg_SetScale(GvSurfaceMsg msg, const kPoint3d64f *scale)
Sets the x,y,z scale of the data message.
kStatus GvSurfaceMsg_AddSurfaceStartInfo(GvSurfaceMsg msg, kArray2 startTable)
Copies the surface start information from the provided table into the the surface message...
kBool GvSurfaceMsg_IsResampled(GvSurfaceMsg msg)
Returns true if this is a resampled surface msg.
kArray2 GvSurfaceMsg_SurfaceStartInfo(GvSurfaceMsg msg)
Returns a handle to the surface message's start info table.
void * GvSurfaceMsg_Points(GvSurfaceMsg msg)
Returns a pointer to the points buffer.
kStatus GvSurfaceMsg_CopyIntensityArray(GvSurfaceMsg msg, kArray2 intensity)
Copies the intensity buffer with the data from an array into the message.
kType GvSurfaceMsg_PointType(GvSurfaceMsg msg)
Returns the message point type.
const kPoint3d64f * GvSurfaceMsg_Scale(GvSurfaceMsg msg)
Returns the x,y,z scale of the data message.
const kPoint3d64f * GvSurfaceMsg_Offset(GvSurfaceMsg msg)
Returns the x,y,z offset of the data message.