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