ipa: libipa: Histogram: Constify the constructor span
The Histogram constructor does not modify the data. Pass it a Span<const uint32_t> instead of a Span<uint32_t>. Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
13c1e48e8e
commit
88c69f8808
2 changed files with 2 additions and 2 deletions
|
@ -32,7 +32,7 @@ namespace ipa {
|
||||||
* \brief Create a cumulative histogram
|
* \brief Create a cumulative histogram
|
||||||
* \param[in] data A pre-sorted histogram to be passed
|
* \param[in] data A pre-sorted histogram to be passed
|
||||||
*/
|
*/
|
||||||
Histogram::Histogram(Span<uint32_t> data)
|
Histogram::Histogram(Span<const uint32_t> data)
|
||||||
{
|
{
|
||||||
cumulative_.reserve(data.size());
|
cumulative_.reserve(data.size());
|
||||||
cumulative_.push_back(0);
|
cumulative_.push_back(0);
|
||||||
|
|
|
@ -22,7 +22,7 @@ namespace ipa {
|
||||||
class Histogram
|
class Histogram
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Histogram(Span<uint32_t> data);
|
Histogram(Span<const uint32_t> data);
|
||||||
size_t bins() const { return cumulative_.size() - 1; }
|
size_t bins() const { return cumulative_.size() - 1; }
|
||||||
uint64_t total() const { return cumulative_[cumulative_.size() - 1]; }
|
uint64_t total() const { return cumulative_[cumulative_.size() - 1]; }
|
||||||
uint64_t cumulativeFrequency(double bin) const;
|
uint64_t cumulativeFrequency(double bin) const;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue