GoWebScan API
GoWebScanTileCombiner.h
Go to the documentation of this file.
1 /**
2 * @file GoWebScanTileCombiner.h
3 * @brief Declares a GoWebScanTileCombiner object.
4 *
5 * @internal
6 * Copyright (C) 2017-2026 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_TILE_COMBINER_H
12 #define GO_WEB_SCAN_TILE_COMBINER_H
13 
17 #include <kApi/Data/kArrayList.h>
18 
19 /**
20 * @class GoWebScanTileCombiner
21 * @extends kObject
22 * @ingroup GoWebScanSdk-Algorithms
23 * @brief Represents an algorithm for matching tiles received from different sources. Each source
24 * is represented by a combiner lane, which has a FIFO queue of received tiles. When a tile
25 * is received, the combiner logic decides whether to emit a frame (set of tiles that have
26 * the same position) or wait. A time threshold and a distance threshold must both be
27 * exceeded to cause a coherency violation. The primary consideration is time - when a lane
28 * has not received a frame within the specified time window, something has gone wrong and
29 * the lane should be disabled as soon as possible. But if the system reverses (no new tiles),
30 * and then runs forward again (new tiles when it catches up), a false coherency violation can
31 * be generated if time is the only criteria. A small distance coherency threshold is used to
32 * prevent these false violations.
33 */
35 
36 /**
37 * @struct GoWebScanTileCombinerParams
38 * @extends kValue
39 * @ingroup GoWebScanSdk-Algorithms
40 * @brief Represents parameters of the tile combiner algorithm.
41 */
43 {
44  k64s coherencyDistance; ///< Lane is disabled if the distance between the first undelivered tile and last undelivered tile exceed this threshold (mils).
45  k64s coherencyTime; ///< Lane is disabled if the time between the first undelivered tile and the last undelivered tile exceed this threshold (microseconds).
46  k64s breakDistance; ///< While the first undelivered tile and last undelivered tile have a position difference greater than this threshold, all combiner frames are dropped (mils).
47 
49 
50 /** Defines the signature for the handler for accepting the output dataset. */
51 typedef kStatus(kCall *GoWebScanTileCombinerDataFx)(kPointer context, k64s tileIndex, GoWebScanPipeMsg* tiles, kSSize laneCount, kSSize tileCount);
52 
53 /** Defines the signature for the handler for a lane being enabled or disabled. */
54 typedef kStatus(kCall* GoWebScanTileCombinerLaneChangeFx)(kPointer context, const k32s* id, kSize length);
55 
56 /**
57 * Constructs a GoWebScanTileCombiner object.
58 *
59 * @public @memberof GoWebScanTileCombiner
60 * @param combiner Receives the constructed GoWebScanTileCombiner object.
61 * @param args Algorithm parameters.
62 * @param allocator Memory allocator (or kNULL for default).
63 * @return Operation status.
64 */
66 
67 /**
68 * Adds a lane to the combiner. A lane represents a unique source of tiles and is identified by
69 * the 4 element ID field in the tile message stamp.
70 *
71 * @public @memberof GoWebScanTileCombiner
72 * @param combiner GoWebScanTileCombiner object.
73 * @param msgId Message type ID.
74 * @param id1 Second element of lane ID.
75 * @param id2 Third element of lane ID.
76 * @param id3 Fourth element of lane ID.
77 * @return Operation status.
78 * @see GoWebScanMsgStamp
79 */
80 GoWebScanFx(kStatus) GoWebScanTileCombiner_AddLane(GoWebScanTileCombiner combiner, k32s msgId, k32s id1, k32s id2, k32s id3);
81 
82 /**
83 * Removes all lanes from the combiner. A lane represents a unique source of tiles and is identified by
84 * the 4 element ID field in the tile message stamp.
85 *
86 * @public @memberof GoWebScanTileCombiner
87 * @param combiner GoWebScanTileCombiner object.
88 * @return Operation status.
89 */
91 
92 /**
93 * Sets the handler for accepting the output data from the algorithm.
94 *
95 * @public @memberof GoWebScanTileCombiner
96 * @param combiner GoWebScanTileCombiner object.
97 * @param data Callback function
98 * @param context Receiver argument for callback.
99 * @return Operation status.
100 */
102 
103 /**
104 * Adds a tile message to the algorithm processing queue. The tile is added to the lane that
105 * corresponds to the message stamp ID.
106 *
107 * @public @memberof GoWebScanTileCombiner
108 * @param combiner GoWebScanTileCombiner object.
109 * @param msg Tile message to add.
110 * @return Operation status.
111 */
113 
114 /**
115 * Clears and relinquishes all lane tile queues.
116 *
117 * @public @memberof GoWebScanTileCombiner
118 * @param combiner GoWebScanTileCombiner object.
119 * @return Operation status.
120 */
122 
123 /**
124 * Gets the lane ID for a given lane index.
125 *
126 * @public @memberof GoWebScanTileCombiner
127 * @param combiner GoWebScanTileCombiner object.
128 * @param index Lane index.
129 * @param id0 Receives the first element of the lane ID.
130 * @param id1 Receives the second element of the lane ID.
131 * @param id2 Receives the third element of the lane ID.
132 * @param id3 Receives the fourth element of the lane ID.
133 * @return Operation status.
134 */
135 GoWebScanFx(kStatus) GoWebScanTileCombiner_LaneAt(GoWebScanTileCombiner combiner, kSSize index, k32s* id0, k32s* id1, k32s* id2, k32s* id3);
136 
137 /**
138 * Set handler for when lane is disabled. Function calls for disabling or enabling a lane enter an asynchronous queue.
139 *
140 * @public @memberof GoWebScanTileCombiner
141 * @param combiner GoWebScanTileCombiner object.
142 * @param function Callback function.
143 * @param receiver Receiver argument for callback.
144 * @return Operation status.
145 */
147 
148 /**
149 * Set handler for when lane is re-enabled. Function calls for disabling or enabling a lane enter an asynchronous queue.
150 *
151 * @public @memberof GoWebScanTileCombiner
152 * @param combiner GoWebScanTileCombiner object.
153 * @param function Callback function.
154 * @param receiver Receiver argument for callback.
155 * @return Operation status.
156 */
158 
159 #include <GoWebScanSdk/GoWebScanTileCombiner.x.h>
160 
161 #endif
k64s breakDistance
While the first undelivered tile and last undelivered tile have a position difference greater than th...
Definition: GoWebScanTileCombiner.h:46
k64s coherencyDistance
Lane is disabled if the distance between the first undelivered tile and last undelivered tile exceed ...
Definition: GoWebScanTileCombiner.h:44
kStatus GoWebScanTileCombiner_RemoveLanes(GoWebScanTileCombiner combiner)
Removes all lanes from the combiner.
kStatus GoWebScanTileCombiner_Construct(GoWebScanTileCombiner *combiner, const GoWebScanTileCombinerParams *args, kAlloc allocator)
Constructs a GoWebScanTileCombiner object.
Declares the GoWebScanPipeMsg class.
Essential GoWebScan declarations.
kStatus(kCall * GoWebScanTileCombinerLaneChangeFx)(kPointer context, const k32s *id, kSize length)
Defines the signature for the handler for a lane being enabled or disabled.
Definition: GoWebScanTileCombiner.h:54
kStatus GoWebScanTileCombiner_SetDataHandler(GoWebScanTileCombiner combiner, GoWebScanTileCombinerDataFx data, kPointer context)
Sets the handler for accepting the output data from the algorithm.
kStatus GoWebScanTileCombiner_SetLaneEnabledHandler(GoWebScanTileCombiner combiner, GoWebScanTileCombinerLaneChangeFx function, kPointer receiver)
Set handler for when lane is re-enabled.
kStatus GoWebScanTileCombiner_AddTile(GoWebScanTileCombiner combiner, GoWebScanPipeMsg msg)
Adds a tile message to the algorithm processing queue.
kStatus GoWebScanTileCombiner_LaneAt(GoWebScanTileCombiner combiner, kSSize index, k32s *id0, k32s *id1, k32s *id2, k32s *id3)
Gets the lane ID for a given lane index.
kStatus GoWebScanTileCombiner_Clear(GoWebScanTileCombiner combiner)
Clears and relinquishes all lane tile queues.
k64s coherencyTime
Lane is disabled if the time between the first undelivered tile and the last undelivered tile exceed ...
Definition: GoWebScanTileCombiner.h:45
Defines GoWebScan utility functions.
Represents parameters of the tile combiner algorithm.
Definition: GoWebScanTileCombiner.h:42
kStatus GoWebScanTileCombiner_SetLaneDisabledHandler(GoWebScanTileCombiner combiner, GoWebScanTileCombinerLaneChangeFx function, kPointer receiver)
Set handler for when lane is disabled.
kStatus(kCall * GoWebScanTileCombinerDataFx)(kPointer context, k64s tileIndex, GoWebScanPipeMsg *tiles, kSSize laneCount, kSSize tileCount)
Defines the signature for the handler for accepting the output dataset.
Definition: GoWebScanTileCombiner.h:51
Base class for a msg that can be processed with a GoWebScanPipeTask and submitted to the GoWebScanPip...
kStatus GoWebScanTileCombiner_AddLane(GoWebScanTileCombiner combiner, k32s msgId, k32s id1, k32s id2, k32s id3)
Adds a lane to the combiner.
Represents an algorithm for matching tiles received from different sources. Each source is represente...