GoWebScan API
 All Classes Files Functions Variables Typedefs Macros Modules Pages
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-2021 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 
15 #include <kApi/Data/kArray1.h>
16 #include <kApi/Data/kArray2.h>
17 #include <kApi/Data/kArray3.h>
18 #include <kApi/Data/kImage.h>
19 #include <kApi/Data/kMath.h>
20 #include <math.h>
21 
22 #define NM_TO_MM(VALUE) (((k64f)(VALUE))/1000000.0) ///< Converts nanometers to millimeters
23 #define UM_TO_MM(VALUE) (((k64f)(VALUE))/1000.0) ///< Converts micrometers to millimeters
24 #define MM_TO_MILS(VALUE) ((VALUE)*39.3701) ///< Converts millimeters to mils
25 
26 /**
27 * Applies an obstruction to raw sensor profile data. The obstruction defines a mask covering a
28 * specified ROI in Z and X. Masked points are set to null.
29 *
30 * @public @memberof GoWebScanSdk
31 * @param inPoints Pointer to input profile points.
32 * @param outPoints Pointer to masked output profile points. Can reuse the input buffer.
33 * @param count Count of profile points.
34 * @param obstructions Pointer to start of obstruction buffer.
35 * @param obstructionCount Count of obstructions in buffer.
36 * @return Operation status.
37 */
38 GoWebScanFx(kStatus) GoWebScanUtils_ApplyProfileMask(const kPoint16s* inPoints, kPoint16s* outPoints, kSize count, const GoWebScanObstruction* obstructions, kSize obstructionCount);
39 
40 /**
41 * Reorients profile data to align with system coordinates in standard orienation. In standard
42 * orientation, the sensor X-axis is aligned to the system X-axis, and the sensor z-axis is
43 * opposite the system z-axis. X data is converted to system coordinates.
44 *
45 * @public @memberof GoWebScanSdk
46 * @param inPoints Pointer to input profile points.
47 * @param outPoints Pointer to reoriented profile points.
48 * @param count Count of profile points.
49 * @param xInCenter X-center of sensor in system coordinates.
50 * @param xOrientation X-orientation of sensor.
51 * @param zOrientation Z-orientation of sensor.
52 * @return Operation status.
53 * @see GoWebScanSettings_XOrientation, GoWebScanSettings_ZOrientation
54 */
55 GoWebScanFx(kStatus) GoWebScanUtils_ApplyProfileOrientation(const kPoint16s* inPoints, kPoint16s* outPoints, kSSize count, k32s xInCenter, k32s xOrientation, k32s zOrientation);
56 
57 /**
58 * Applies an offset in Z to each input profile point. These offsets typically represent a system
59 * calibration to align all sensors to a common plane.
60 *
61 * @public @memberof GoWebScanSdk
62 * @param inPoints Pointer to input profile points. Can reuse the input buffer.
63 * @param zOffsets Pointer to Z offset buffer.
64 * @param outPoints Pointer to reoriented profile points.
65 * @param count Count of profile points.
66 * @return Operation status.
67 */
68 GoWebScanFx(kStatus) GoWebScanUtils_ApplyProfileZOffset(const kPoint16s* inPoints, const k16s* zOffsets, kPoint16s* outPoints, kSSize count);
69 
70 /**
71 * Modifies profile spots that fall on the side edge of a board (edge along Y-axis) and report a
72 * different range than their neighbour. Side edge spots are modified to report the range of the
73 * adjacent spot that is on the board, giving the board edge a 90 degree angle and more accurate
74 * length instead of a curved edge.
75 *
76 * @public @memberof GoWebScanSdk
77 * @param inPoints Pointer to input profile points.
78 * @param outPoints Pointer to output profile points.
79 * @param count Count of profile points.
80 * @param extrapolationWindow Amount along X-axis to extend board.
81 * @return Operation status.
82 */
83 GoWebScanFx(kStatus) GoWebScanUtils_ExtendSideProfile(const kPoint16s* inPoints, kPoint16s* outPoints, kSSize count, kSSize extrapolationWindow);
84 
85 /**
86 * Resamples profile data in the X-axis.
87 *
88 * @public @memberof GoWebScanSdk
89 * @param style Type of interpolation to apply during resampling.
90 * @param inPoints Pointer to input profile points.
91 * @param pointCount Count of input profile points.
92 * @param outPoints Pointer to output resampled Z profiles.
93 * @param profileCount Count of output profiles.
94 * @param xStart Start location, in mils, of resampling. In system coordinates.
95 * @param xRes Desired resolution, in mils/pixel, of resampled data.
96 * @param interpolationWindow Maximum input data X-gap, in mils, to be filled in with resampled data.
97 * @param extrapolationWindow Distance, in mils, to extend resampling window around pairs of input points.
98 * @return Operation status.
99 */
100 GoWebScanFx(kStatus) GoWebScanUtils_ResampleProfileX(GoWebScanInterpolation style, const kPoint16s* inPoints, kSSize pointCount, k16s* outProfile, kSSize profileCount, k32s xStart, k32s xRes, k32s interpolationWindow, k32s extrapolationWindow);
101 
102 /**
103 * Fills gaps in input Z data. Null input Z values are filled leftmost valid point. Initial null regions
104 * are filled with rightmost valid Z value.
105 *
106 * @public @memberof GoWebScanSdk
107 * @param inProfile Pointer to input profiles.
108 * @param outProfile Pointer to output profiles. Can reuse the input buffer.
109 * @param count Count of profile values.
110 * @param defaultZValue Value to fill gaps if no valid values are found.
111 * @return Operation status.
112 */
113 GoWebScanFx(kStatus) GoWebScanUtils_FillResampledProfile(const k16s* inProfile, k16s* outProfile, kSSize count, k16s defaultZValue);
114 
115 /**
116 * Reorients vision data to align with system coordinates in standard orienation. In standard
117 * orientation, the sensor X-axis is aligned to the system X-axis, and the sensor Y-axis is
118 * opposite the system Y-axis.
119 *
120 * @public @memberof GoWebScanSdk
121 * @param in Input vision image. Type k8u (raw Bayer image).
122 * @param out Reoriented output vision image. Type k8u (raw Bayer image).
123 * @param xOrientation X-orientation of sensor.
124 * @param yOrientation Y-orientation of sensor.
125 * @return Operation status.
126 * @see GoWebScanSettings_XOrientation, GoWebScanSettings_YOrientation
127 */
128 GoWebScanFx(kStatus) GoWebScanUtils_ApplyVisionOrientation(kImage in, kImage out, k32s xOrientation, k32s yOrientation);
129 
130 /**
131  * Applies color gains to input raw Bayer image. Gains are typically determined during
132  * system calibration.
133  *
134  * @public @memberof GoWebScanSdk
135  * @param in Input vision image. Type k8u (raw Bayer image).
136  * @param out Output vision image. Type k8u (raw Bayer image).
137  * @param gains Array of gains for all 4 channels for the image. Height of array is same
138  * as input image, width is 4*input width. Type k16u.
139  * @param gainShift Bit shift of gains.
140  * @return Operation status.
141  */
142 GoWebScanFx(kStatus) GoWebScanUtils_ApplyVisionGains(kImage in, kImage out, kArray2 gains, k32s gainShift);
143 
144 /**
145  * Reorients tracheid data to align with system coordinates in standard orienation. In standard
146  * orientation, the sensor X-axis is aligned to the system X-axis, and the sensor z-axis is
147  * opposite the system z-axis. X data is converted to system coordinates.
148  *
149  * @public @memberof GoWebScanSdk
150  * @param inPoints Pointer to input tracheid points.
151  * @param outPoints Pointer to output tracheid points.
152  * @param count Number of points.
153  * @param xInCenter X-center of sensor in system coordinates.
154  * @param xOrientation X-orientation of sensor.
155  * @return Operation status.
156  * @see GoWebScanSettings_XOrientation
157  */
158 GoWebScanFx(kStatus) GoWebScanUtils_ApplyTracheidOrientation(const GoWebScanTracheidPoint* inPoints, GoWebScanTracheidPoint* outPoints, kSSize count, k32s xInCenter, k32s xOrientation);
159 
160 /**
161  * Resamples tracheid data in the X-axis.
162  *
163  * @public @memberof GoWebScanSdk
164  * @param inPoints Pointer to input tracheid points.
165  * @param pointCount Number of input points.
166  * @param outValues Pointer to output resampled tracheid values.
167  * @param valueCount Number of output values.
168  * @param xStart Start location, in mils, of resampling. In system coordinates.
169  * @param xRes Desired resolution, in mils/pixel, of resampled data.
170  * @param interpolationWindow Maximum input data X-gap, in mils, to be filled in with resampled
171  * data.
172  * @param extrapolationWindow Distance, in mils, to extend resampling window around pairs of
173  * input points.
174  * @return Operation status.
175  */
176 GoWebScanFx(kStatus) GoWebScanUtils_ResampleTracheidX(const GoWebScanTracheidPoint* inPoints, kSSize pointCount, GoWebScanTracheidValue* outValues, kSSize valueCount, k32s xStart, k32s xRes, k32s interpolationWindow, k32s extrapolationWindow);
177 
178 /**
179  * Replaces all values in a profile system tile with nulls.
180  *
181  * @public @memberof GoWebScanSdk
182  * @param systemData Profile system tile. Type k16s.
183  * @return Operation status.
184  */
185 GoWebScanFx(kStatus) GoWebScanUtils_ClearProfileSystemTile(kArray2 systemData);
186 
187 /**
188  * Replaces all values in a vision system tile with zeroes.
189  *
190  * @public @memberof GoWebScanSdk
191  * @param systemData Vision system tile. Type kRgb.
192  * @return Operation status.
193  */
194 GoWebScanFx(kStatus) GoWebScanUtils_ClearVisionSystemTile(kArray2 systemData);
195 
196 /**
197  * Replaces all values in a tracheid system tile with nulls.
198  *
199  * @public @memberof GoWebScanSdk
200  * @param systemData Tracheid system tile. Type GoWebScanTracheidValue.
201  * @return Operation status.
202  */
203 GoWebScanFx(kStatus) GoWebScanUtils_ClearTracheidSystemTile(kArray3 systemData);
204 
205 /**
206  * Copies a profile tile from an individual sensor into a system tile at a specified column.
207  *
208  * @public @memberof GoWebScanSdk
209  * @param systemData Profile system tile. Type k16s.
210  * @param childData Profile sensor tile. Type k16s.
211  * @param x0 Column index within system tile to copy child data into.
212  * @return Operation status.
213  */
214 GoWebScanFx(kStatus) GoWebScanUtils_CopyProfileChildTile(kArray2 systemData, kArray2 childData, kSSize x0);
215 
216 /**
217  * Copies a vision tile from an individual sensor into a system tile at a specified column.
218  *
219  * @public @memberof GoWebScanSdk
220  * @param systemData Vision system tile. Type kRgb.
221  * @param childData Vision sensor tile. Type kRgb.
222  * @param x0 Column index within system tile to copy child data into.
223  * @return Operation status.
224  */
225 GoWebScanFx(kStatus) GoWebScanUtils_CopyVisionChildTile(kArray2 systemData, kArray2 childData, kSSize x0);
226 
227 /**
228  * Copies a tracheid tile from an individual sensor into a system tile at a specified column.
229  *
230  * @public @memberof GoWebScanSdk
231  * @param systemData Tracheid system tile. Type GoWebScanTracheidValue.
232  * @param childData Tracheid sensor tile. Type GoWebScanTracheidValue.
233  * @param x0 Column index within system tile to copy child data into.
234  * @return Operation status.
235  */
236 GoWebScanFx(kStatus) GoWebScanUtils_CopyTracheidChildTile(kArray3 systemData, kArray3 childData, kSSize x0);
237 
238 /**
239  * Copies two sensors' profile tiles into the system tile and blends the overlap in X. Data is
240  * blended by a weighted average.
241  *
242  * @public @memberof GoWebScanSdk
243  * @param systemData Profile system tile. Type k16s.
244  * @param childData0 First profile sensor tile. Type k16s.
245  * @param childData1 Second profile sensor tile. Type k16s.
246  * @param x0 Column index within system tile to copy first profile sensor tile into.
247  * @param x1 Column index within system tile to copy second profile sensor tile into.
248  * @return Operation status.
249  */
250 GoWebScanFx(kStatus) GoWebScanUtils_BlendProfileChildOverlap(kArray2 systemData, kArray2 childData0, kArray2 childData1, kSSize x0, kSSize x1);
251 
252 /**
253  * Copies two sensors' vision tiles into the system tile and blends the overlap in X. Data is
254  * blended by a weighted average.
255  *
256  * @public @memberof GoWebScanSdk
257  * @param systemData Vision system tile. Type kRgb.
258  * @param childData0 First vision sensor tile. Type kRgb.
259  * @param childData1 Second vision sensor tile. Type kRgb.
260  * @param x0 Column index within system tile to copy first vision sensor tile into.
261  * @param x1 Column index within system tile to copy second vision sensor tile into.
262  * @return Operation status.
263  */
264 GoWebScanFx(kStatus) GoWebScanUtils_BlendVisionChildOverlap(kArray2 systemData, kArray2 childData0, kArray2 childData1, kSSize x0, kSSize x1);
265 
266 /**
267 * Copies two sensors' tracheid tiles into the system tile and blends the overlap in X. Data is
268 * blended by a weighted average.
269 *
270 * @public @memberof GoWebScanSdk
271 * @param systemData Tracheid system tile. Type GoWebScanTracheidValue.
272 * @param childData0 First tracheid sensor tile. Type GoWebScanTracheidValue.
273 * @param childData1 Second tracheid sensor tile. Type GoWebScanTracheidValue.
274 * @param x0 Column index within system tile to copy first tracheid sensor tile into.
275 * @param x1 Column index within system tile to copy second tracheid sensor tile into.
276 * @return Operation status.
277 */
278 GoWebScanFx(kStatus) GoWebScanUtils_BlendTracheidChildOverlap(kArray3 systemData, kArray3 childData0, kArray3 childData1, kSSize x0, kSSize x1);
279 
280 /**
281  * Copies two sensors' profile tiles into the system tile and fills the gap in X. Data is filled
282  * with interpolated data.
283  *
284  * @public @memberof GoWebScanSdk
285  * @param systemData Profile system tile. Type k16s.
286  * @param childData0 First profile sensor tile. Type k16s.
287  * @param childData1 Second profile sensor tile. Type k16s.
288  * @param x0 Column index within system tile to copy first profile sensor tile
289  * into.
290  * @param x1 Column index within system tile to copy second profile sensor tile
291  * into.
292  * @param gapSearchWindow Gaps are processed by searching for the last valid left element and
293  * first valid right element within the gap search window.
294  * @param interpolation Type of interpolation to use to fill gap.
295  * @return Operation status.
296  */
297 GoWebScanFx(kStatus) GoWebScanUtils_FillProfileChildGap(kArray2 systemData, kArray2 childData0, kArray2 childData1, kSSize x0, kSSize x1, k32s gapSearchWindow, GoWebScanInterpolation interpolation);
298 
299 /**
300 * Copies two sensors' vision tiles into the system tile and fills the gap in X. Data is filled
301 * with the nearest neighbour's value.
302 *
303 * @public @memberof GoWebScanSdk
304 * @param systemData Vision system tile. Type kRgb.
305 * @param childData0 First vision sensor tile. Type kRgb.
306 * @param childData1 Second vision sensor tile. Type kRgb.
307 * @param x0 Column index within system tile to copy first vision sensor tile
308 * into.
309 * @param x1 Column index within system tile to copy second vision sensor tile
310 * into.
311 * @param gapSearchWindow Gaps are processed by searching for the last valid left element and
312 * first valid right element within the gap search window.
313 * @return Operation status.
314 */
315 GoWebScanFx(kStatus) GoWebScanUtils_FillVisionChildGap(kArray2 systemData, kArray2 childData0, kArray2 childData1, kSSize x0, kSSize x1, k32s gapSearchWindow);
316 
317 /**
318 * Copies two sensors' tracheid tiles into the system tile and fills the gap in X. Data is filled
319 * with the nearest neighbour's value.
320 *
321 * @public @memberof GoWebScanSdk
322 * @param systemData Tracheid system tile. Type GoWebScanTracheidValue.
323 * @param childData0 First tracheid sensor tile. Type GoWebScanTracheidValue.
324 * @param childData1 Second tracheid sensor tile. Type GoWebScanTracheidValue.
325 * @param x0 Column index within system tile to copy first tracheid sensor tile
326 * into.
327 * @param x1 Column index within system tile to copy second tracheid sensor tile
328 * into.
329 * @param gapSearchWindow Gaps are processed by searching for the last valid left element and
330 * first valid right element within the gap search window.
331 * @return Operation status.
332 */
333 GoWebScanFx(kStatus) GoWebScanUtils_FillTracheidChildGap(kArray3 systemData, kArray3 childData0, kArray3 childData1, kSSize x0, kSSize x1, k32s gapSearchWindow);
334 
335 /**
336  * Determines presence information from input profiles and adds to existing presence
337  * information. Presence is defined as true when a profile is non-null, false otherwise.
338  *
339  * @public @memberof GoWebScanSdk
340  * @param presenceData Pointer to input profile buffer.
341  * @param presenceTest Pointer to output presence buffer. Can contain existing presence
342  * information, otherwise all values should be set to 0.
343  * @param count Number of profiles.
344  * @return Operation status.
345  */
346 GoWebScanFx(kStatus) GoWebScanUtils_AddPresenceData(const k16s* presenceData, kBool* presenceTest, kSSize count);
347 
348 /**
349  * Determines if an object is detected in a row of input presence data. An object is defined as
350  * having a true presence count greater than the trigger threshold. The true presence values can
351  * either be located anywhere in the row (global detection style) or must be contiguous (local
352  * detection style).
353  *
354  * @public @memberof GoWebScanSdk
355  * @param presenceTest Pointer to input presence buffer.
356  * @param count Number of presence values.
357  * @param detectionStyle The board detection style.
358  * @param triggerThreshold Minimum number of true presence data to trigger if an object is
359  * detected.
360  * @param isDetected Receives a boolean representing if an object was found in the
361  * data.
362  * @return Operation status.
363  */
364 GoWebScanFx(kStatus) GoWebScanUtils_DetectObject(const kBool* presenceTest, kSSize count, GoWebScanDetectionStyle detectionStyle, k32s triggerThreshold, kBool* isDetected);
365 
366 /**
367  * Extracts a requested section from a profile system tile (representing merged and resampled
368  * data from an entire plane of the system). The section is represented by a start column
369  * (ceil(system x0 / xRes)). The output section array should be initialized to be the section
370  * width (ceil((x1 - x0) / xRes)) and have a height matching the input profile system tile.
371  *
372  * @public @memberof GoWebScanSdk
373  * @param tile Input profile system tile's data array. Type k16s.
374  * @param section Output data array representing requested section. Array should be
375  * constructed and initialized to the expected section width (width of
376  * section in mils divided by X resolution) and expected section height
377  * (same height as the profile system tile). Type k16s.
378  * @param tileX0 The profile system tile's start column. Can be determined from
379  * GoWebScanConfig_XStartPix.
380  * @param sectionX0 The section's start column. Can be determined by the section x0 in
381  * GoWebScanSettings divided by the X resolution.
382  * @param nullValue Null value to fill data with if the section falls outside the system
383  * tile's X field of view.
384  * @return Operation status.
385  */
386 GoWebScanFx(kStatus) GoWebScanUtils_ProfileTileToSection(kArray2 tile, kArray2 section, kSSize tileX0, kSSize sectionX0, k16s nullValue);
387 
388 /**
389 * Extracts a requested section from a vision system tile (representing merged and resampled
390 * data from an entire plane of the system). The section is represented by a start column
391 * (ceil(system x0 / xRes)). The output section array should be initialized to be the section
392 * width (ceil((x1 - x0) / xRes)) and have a height matching the input vision system tile.
393 *
394 * @public @memberof GoWebScanSdk
395 * @param tile Input vision system tile's data array. Type kRgb.
396 * @param section Output data array representing requested section. Array should be
397 * constructed and initialized to the expected section width (width of
398 * section in mils divided by X resolution) and expected section height
399 * (same height as the profile system tile). Type kRgb.
400 * @param tileX0 The vision system tile's start column. Can be determined from
401 * GoWebScanConfig_XStartPix.
402 * @param sectionX0 The section's start column. Can be determined by the section x0 in
403 * GoWebScanSettings divided by the X resolution.
404 * @param nullValue Null value to fill data with if the section falls outside the system
405 * tile's X field of view.
406 * @return Operation status.
407 */
408 GoWebScanFx(kStatus) GoWebScanUtils_VisionTileToSection(kArray2 tile, kArray2 section, kSSize tileX0, kSSize sectionX0, kRgb nullValue);
409 
410 /**
411  * Extracts a requested section from a tracheid system tile (representing merged and resampled
412  * data from an entire plane of the system). The section is represented by a start column
413  * (ceil(system x0 / xRes)). The output section array should be initialized to be the section
414  * width (ceil((x1 - x0) / xRes)) and have a height matching the input vision system tile.
415  *
416  * @public @memberof GoWebScanSdk
417  * @param tile Input tracheid system tile's data array. Type GoWebScanTracheidValue.
418  * @param angleSection Output angle array representing requested section. Output arrays
419  * should be constructed and initialized to the expected section width
420  * (width of section in mils divided by X resolution) and expected
421  * section height (same height as the profile system tile). Type k8u.
422  * @param scatterSection Output scatter array representing requested section. Type k8u.
423  * @param areaSection Output area array representing requested section. Type k8u.
424  * @param tileX0 The vision system tile's start column. Can be determined from
425  * GoWebScanConfig_XStartPix.
426  * @param sectionX0 The section's start column. Can be determined by the section x0 in
427  * GoWebScanSettings divided by the X resolution.
428  * @return Operation status.
429  */
430 GoWebScanFx(kStatus) GoWebScanUtils_TracheidTileToSection(kArray3 tile, kArray2 angleSection, kArray2 scatterSection, kArray2 areaSection, kSSize tileX0, kSSize sectionX0);
431 
432 /**
433  * Determines the new Bayer color filter array pattern if the input data undergoes an X and Y
434  * orientation change.
435  *
436  * @public @memberof GoWebScanSdk
437  * @param cfa Original color filter array type.
438  * @param xOrientation The sensor X-orientation.
439  * @param yOrientation The sensor Y-orientation.
440  * @return New color filter array type.
441  * @see GoWebScanSettings_XOrientation, GoWebScanSettings_YOrientation
442  */
443 GoWebScanFx(kCfa) GoWebScanUtils_ReorientCfa(kCfa cfa, k32s xOrientation, k32s yOrientation);
444 
445 /* Calibration utilities */
446 
447 /**
448  * Returns Bayer cell indexes for each color channel based on color filter array type.
449  *
450  * @public @memberof GoWebScanSdk
451  * @param cfa Color filter array type.
452  * @param red Receives the red index.
453  * @param greenR Receives the green-red index.
454  * @param greenB Receives the green-blue index.
455  * @param blue Receives the blue index.
456  * @return Operation status.
457  */
458 GoWebScanFx(kStatus) GoWebScanUtils_BayerCellToIndices(kCfa cfa, kSSize* red, kSSize* greenR, kSSize* greenB, kSSize* blue);
459 
460 /**
461  * Maps an RGB pixel's channels to a Bayer cell given the color filter array type.
462  *
463  * @public @memberof GoWebScanSdk
464  * @param cfa Color filter array type.
465  * @param pixel Input RGB pixel.
466  * @param values Pointer to output Bayer cell buffer.
467  * @return Operation status.
468  */
469 GoWebScanFx(kStatus) GoWebScanUtils_RgbToBayerCell(kCfa cfa, kRgb pixel, k32s* values);
470 
471 /**
472  * Linearly scales values from an input array to an output array of a different width.
473  *
474  * @public @memberof GoWebScanSdk
475  * @param in Input array of 32s values.
476  * @param out Output array of 32s values. Function will handle reallocating the array to the
477  * specified outWidth.
478  * @param outWidth Width of the output array.
479  * @return Operation status.
480  */
481 GoWebScanFx(kStatus) GoWebScanUtils_SampleYValues(kArray1 in, kArray1 out, kSSize outWidth);
482 
483 /**
484  * Linearly scales gain coefficients from an input array to an output array of a different
485  * height and width.
486  *
487  * @public @memberof GoWebScanSdk
488  * @param in Input array of gain coefficients. Type k64f.
489  * @param out Output array of scaled gain coefficients. Function will handle
490  * reallocating the array to the specified outWidth and outHeight. Type k64f.
491  * @param outWidth Width of the output array.
492  * @param outHeight Height of the output array.
493  * @param alloc Memory allocator (or kNULL for default).
494  * @return Operation status.
495  */
496 GoWebScanFx(kStatus) GoWebScanUtils_SampleGainCoefficientsChannel(kArray2 in, kArray2 out, kSSize outWidth, kSSize outHeight, kAlloc alloc);
497 
498 /**
499  * Merges individual color channel gains into a Bayer pattern gain array.
500  *
501  * @public @memberof GoWebScanSdk
502  * @param cfa Color filter array type of the output Bayer gain array.
503  * @param red Input array of red gains. Same width and height as other input gains. Type
504  * k64f.
505  * @param green Input array of green gains. Same width and height as other input gains. Type
506  * k64f.
507  * @param blue Input array of blue gains. Same width and height as other input gains. Type
508  * k64f.
509  * @param merged Output array of merged gains. Will be reallocated to 2x width and height of
510  * input gains (due to Bayer pattern). Type k64f.
511  * @return Operation status.
512  */
513 GoWebScanFx(kStatus) GoWebScanUtils_MergeGainCoefficentChannels(kCfa cfa, kArray2 red, kArray2 green, kArray2 blue, kArray2 merged);
514 
515 /**
516  * Converts floating point gains to 16-bit unsigned gains scaled by 1 &lt;&lt;
517  * GO_WEB_SCAN_FLATFIELD_RES_BITS.
518  *
519  * @public @memberof GoWebScanSdk
520  * @param in Input floating point gains. Type k64f.
521  * @param out Output scaled integer gains. Type k16u.
522  * @return Operation status.
523  */
524 GoWebScanFx(kStatus) GoWebScanUtils_ScaleGainImage(kArray2 in, kArray2 out);
525 
526 /**
527  * Calculates count of non-null points.
528  *
529  * @public @memberof GoWebScanSdk
530  * @param points Pointer to start of points buffer.
531  * @param pointCount Number of points.
532  * @param validCount Receives the count of non-null points.
533  * @return Operation status.
534  */
535 GoWebScanFx(kStatus) GoWebScanUtils_CountValidPoints(const kPoint16s* points, kSize pointCount, kSize* validCount);
536 
537 #include <GoWebScanSdk/GoWebScanUtilities.x.h>
538 
539 #endif
Represents a tracheid point, which is the integer tracheid data for a spot with the X position (mils)...
Definition: GoWebScanSdkDef.h:551
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.
Essential GoWebScan declarations.
Represents integer values of the spot tracheid data. These values are calculated from the spot shape...
Definition: GoWebScanSdkDef.h:535