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