summaryrefslogtreecommitdiff
path: root/utils/hooks
AgeCommit message (Expand)Author
2020-11-02utils: hooks: pre-push: Reject commits with a Change-IdLaurent Pinchart
2020-10-02utils: hooks: pre-push: Accept Acked-by in addition to Reviewed-byLaurent Pinchart
2020-04-30utils: hooks: pre-push: Catch commits without reviewsLaurent Pinchart
2020-04-30utils: hooks: pre-push: Catch commits without committer's SoBLaurent Pinchart
2020-04-15licenses: Add SPDX headers to the git commit hook scriptsLaurent Pinchart
2020-04-15utils: hooks: Add pre-push commit hookLaurent Pinchart
2020-01-18checkstyle: Add a pre-commit hook scriptNicolas Dufresne
2019-01-30utils: hooks: Provide post-commit hook example to checkstyle.pyKieran Bingham
ace */ #pragma once #include <limits.h> #include <stdint.h> #include <type_traits> #include <vector> #include <libcamera/base/span.h> #include <libcamera/base/utils.h> namespace libcamera { namespace ipa { class Histogram { public: Histogram() { cumulative_.push_back(0); } Histogram(Span<const uint32_t> data); template<typename Transform, std::enable_if_t<std::is_invocable_v<Transform, uint32_t>> * = nullptr> Histogram(Span<const uint32_t> data, Transform transform) { cumulative_.resize(data.size() + 1); cumulative_[0] = 0; for (const auto &[i, value] : utils::enumerate(data)) cumulative_[i + 1] = cumulative_[i] + transform(value); } size_t bins() const { return cumulative_.size() - 1; } uint64_t total() const { return cumulative_[cumulative_.size() - 1]; } uint64_t cumulativeFrequency(double bin) const; double quantile(double q, uint32_t first = 0, uint32_t last = UINT_MAX) const; double interQuantileMean(double lowQuantile, double hiQuantile) const; private: std::vector<uint64_t> cumulative_; }; } /* namespace ipa */ } /* namespace libcamera */