GoWebScan API
GoWebScanHistogram.h
Go to the documentation of this file.
1 /**
2 * @file GoWebScanHistogram.h
3 * @brief Declares a GoWebScanHistogram 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_HISTOGRAM_H
12 #define GO_WEB_SCAN_HISTOGRAM_H
13 
15 
16 /**
17 * @class GoWebScanHistogram
18 * @extends kObject
19 * @ingroup GoWebScanSdk-Algorithms
20 * @brief Represents a histogram.
21 */
23 
24 /**
25 * Constructs a GoWebScanHistogram object.
26 *
27 * @public @memberof GoWebScanHistogram
28 * @param histogram Receives the constructed GoWebScanHistogram object.
29 * @param minValue Minimum value of the range of values represented by the histogram.
30 * @param maxValue Maximum value of the range of values represented by the histogram.
31 * @param binWidthBits Bit shift for the bin width. The bin width is determined by 1 << binWidthBits.
32 * @param allocator Memory allocator (or kNULL for default).
33 * @return Operation status.
34 */
35 GoWebScanFx(kStatus) GoWebScanHistogram_Construct(GoWebScanHistogram* histogram, k32s minValue, k32s maxValue, k32s binWidthBits, kAlloc allocator);
36 
37 /**
38 * Adds a single value to the histogram.
39 *
40 * @public @memberof GoWebScanHistogram
41 * @param histogram GoWebScanHistogram object.
42 * @param value Value to add to histogram.
43 * @return Operation status.
44 */
45 GoWebScanFx(kStatus) GoWebScanHistogram_Add(GoWebScanHistogram histogram, k32s value);
46 
47 /**
48 * Adds an array of 8-bit unsigned values to the histogram.
49 *
50 * @public @memberof GoWebScanHistogram
51 * @param histogram GoWebScanHistogram object.
52 * @param values Pointer to start of data buffer.
53 * @param count Count of values in data buffer.
54 * @return Operation status.
55 */
56 GoWebScanFx(kStatus) GoWebScanHistogram_AddArray8u(GoWebScanHistogram histogram, const k8u* values, kSize count);
57 
58 /**
59 * Adds an array of 16-bit signed values to the histogram. Null values are ignored.
60 *
61 * @public @memberof GoWebScanHistogram
62 * @param histogram GoWebScanHistogram object.
63 * @param values Pointer to start of data buffer.
64 * @param count Count of values in data buffer.
65 * @return Operation status.
66 */
67 GoWebScanFx(kStatus) GoWebScanHistogram_AddArray16sn(GoWebScanHistogram histogram, const k16s* values, kSize count);
68 
69 /**
70 * Adds an array of 32-bit signed values to the histogram. Null values are ignored.
71 *
72 * @public @memberof GoWebScanHistogram
73 * @param histogram GoWebScanHistogram object.
74 * @param values Pointer to start of data buffer.
75 * @param count Count of values in data buffer.
76 * @return Operation status.
77 */
78 GoWebScanFx(kStatus) GoWebScanHistogram_AddArray32sn(GoWebScanHistogram histogram, const k32s* values, kSize count);
79 
80 /**
81 * Adds an array of 32-bit signed values to the histogram.
82 *
83 * @public @memberof GoWebScanHistogram
84 * @param histogram GoWebScanHistogram object.
85 * @param values Pointer to start of data buffer.
86 * @param count Count of values in data buffer.
87 * @return Operation status.
88 */
89 GoWebScanFx(kStatus) GoWebScanHistogram_AddArray32s(GoWebScanHistogram histogram, const k32s* values, kSize count);
90 
91 /**
92 * Clears histogram. Count is set to zero and bins are cleared.
93 *
94 * @public @memberof GoWebScanHistogram
95 * @param histogram GoWebScanHistogram object.
96 * @return Operation status.
97 */
98 GoWebScanFx(kStatus) GoWebScanHistogram_Clear(GoWebScanHistogram histogram);
99 
100 /**
101 * Gets the X-axis value at a specified quantile.
102 *
103 * @public @memberof GoWebScanHistogram
104 * @param histogram GoWebScanHistogram object.
105 * @param quantile Quantile specified as a fraction.
106 * @return Value at specified quantile.
107 */
108 GoWebScanFx(k32s) GoWebScanHistogram_Quantile(GoWebScanHistogram histogram, k64f quantile);
109 
110 /**
111 * Gets the mode of the histogram.
112 *
113 * @public @memberof GoWebScanHistogram
114 * @param histogram GoWebScanHistogram object.
115 * @return Mode of histogram.
116 */
117 GoWebScanFx(k32s) GoWebScanHistogram_Mode(GoWebScanHistogram histogram);
118 
119 /**
120 * Gets the count of values contained in the histogram
121 *
122 * @public @memberof GoWebScanHistogram
123 * @param histogram GoWebScanHistogram object.
124 * @return Histogram count.
125 */
126 GoWebScanFx(kSize) GoWebScanHistogram_Count(GoWebScanHistogram histogram);
127 
128 /**
129 * Gets the number of bins.
130 *
131 * @public @memberof GoWebScanHistogram
132 * @param histogram GoWebScanHistogram object.
133 * @return Bin count.
134 */
135 GoWebScanFx(kSize) GoWebScanHistogram_BinCount(GoWebScanHistogram histogram);
136 
137 /**
138 * Gets the distribution at a given bin index.
139 *
140 * @public @memberof GoWebScanHistogram
141 * @param histogram GoWebScanHistogram object.
142 * @param binIndex Bin index.
143 * @return Distribution.
144 */
145 GoWebScanFx(k32s) GoWebScanHistogram_BinAt(GoWebScanHistogram histogram, kSize binIndex);
146 
147 #include <GoWebScanSdk/GoWebScanHistogram.x.h>
148 
149 #endif
k32s GoWebScanHistogram_BinAt(GoWebScanHistogram histogram, kSize binIndex)
Gets the distribution at a given bin index.
kSize GoWebScanHistogram_BinCount(GoWebScanHistogram histogram)
Gets the number of bins.
Essential GoWebScan declarations.
k32s GoWebScanHistogram_Quantile(GoWebScanHistogram histogram, k64f quantile)
Gets the X-axis value at a specified quantile.
kStatus GoWebScanHistogram_Construct(GoWebScanHistogram *histogram, k32s minValue, k32s maxValue, k32s binWidthBits, kAlloc allocator)
Constructs a GoWebScanHistogram object.
Represents a histogram.
kStatus GoWebScanHistogram_AddArray32s(GoWebScanHistogram histogram, const k32s *values, kSize count)
Adds an array of 32-bit signed values to the histogram.
k32s GoWebScanHistogram_Mode(GoWebScanHistogram histogram)
Gets the mode of the histogram.
kSize GoWebScanHistogram_Count(GoWebScanHistogram histogram)
Gets the count of values contained in the histogram.
kStatus GoWebScanHistogram_AddArray8u(GoWebScanHistogram histogram, const k8u *values, kSize count)
Adds an array of 8-bit unsigned values to the histogram.
kStatus GoWebScanHistogram_Add(GoWebScanHistogram histogram, k32s value)
Adds a single value to the histogram.
kStatus GoWebScanHistogram_Clear(GoWebScanHistogram histogram)
Clears histogram.
kStatus GoWebScanHistogram_AddArray16sn(GoWebScanHistogram histogram, const k16s *values, kSize count)
Adds an array of 16-bit signed values to the histogram.
kStatus GoWebScanHistogram_AddArray32sn(GoWebScanHistogram histogram, const k32s *values, kSize count)
Adds an array of 32-bit signed values to the histogram.