GoWebScan API
 All Classes Files Functions Variables Typedefs Macros Modules Pages
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-2022 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 /**
54 * Constructs a GoWebScanTileCombiner object.
55 *
56 * @public @memberof GoWebScanTileCombiner
57 * @param combiner Receives the constructed GoWebScanTileCombiner object.
58 * @param args Algorithm parameters.
59 * @param allocator Memory allocator (or kNULL for default).
60 * @return Operation status.
61 */
63 
64 /**
65 * Adds a lane to the combiner. A lane represents a unique source of tiles and is identified by
66 * the 4 element ID field in the tile message stamp.
67 *
68 * @public @memberof GoWebScanTileCombiner
69 * @param combiner GoWebScanTileCombiner object.
70 * @param msgId Message type ID.
71 * @param id1 Second element of lane ID.
72 * @param id2 Third element of lane ID.
73 * @param id3 Fourth element of lane ID.
74 * @return Operation status.
75 * @see GoWebScanMsgStamp
76 */
77 GoWebScanFx(kStatus) GoWebScanTileCombiner_AddLane(GoWebScanTileCombiner combiner, k32s msgId, k32s id1, k32s id2, k32s id3);
78 
79 /**
80 * Sets the handler for accepting the output data from the algorithm.
81 *
82 * @public @memberof GoWebScanTileCombiner
83 * @param combiner GoWebScanTileCombiner object.
84 * @param data Callback function
85 * @param context Receiver argument for callback.
86 * @return Operation status.
87 */
89 
90 /**
91 * Adds a tile message to the algorithm processing queue. The tile is added to the lane that
92 * corresponds to the message stamp ID.
93 *
94 * @public @memberof GoWebScanTileCombiner
95 * @param combiner GoWebScanTileCombiner object.
96 * @param msg Tile message to add.
97 * @return Operation status.
98 */
100 
101 /**
102 * Clears and relinquishes all lane tile queues.
103 *
104 * @public @memberof GoWebScanTileCombiner
105 * @param combiner GoWebScanTileCombiner object.
106 * @return Operation status.
107 */
109 
110 /**
111 * Gets the lane ID for a given lane index.
112 *
113 * @public @memberof GoWebScanTileCombiner
114 * @param combiner GoWebScanTileCombiner object.
115 * @param index Lane index.
116 * @param id0 Receives the first element of the lane ID.
117 * @param id1 Receives the second element of the lane ID.
118 * @param id2 Receives the third element of the lane ID.
119 * @param id3 Receives the fourth element of the lane ID.
120 * @return Operation status.
121 */
122 GoWebScanFx(kStatus) GoWebScanTileCombiner_LaneAt(GoWebScanTileCombiner combiner, kSSize index, k32s* id0, k32s* id1, k32s* id2, k32s* id3);
123 
124 #include <GoWebScanSdk/GoWebScanTileCombiner.x.h>
125 
126 #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_Construct(GoWebScanTileCombiner *combiner, const GoWebScanTileCombinerParams *args, kAlloc allocator)
Constructs a GoWebScanTileCombiner object.
Declares the GoWebScanPipeMsg class.
Essential GoWebScan declarations.
kStatus GoWebScanTileCombiner_SetDataHandler(GoWebScanTileCombiner combiner, GoWebScanTileCombinerDataFx data, kPointer context)
Sets the handler for accepting the output data from the algorithm.
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(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...