GoWebScan API
 All Classes Files Functions Variables Typedefs Macros Modules Pages
GoWebScanProfileYResampler.h
Go to the documentation of this file.
1 /**
2 * @file GoWebScanProfileYResampler.h
3 * @brief Declares a GoWebScanProfileYResampler object.
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_PROFILE_Y_RESAMPLER_H
12 #define GO_WEB_SCAN_PROFILE_Y_RESAMPLER_H
13 
15 
16 kBeginHeader()
17 
18 /**
19 * @struct GoWebScanProfileYResamplerParams
20 * @extends kValue
21 * @ingroup GoWebScanSdk-Algorithms
22 * @brief Represents parameters of the profile Y-resampler algorithm.
23 */
25 {
26  k32s yResolution; ///< Expected Y-resolution of resampled output data (mils/pixel)
27  k32s fillDistance; ///< Maximum distance to nearest input row to fill with valid data (mils)
28  k32s breakDistance; ///< Profile messages with a Y position greater than this threshold from the current message will be cleared and recycled (mils).
29  kSSize pointCount; ///< Expected count of input raw profile data.
30  kSSize pointFields; ///< Size of each profile point in bytes.
32 
33 /**
34 * @class GoWebScanProfileYResampler
35 * @extends kObject
36 * @ingroup GoWebScanSdk-Algorithms
37 * @brief Represents an algorithm for resampling raw sensor geometric data in the Y-axis and
38 * applying calibration Y-offsets. The algorithm maintains a circular row buffer that covers
39 * enough distance in the Y-axis to account for the difference between the minimum and maximum
40 * calibration Y-offsets. The Y-resampler considers two input rows at a time, and for each column,
41 * selects the nearest input to fill in cells up to the Y-location of the second input row.
42 */
44 
45 /** Defines the signature for the handler for accepting the output resampled dataset. */
46 typedef kStatus(kCall *GoWebScanProfileYResamplerDataFx)(kPointer context, k64s rowIndex, const GoWebScanInputAttr* attributes, const void* points, kSSize pointCount);
47 
48 /**
49 * Constructs a GoWebScanProfileYResampler object.
50 *
51 * @public @memberof GoWebScanProfileYResampler
52 * @param resampler Receives the constructed GoWebScanProfileYResampler object.
53 * @param args Algorithm parameters.
54 * @param offsets Y-offsets, in mils, for each spot. Calculated during system calibration.
55 * @param allocator Memory allocator (or kNULL for default).
56 * @return Operation status.
57 */
58 GoWebScanFx(kStatus) GoWebScanProfileYResampler_Construct(GoWebScanProfileYResampler* resampler, const GoWebScanProfileYResamplerParams* args, const k32s* offsets, kAlloc allocator);
59 
60 /**
61 * Sets the handler for accepting the output data from the algorithm.
62 *
63 * @public @memberof GoWebScanProfileYResampler
64 * @param resampler GoWebScanProfileYResampler object.
65 * @param data Callback function
66 * @param context Receiver argument for callback.
67 * @return Operation status.
68 */
70 
71 /**
72 * Adds a raw sensor profile message to the algorithm's processing queue.
73 *
74 * @public @memberof GoWebScanProfileYResampler
75 * @param resampler GoWebScanProfileYResampler object.
76 * @param attributes Attributes of profile message.
77 * @param points Pointer to buffer containing raw sensor profile points.
78 * @param pointCount Count of profile points.
79 * @return Operation status.
80 */
81 GoWebScanFx(kStatus) GoWebScanProfileYResampler_AddData(GoWebScanProfileYResampler resampler, const GoWebScanInputAttr* attributes, const kPoint16s* points, kSSize pointCount);
82 
83 /**
84 * Clears and relinquishes input queue.
85 *
86 * @public @memberof GoWebScanProfileYResampler
87 * @param resampler GoWebScanProfileYResampler object.
88 * @return Operation status.
89 */
91 
92 kEndHeader()
93 #include <GoWebScanSdk/GoWebScanProfileYResampler.x.h>
94 
95 #endif
kStatus GoWebScanProfileYResampler_Construct(GoWebScanProfileYResampler *resampler, const GoWebScanProfileYResamplerParams *args, const k32s *offsets, kAlloc allocator)
Constructs a GoWebScanProfileYResampler object.
kStatus(kCall * GoWebScanProfileYResamplerDataFx)(kPointer context, k64s rowIndex, const GoWebScanInputAttr *attributes, const void *points, kSSize pointCount)
Defines the signature for the handler for accepting the output resampled dataset. ...
Definition: GoWebScanProfileYResampler.h:46
Essential GoWebScan declarations.
kSSize pointFields
Size of each profile point in bytes.
Definition: GoWebScanProfileYResampler.h:30
k32s breakDistance
Profile messages with a Y position greater than this threshold from the current message will be clear...
Definition: GoWebScanProfileYResampler.h:28
Represents the attributes of an input GoWebScan message object. These values are copied from the raw ...
Definition: GoWebScanSdkDef.h:522
kSSize pointCount
Expected count of input raw profile data.
Definition: GoWebScanProfileYResampler.h:29
Represents parameters of the profile Y-resampler algorithm.
Definition: GoWebScanProfileYResampler.h:24
Represents an algorithm for resampling raw sensor geometric data in the Y-axis and applying calibrati...
kStatus GoWebScanProfileYResampler_SetDataHandler(GoWebScanProfileYResampler resampler, GoWebScanProfileYResamplerDataFx data, kPointer context)
Sets the handler for accepting the output data from the algorithm.
k32s yResolution
Expected Y-resolution of resampled output data (mils/pixel)
Definition: GoWebScanProfileYResampler.h:26
k32s fillDistance
Maximum distance to nearest input row to fill with valid data (mils)
Definition: GoWebScanProfileYResampler.h:27
kStatus GoWebScanProfileYResampler_Clear(GoWebScanProfileYResampler resampler)
Clears and relinquishes input queue.
kStatus GoWebScanProfileYResampler_AddData(GoWebScanProfileYResampler resampler, const GoWebScanInputAttr *attributes, const kPoint16s *points, kSSize pointCount)
Adds a raw sensor profile message to the algorithm's processing queue.