GoWebScan API
GoWebScanUtilities.h
Go to the documentation of this file.
1 /**
2 * @file GoWebScanUtilities.h
3 * @brief Defines GoWebScan utility functions.
4 *
5 * @internal
6 * Copyright (C) 2017-2025 by LMI Technologies Inc.
7 * Licensed under the MIT License.
8 * Redistributed files must retain the above copyright notice.
9 */
10 
11 #ifndef GO_WEB_SCAN_UTILITIES_H
12 #define GO_WEB_SCAN_UTILITIES_H
13 
14 #include <GoSdk/GoSensor.h>
19 #include <kApi/Data/kArray1.h>
20 #include <kApi/Data/kArray2.h>
21 #include <kApi/Data/kArray3.h>
22 #include <kApi/Data/kImage.h>
23 #include <kApi/Data/kMath.h>
24 #include <kApi/Io/kDirectory.h>
25 
26 #include <math.h>
27 
28 #define NM_TO_MM(VALUE) (((k64f)(VALUE))/1000000.0) ///< Converts nanometers to millimeters
29 #define UM_TO_MM(VALUE) (((k64f)(VALUE))/1000.0) ///< Converts micrometers to millimeters
30 #define MM_TO_MILS(VALUE) (((k64f)(VALUE)*(1.0/0.0254))) ///< Converts millimeters to mils
31 #define MILS_TO_MM(VALUE) (((k64f)(VALUE)*0.0254)) ///< Converts mils to millimeters
32 #define B_TO_MB(VALUE) (((k64f)(VALUE))/1000000.0) ///< Converts bytes to megabytes
33 
34 typedef kStatus(kCall* GoWebScanUtilsSensorFx)(kPointer context, GoSensor sensor);
35 
36 /**
37 * Applies an obstruction to raw sensor profile data. The obstruction defines a mask covering a
38 * specified ROI in Z and X. Masked points are set to null.
39 *
40 * @public @memberof GoWebScanSdk
41 * @param inPoints Pointer to input profile points.
42 * @param outPoints Pointer to masked output profile points. Can reuse the input buffer.
43 * @param count Count of profile points.
44 * @param obstructions Pointer to start of obstruction buffer.
45 * @param obstructionCount Count of obstructions in buffer.
46 * @return Operation status.
47 */
48 GoWebScanFx(kStatus) GoWebScanUtils_ApplyProfileMask(const kPoint16s* inPoints, kPoint16s* outPoints, kSize count, const GoWebScanObstruction* obstructions, kSize obstructionCount);
49 
50 /**
51 * Reorients profile data to align with system coordinates in standard orientation. In standard
52 * orientation, the sensor X-axis is aligned to the system X-axis, and the sensor z-axis is
53 * opposite the system z-axis. X data is converted to system coordinates.
54 *
55 * @public @memberof GoWebScanSdk
56 * @param inPoints Pointer to input profile points.
57 * @param outPoints Pointer to reoriented profile points.
58 * @param count Count of profile points.
59 * @param xInCenter X-center of sensor in system coordinates.
60 * @param xOrientation X-orientation of sensor.
61 * @param zOrientation Z-orientation of sensor.
62 * @return Operation status.
63 * @see GoWebScanSettings_XOrientation, GoWebScanSettings_ZOrientation
64 */
65 GoWebScanFx(kStatus) GoWebScanUtils_ApplyProfileOrientation(const kPoint16s* inPoints, kPoint16s* outPoints, kSSize count, k32s xInCenter, k32s xOrientation, k32s zOrientation);
66 
67 /**
68 * Applies an offset in Z to each input profile point. These offsets typically represent a system
69 * calibration to align all sensors to a common plane.
70 *
71 * @public @memberof GoWebScanSdk
72 * @param inPoints Pointer to input profile points. Can reuse the input buffer.
73 * @param zOffsets Pointer to Z offset buffer.
74 * @param outPoints Pointer to reoriented profile points.
75 * @param count Count of profile points.
76 * @return Operation status.
77 */
78 GoWebScanFx(kStatus) GoWebScanUtils_ApplyProfileZOffset(const kPoint16s* inPoints, const k16s* zOffsets, kPoint16s* outPoints, kSSize count);
79 
80 /**
81 * Modifies profile spots that fall on the side edge of a board (edge along Y-axis) and report a
82 * different range than their neighbour. Side edge spots are modified to report the range of the
83 * adjacent spot that is on the board, giving the board edge a 90 degree angle and more accurate
84 * length instead of a curved edge.
85 *
86 * @public @memberof GoWebScanSdk
87 * @param inPoints Pointer to input profile points.
88 * @param outPoints Pointer to output profile points.
89 * @param count Count of profile points.
90 * @param extrapolationWindow Amount along X-axis to extend board.
91 * @return Operation status.
92 */
93 GoWebScanFx(kStatus) GoWebScanUtils_ExtendSideProfile(const kPoint16s* inPoints, kPoint16s* outPoints, kSSize count, kSSize extrapolationWindow);
94 
95 /**
96 * Resamples profile data in the X-axis.
97 *
98 * @public @memberof GoWebScanSdk
99 * @param style Type of interpolation to apply during resampling.
100 * @param inPoints Pointer to input profile points.
101 * @param pointCount Count of input profile points.
102 * @param outPoints Pointer to output resampled Z profiles.
103 * @param profileCount Count of output profiles.
104 * @param xStart Start location, in mils, of resampling. In system coordinates.
105 * @param xRes Desired resolution, in mils/pixel, of resampled data.
106 * @param interpolationWindow Maximum input data X-gap, in mils, to be filled in with resampled data.
107 * @param extrapolationWindow Distance, in mils, to extend resampling window around pairs of input points.
108 * @return Operation status.
109 */
110 GoWebScanFx(kStatus) GoWebScanUtils_ResampleProfileX(GoWebScanInterpolation style, const kPoint16s* inPoints, kSSize pointCount, k16s* outProfile, kSSize profileCount, k32s xStart, k32s xRes, k32s interpolationWindow, k32s extrapolationWindow);
111 
112 /**
113 * Fills gaps in input Z data. Null input Z values are filled leftmost valid point. Initial null regions
114 * are filled with rightmost valid Z value.
115 *
116 * @public @memberof GoWebScanSdk
117 * @param inProfile Pointer to input profiles.
118 * @param outProfile Pointer to output profiles. Can reuse the input buffer.
119 * @param count Count of profile values.
120 * @param defaultZValue Value to fill gaps if no valid values are found.
121 * @return Operation status.
122 */
123 GoWebScanFx(kStatus) GoWebScanUtils_FillResampledProfile(const k16s* inProfile, k16s* outProfile, kSSize count, k16s defaultZValue);
124 
125 /**
126 * Reorients vision data to align with system coordinates in standard orientation. In standard
127 * orientation, the sensor X-axis is aligned to the system X-axis, and the sensor Y-axis is
128 * opposite the system Y-axis.
129 *
130 * @public @memberof GoWebScanSdk
131 * @param in Input vision image. Type k8u (raw Bayer image).
132 * @param out Reoriented output vision image. Type k8u (raw Bayer image).
133 * @param xOrientation X-orientation of sensor.
134 * @param yOrientation Y-orientation of sensor.
135 * @return Operation status.
136 * @see GoWebScanSettings_XOrientation, GoWebScanSettings_YOrientation
137 */
138 GoWebScanFx(kStatus) GoWebScanUtils_ApplyVisionOrientation(kImage in, kImage out, k32s xOrientation, k32s yOrientation);
139 
140 /**
141  * Applies color gains to input raw Bayer image. Gains are typically determined during
142  * system calibration.
143  *
144  * @public @memberof GoWebScanSdk
145  * @param in Input vision image. Type k8u (raw Bayer image).
146  * @param out Output vision image. Type k8u (raw Bayer image).
147  * @param gains Array of gains for all 4 channels for the image. Height of array is same
148  * as input image, width is 4*input width. Type k16u.
149  * @param gainShift Bit shift of gains.
150  * @return Operation status.
151  */
152 GoWebScanFx(kStatus) GoWebScanUtils_ApplyVisionGains(kImage in, kImage out, kArray2 gains, k32s gainShift);
153 
154 /**
155  * Reorients tracheid data to align with system coordinates in standard orientation. In standard
156  * orientation, the sensor X-axis is aligned to the system X-axis, and the sensor z-axis is
157  * opposite the system z-axis. X data is converted to system coordinates.
158  *
159  * @public @memberof GoWebScanSdk
160  * @param inPoints Pointer to input tracheid points.
161  * @param outPoints Pointer to output tracheid points.
162  * @param count Number of points.
163  * @param xInCenter X-center of sensor in system coordinates.
164  * @param xOrientation X-orientation of sensor.
165  * @return Operation status.
166  * @see GoWebScanSettings_XOrientation
167  */
168 GoWebScanFx(kStatus) GoWebScanUtils_ApplyTracheidOrientation(const GoWebScanTracheidPoint* inPoints, GoWebScanTracheidPoint* outPoints, kSSize count, k32s xInCenter, k32s xOrientation);
169 
170 /**
171  * Resamples tracheid data in the X-axis.
172  *
173  * @public @memberof GoWebScanSdk
174  * @param inPoints Pointer to input tracheid points.
175  * @param pointCount Number of input points.
176  * @param outValues Pointer to output resampled tracheid values.
177  * @param valueCount Number of output values.
178  * @param xStart Start location, in mils, of resampling. In system coordinates.
179  * @param xRes Desired resolution, in mils/pixel, of resampled data.
180  * @param interpolationWindow Maximum input data X-gap, in mils, to be filled in with resampled
181  * data.
182  * @param extrapolationWindow Distance, in mils, to extend resampling window around pairs of
183  * input points.
184  * @return Operation status.
185  */
186 GoWebScanFx(kStatus) GoWebScanUtils_ResampleTracheidX(const GoWebScanTracheidPoint* inPoints, kSSize pointCount, GoWebScanTracheidValue* outValues, kSSize valueCount, k32s xStart, k32s xRes, k32s interpolationWindow, k32s extrapolationWindow);
187 
188 /**
189  * Replaces all values in a profile system tile with nulls.
190  *
191  * @public @memberof GoWebScanSdk
192  * @param systemData Profile system tile. Type k16s.
193  * @return Operation status.
194  */
195 GoWebScanFx(kStatus) GoWebScanUtils_ClearProfileSystemTile(kArray2 systemData);
196 
197 /**
198  * Replaces all values in a vision system tile with zeroes.
199  *
200  * @public @memberof GoWebScanSdk
201  * @param systemData Vision system tile. Type kRgb.
202  * @return Operation status.
203  */
204 GoWebScanFx(kStatus) GoWebScanUtils_ClearVisionSystemTile(kArray2 systemData);
205 
206 /**
207  * Replaces all values in a tracheid system tile with nulls.
208  *
209  * @public @memberof GoWebScanSdk
210  * @param systemData Tracheid system tile. Type GoWebScanTracheidValue.
211  * @return Operation status.
212  */
213 GoWebScanFx(kStatus) GoWebScanUtils_ClearTracheidSystemTile(kArray3 systemData);
214 
215 /**
216  * Copies a profile tile from an individual sensor into a system tile at a specified column.
217  *
218  * @public @memberof GoWebScanSdk
219  * @param systemData Profile system tile. Type k16s.
220  * @param childData Profile sensor tile. Type k16s.
221  * @param x0 Column index within system tile to copy child data into.
222  * @return Operation status.
223  */
224 GoWebScanFx(kStatus) GoWebScanUtils_CopyProfileChildTile(kArray2 systemData, kArray2 childData, kSSize x0);
225 
226 /**
227  * Copies a vision tile from an individual sensor into a system tile at a specified column.
228  *
229  * @public @memberof GoWebScanSdk
230  * @param systemData Vision system tile. Type kRgb.
231  * @param childData Vision sensor tile. Type kRgb.
232  * @param x0 Column index within system tile to copy child data into.
233  * @return Operation status.
234  */
235 GoWebScanFx(kStatus) GoWebScanUtils_CopyVisionChildTile(kArray2 systemData, kArray2 childData, kSSize x0);
236 
237 /**
238  * Copies a tracheid tile from an individual sensor into a system tile at a specified column.
239  *
240  * @public @memberof GoWebScanSdk
241  * @param systemData Tracheid system tile. Type GoWebScanTracheidValue.
242  * @param childData Tracheid sensor tile. Type GoWebScanTracheidValue.
243  * @param x0 Column index within system tile to copy child data into.
244  * @return Operation status.
245  */
246 GoWebScanFx(kStatus) GoWebScanUtils_CopyTracheidChildTile(kArray3 systemData, kArray3 childData, kSSize x0);
247 
248 /**
249  * Copies two sensors' profile tiles into the system tile and blends the overlap in X. Data is
250  * blended by a weighted average.
251  *
252  * @public @memberof GoWebScanSdk
253  * @param systemData Profile system tile. Type k16s.
254  * @param childData0 First profile sensor tile. Type k16s.
255  * @param childData1 Second profile sensor tile. Type k16s.
256  * @param x0 Column index within system tile to copy first profile sensor tile into.
257  * @param x1 Column index within system tile to copy second profile sensor tile into.
258  * @return Operation status.
259  */
260 GoWebScanFx(kStatus) GoWebScanUtils_BlendProfileChildOverlap(kArray2 systemData, kArray2 childData0, kArray2 childData1, kSSize x0, kSSize x1);
261 
262 /**
263  * Copies two sensors' vision tiles into the system tile and blends the overlap in X. Data is
264  * blended by a weighted average.
265  *
266  * @public @memberof GoWebScanSdk
267  * @param systemData Vision system tile. Type kRgb.
268  * @param childData0 First vision sensor tile. Type kRgb.
269  * @param childData1 Second vision sensor tile. Type kRgb.
270  * @param x0 Column index within system tile to copy first vision sensor tile into.
271  * @param x1 Column index within system tile to copy second vision sensor tile into.
272  * @return Operation status.
273  */
274 GoWebScanFx(kStatus) GoWebScanUtils_BlendVisionChildOverlap(kArray2 systemData, kArray2 childData0, kArray2 childData1, kSSize x0, kSSize x1);
275 
276 /**
277 * Copies two sensors' tracheid tiles into the system tile and blends the overlap in X. Data is
278 * blended by a weighted average.
279 *
280 * @public @memberof GoWebScanSdk
281 * @param systemData Tracheid system tile. Type GoWebScanTracheidValue.
282 * @param childData0 First tracheid sensor tile. Type GoWebScanTracheidValue.
283 * @param childData1 Second tracheid sensor tile. Type GoWebScanTracheidValue.
284 * @param x0 Column index within system tile to copy first tracheid sensor tile into.
285 * @param x1 Column index within system tile to copy second tracheid sensor tile into.
286 * @return Operation status.
287 */
288 GoWebScanFx(kStatus) GoWebScanUtils_BlendTracheidChildOverlap(kArray3 systemData, kArray3 childData0, kArray3 childData1, kSSize x0, kSSize x1);
289 
290 /**
291  * Copies two sensors' profile tiles into the system tile and fills the gap in X. Data is filled
292  * with interpolated data.
293  *
294  * @public @memberof GoWebScanSdk
295  * @param systemData Profile system tile. Type k16s.
296  * @param childData0 First profile sensor tile. Type k16s.
297  * @param childData1 Second profile sensor tile. Type k16s.
298  * @param x0 Column index within system tile to copy first profile sensor tile
299  * into.
300  * @param x1 Column index within system tile to copy second profile sensor tile
301  * into.
302  * @param gapSearchWindow Gaps are processed by searching for the last valid left element and
303  * first valid right element within the gap search window.
304  * @param interpolation Type of interpolation to use to fill gap.
305  * @return Operation status.
306  */
307 GoWebScanFx(kStatus) GoWebScanUtils_FillProfileChildGap(kArray2 systemData, kArray2 childData0, kArray2 childData1, kSSize x0, kSSize x1, k32s gapSearchWindow, GoWebScanInterpolation interpolation);
308 
309 /**
310 * Copies two sensors' vision tiles into the system tile and fills the gap in X. Data is filled
311 * with the nearest neighbour's value.
312 *
313 * @public @memberof GoWebScanSdk
314 * @param systemData Vision system tile. Type kRgb.
315 * @param childData0 First vision sensor tile. Type kRgb.
316 * @param childData1 Second vision sensor tile. Type kRgb.
317 * @param x0 Column index within system tile to copy first vision sensor tile
318 * into.
319 * @param x1 Column index within system tile to copy second vision sensor tile
320 * into.
321 * @param gapSearchWindow Gaps are processed by searching for the last valid left element and
322 * first valid right element within the gap search window.
323 * @return Operation status.
324 */
325 GoWebScanFx(kStatus) GoWebScanUtils_FillVisionChildGap(kArray2 systemData, kArray2 childData0, kArray2 childData1, kSSize x0, kSSize x1, k32s gapSearchWindow);
326 
327 /**
328 * Copies two sensors' tracheid tiles into the system tile and fills the gap in X. Data is filled
329 * with the nearest neighbour's value.
330 *
331 * @public @memberof GoWebScanSdk
332 * @param systemData Tracheid system tile. Type GoWebScanTracheidValue.
333 * @param childData0 First tracheid sensor tile. Type GoWebScanTracheidValue.
334 * @param childData1 Second tracheid sensor tile. Type GoWebScanTracheidValue.
335 * @param x0 Column index within system tile to copy first tracheid sensor tile
336 * into.
337 * @param x1 Column index within system tile to copy second tracheid sensor tile
338 * into.
339 * @param gapSearchWindow Gaps are processed by searching for the last valid left element and
340 * first valid right element within the gap search window.
341 * @return Operation status.
342 */
343 GoWebScanFx(kStatus) GoWebScanUtils_FillTracheidChildGap(kArray3 systemData, kArray3 childData0, kArray3 childData1, kSSize x0, kSSize x1, k32s gapSearchWindow);
344 
345 /**
346  * Determines presence information from input profiles and adds to existing presence
347  * information. Presence is defined as true when a profile is non-null, false otherwise.
348  *
349  * @public @memberof GoWebScanSdk
350  * @param presenceData Pointer to input profile buffer.
351  * @param presenceTest Pointer to output presence buffer. Can contain existing presence
352  * information, otherwise all values should be set to 0.
353  * @param count Number of profiles.
354  * @return Operation status.
355  */
356 GoWebScanFx(kStatus) GoWebScanUtils_AddPresenceData(const k16s* presenceData, kBool* presenceTest, kSSize count);
357 
358 /**
359  * Determines if an object is detected in a row of input presence data. An object is defined as
360  * having a true presence count greater than the trigger threshold. The true presence values can
361  * either be located anywhere in the row (global detection style) or must be contiguous (local
362  * detection style).
363  *
364  * @public @memberof GoWebScanSdk
365  * @param presenceTest Pointer to input presence buffer.
366  * @param count Number of presence values.
367  * @param detectionStyle The board detection style.
368  * @param triggerThreshold Minimum number of true presence data to trigger if an object is
369  * detected.
370  * @param isDetected Receives a boolean representing if an object was found in the
371  * data.
372  * @return Operation status.
373  */
374 GoWebScanFx(kStatus) GoWebScanUtils_DetectObject(const kBool* presenceTest, kSSize count, GoWebScanDetectionStyle detectionStyle, k32s triggerThreshold, kBool* isDetected);
375 
376 /**
377  * Extracts a requested section from a profile system tile (representing merged and resampled
378  * data from an entire plane of the system). The section is represented by a start column
379  * (ceil(system x0 / xRes)). The output section array should be initialized to be the section
380  * width (ceil((x1 - x0) / xRes)) and have a height matching the input profile system tile.
381  *
382  * @public @memberof GoWebScanSdk
383  * @param tile Input profile system tile's data array. Type k16s.
384  * @param section Output data array representing requested section. Array should be
385  * constructed and initialized to the expected section width (width of
386  * section in mils divided by X resolution) and expected section height
387  * (same height as the profile system tile). Type k16s.
388  * @param tileX0 The profile system tile's start column. Can be determined from
389  * GoWebScanConfig_XStartPix.
390  * @param sectionX0 The section's start column. Can be determined by the section x0 in
391  * GoWebScanSettings divided by the X resolution.
392  * @param nullValue Null value to fill data with if the section falls outside the system
393  * tile's X field of view.
394  * @return Operation status.
395  */
396 GoWebScanFx(kStatus) GoWebScanUtils_ProfileTileToSection(kArray2 tile, kArray2 section, kSSize tileX0, kSSize sectionX0, k16s nullValue);
397 
398 /**
399 * Extracts a requested section from a vision system tile (representing merged and resampled
400 * data from an entire plane of the system). The section is represented by a start column
401 * (ceil(system x0 / xRes)). The output section array should be initialized to be the section
402 * width (ceil((x1 - x0) / xRes)) and have a height matching the input vision system tile.
403 *
404 * @public @memberof GoWebScanSdk
405 * @param tile Input vision system tile's data array. Type kRgb.
406 * @param section Output data array representing requested section. Array should be
407 * constructed and initialized to the expected section width (width of
408 * section in mils divided by X resolution) and expected section height
409 * (same height as the profile system tile). Type kRgb.
410 * @param tileX0 The vision system tile's start column. Can be determined from
411 * GoWebScanConfig_XStartPix.
412 * @param sectionX0 The section's start column. Can be determined by the section x0 in
413 * GoWebScanSettings divided by the X resolution.
414 * @param nullValue Null value to fill data with if the section falls outside the system
415 * tile's X field of view.
416 * @return Operation status.
417 */
418 GoWebScanFx(kStatus) GoWebScanUtils_VisionTileToSection(kArray2 tile, kArray2 section, kSSize tileX0, kSSize sectionX0, kRgb nullValue);
419 
420 /**
421  * Extracts a requested section from a tracheid system tile (representing merged and resampled
422  * data from an entire plane of the system). The section is represented by a start column
423  * (ceil(system x0 / xRes)). The output section array should be initialized to be the section
424  * width (ceil((x1 - x0) / xRes)) and have a height matching the input vision system tile.
425  *
426  * @public @memberof GoWebScanSdk
427  * @param tile Input tracheid system tile's data array. Type GoWebScanTracheidValue.
428  * @param angleSection Output angle array representing requested section. Output arrays
429  * should be constructed and initialized to the expected section width
430  * (width of section in mils divided by X resolution) and expected
431  * section height (same height as the profile system tile). Type k8u.
432  * @param scatterSection Output scatter array representing requested section. Type k8u.
433  * @param areaSection Output area array representing requested section. Type k8u.
434  * @param tileX0 The vision system tile's start column. Can be determined from
435  * GoWebScanConfig_XStartPix.
436  * @param sectionX0 The section's start column. Can be determined by the section x0 in
437  * GoWebScanSettings divided by the X resolution.
438  * @return Operation status.
439  */
440 GoWebScanFx(kStatus) GoWebScanUtils_TracheidTileToSection(kArray3 tile, kArray2 angleSection, kArray2 scatterSection, kArray2 areaSection, kSSize tileX0, kSSize sectionX0);
441 
442 /**
443  * Determines the new Bayer color filter array pattern if the input data undergoes an X and Y
444  * orientation change.
445  *
446  * @public @memberof GoWebScanSdk
447  * @param cfa Original color filter array type.
448  * @param xOrientation The sensor X-orientation.
449  * @param yOrientation The sensor Y-orientation.
450  * @return New color filter array type.
451  * @see GoWebScanSettings_XOrientation, GoWebScanSettings_YOrientation
452  */
453 GoWebScanFx(kCfa) GoWebScanUtils_ReorientCfa(kCfa cfa, k32s xOrientation, k32s yOrientation);
454 
455 /* Calibration utilities */
456 
457 /**
458  * Returns Bayer cell indexes for each color channel based on color filter array type.
459  *
460  * @public @memberof GoWebScanSdk
461  * @param cfa Color filter array type.
462  * @param red Receives the red index.
463  * @param greenR Receives the green-red index.
464  * @param greenB Receives the green-blue index.
465  * @param blue Receives the blue index.
466  * @return Operation status.
467  */
468 GoWebScanFx(kStatus) GoWebScanUtils_BayerCellToIndices(kCfa cfa, kSSize* red, kSSize* greenR, kSSize* greenB, kSSize* blue);
469 
470 /**
471  * Maps an RGB pixel's channels to a Bayer cell given the color filter array type.
472  *
473  * @public @memberof GoWebScanSdk
474  * @param cfa Color filter array type.
475  * @param pixel Input RGB pixel.
476  * @param values Pointer to output Bayer cell buffer.
477  * @return Operation status.
478  */
479 GoWebScanFx(kStatus) GoWebScanUtils_RgbToBayerCell(kCfa cfa, kRgb pixel, k32s* values);
480 
481 /**
482  * Linearly scales values from an input array to an output array of a different width.
483  *
484  * @public @memberof GoWebScanSdk
485  * @param in Input array of 32s values.
486  * @param out Output array of 32s values. Function will handle reallocating the array to the
487  * specified outWidth.
488  * @param outWidth Width of the output array.
489  * @return Operation status.
490  */
491 GoWebScanFx(kStatus) GoWebScanUtils_SampleYValues(kArray1 in, kArray1 out, kSSize outWidth);
492 
493 /**
494  * Linearly scales gain coefficients from an input array to an output array of a different
495  * height and width.
496  *
497  * @public @memberof GoWebScanSdk
498  * @param in Input array of gain coefficients. Type k64f.
499  * @param out Output array of scaled gain coefficients. Function will handle
500  * reallocating the array to the specified outWidth and outHeight. Type k64f.
501  * @param outWidth Width of the output array.
502  * @param outHeight Height of the output array.
503  * @param alloc Memory allocator (or kNULL for default).
504  * @return Operation status.
505  */
506 GoWebScanFx(kStatus) GoWebScanUtils_SampleGainCoefficientsChannel(kArray2 in, kArray2 out, kSSize outWidth, kSSize outHeight, kAlloc alloc);
507 
508 /**
509  * Merges individual color channel gains into a Bayer pattern gain array.
510  *
511  * @public @memberof GoWebScanSdk
512  * @param cfa Color filter array type of the output Bayer gain array.
513  * @param red Input array of red gains. Same width and height as other input gains. Type
514  * k64f.
515  * @param green Input array of green gains. Same width and height as other input gains. Type
516  * k64f.
517  * @param blue Input array of blue gains. Same width and height as other input gains. Type
518  * k64f.
519  * @param merged Output array of merged gains. Will be reallocated to 2x width and height of
520  * input gains (due to Bayer pattern). Type k64f.
521  * @return Operation status.
522  */
523 GoWebScanFx(kStatus) GoWebScanUtils_MergeGainCoefficientChannels(kCfa cfa, kArray2 red, kArray2 green, kArray2 blue, kArray2 merged);
524 
525 /**
526  * Converts floating point gains to 16-bit unsigned gains scaled by 1 &lt;&lt;
527  * GO_WEB_SCAN_FLATFIELD_RES_BITS.
528  *
529  * @public @memberof GoWebScanSdk
530  * @param in Input floating point gains. Type k64f.
531  * @param out Output scaled integer gains. Type k16u.
532  * @return Operation status.
533  */
534 GoWebScanFx(kStatus) GoWebScanUtils_ScaleGainImage(kArray2 in, kArray2 out);
535 
536 /**
537  * Calculates count of non-null points.
538  *
539  * @public @memberof GoWebScanSdk
540  * @param points Pointer to start of points buffer.
541  * @param pointCount Number of points.
542  * @param validCount Receives the count of non-null points.
543  * @return Operation status.
544  */
545 GoWebScanFx(kStatus) GoWebScanUtils_CountValidPoints(const kPoint16s* points, kSize pointCount, kSize* validCount);
546 
547 /**
548  * Calculates recommended profile transmit limit for given settings and profile sensor.
549  *
550  * @public @memberof GoWebScanSdk
551  * @param settings GoWebScan settings.
552  * @param profileSensor Profile sensor.
553  * @param profileTransmitLimit Receives the recommended profile transmit limit.
554  * @return Operation status.
555  */
556 GoWebScanFx(kStatus) GoWebScanUtils_CalculateProfileTransmitLimit(GoWebScanSettings settings, GoSensor profileSensor, k32u* profileTransmitLimit);
557 
558 /**
559  * Calculates recommended vision transmit limit for given settings and vision sensor.
560  *
561  * @public @memberof GoWebScanSdk
562  * @param settings GoWebScan settings.
563  * @param visionSensor Vision sensor.
564  * @param visionTransmitLimit Receives the recommended vision transmit limit.
565  * @return Operation status.
566  */
567 GoWebScanFx(kStatus) GoWebScanUtils_CalculateVisionTransmitLimit(GoWebScanSettings settings, GoSensor visionSensor, k32u* visionTransmitLimit);
568 
569 /**
570  * Calculate the vision delay shift to avoid interference with profile exposures.
571  *
572  * @public @memberof GoWebScanSdk
573  * @param settings GoWebScanSettings settings.
574  * @return Vision delay shift.
575  */
576 GoWebScanFx(k32u) GoWebScanUtils_CalculateVisionDelayShift(GoWebScanSettings settings);
577 
578 /**
579  * Verifies that the system timing setup does not result in interference between sensors.
580  *
581  * @public @memberof GoWebScanSdk
582  * @param settings GoWebScanSettings settings.
583  * @param errorMsg Error message output if error occurs.
584  * @param length Error message buffer length.
585  * @return Operation status.
586  */
587 GoWebScanFx(kStatus) GoWebScanUtils_VerifySystemTiming(GoWebScanSettings settings, kChar* errorMsg, kSize length);
588 
589 /**
590  * Aligns the individual X and Y references of multiple stations' calibrations to a common global X and Y
591  * reference. This is done by calculating the overall X and Y bias, which is the average of the X and Y
592  * references from all servers, then setting the calibration X and Y adjustment to the bias minus the reference.
593  * The list index of each calibration and settings object corresponds to the server index.
594  *
595  * @public @memberof GoWebScanSdk
596  * @param calibrationPtr Pointer to start address of GoWebScanCal object list.
597  * @param settingsPtr Pointer to start address of GoWebScanSettings object list.
598  * @param count Length of lists.
599  * @return Operation status.
600  */
601 GoWebScanFx(kStatus) GoWebScanUtils_AlignCalibrations(const GoWebScanCal* calibrationPtr, const GoWebScanSettings* settingsPtr, kSize count);
602 
603  /**
604  * Helper function to store kArrayList of sensor info items to a specified folder path.
605  *
606  * @public @memberof GoWebScanSdk
607  * @param sensorInfo kArrayList of GoWebScanConfigSensorInfo items.
608  * @param folderName Folder path to store sensor info.
609  * @return Operation status.
610  */
611 GoWebScanFx(kStatus) GoWebScanUtils_StoreSensorInfo(kArrayList sensorInfo, const kChar* folderName);
612 
613 /**
614  * Helper function to confirm specified folder path contains all expected sensor info files, or otherwise
615  * specify the first one that is missing.
616  *
617  * @public @memberof GoWebScanSdk
618  * @param settings Settings specifying what sensors are expected to have info.
619  * @param folderName Folder path containing sensor info.
620  * @param missingFileName Pointer to kChar array which will be set to name of first missing file, if any.
621  * @param missingFileNameLen Length of missingFileName array.
622  * @return Operation status.
623  */
624 GoWebScanFx(kBool) GoWebScanUtils_SensorInfoFilesExist(GoWebScanSettings settings, const kChar* folderName, kChar* missingFileName, kSize missingFileNameLen);
625 
626 /**
627  * Helper function to load kArrayList of sensor info items items from a specified folder path.
628  *
629  * @public @memberof GoWebScanSdk
630  * @param sensorInfo Pointer to be populated with kArrayList of GoWebScanConfigSensorInfo items.
631  * @param settings Settings specifying what sensors are expected to have info.
632  * @param folderName Folder path containing sensor info.
633  * @return Operation status.
634  */
635 GoWebScanFx(kStatus) GoWebScanUtils_LoadSensorInfo(kArrayList* sensorInfo, GoWebScanSettings settings, const kChar* folderName);
636 
637 /**
638  * Helper function to call a function on multiple GoSensor objects asynchronously.
639  *
640  * @public @memberof GoWebScanSdk
641  * @param function Function to call on each GoSensor object.
642  * @param context Receiver argument for callback, in addition to the GoSensor object.
643  * @param sensors Pointer to array of GoSensor objects.
644  * @param count Count of GoSensor objects.
645  * @return Operation status.
646  */
647 GoWebScanFx(kStatus) GoWebScanUtils_AsyncSensorFunction(GoWebScanUtilsSensorFx function, kPointer context, GoSensor* sensors, kSize count);
648 
649 #include <GoWebScanSdk/GoWebScanUtilities.x.h>
650 
651 #endif
Represents a tracheid point, which is the integer tracheid data for a spot with the X position (mils)...
Definition: GoWebScanSdkDef.h:558
Represents a style of triggering the start of an object when in detection mode. The start of an objec...
Represents a style of interpolation used during profile resampling.
Represents a container for user-configurable settings of the system. The class reads and writes the s...
Essential GoWebScan declarations.
Represents integer values of the spot tracheid data. These values are calculated from the spot shape...
Definition: GoWebScanSdkDef.h:542
Declares a GoWebScanCal object.
Declares a GoWebScanProcess object.
Represents a container for the system calibration. The system calibration corrects for mounting diffe...
Represents a user-defined obstruction to ignore a zone in X and Z in the input profile data...
Definition: GoWebScanSdkDef.h:589
Declares a GoWebScanConfig object.