|
libtcspc C++ API
Streaming TCSPC and time tag data processing
|
Bin mapper for linear histograms of arbitrary size.
| DataTypes | data type set specifying datapoint_type and bin_index_type |
Public Member Functions | |
| linear_bin_mapper (arg::offset< typename DataTypes::datapoint_type > offset, arg::bin_width< typename DataTypes::datapoint_type > bin_width, arg::max_bin_index< typename DataTypes::bin_index_type > max_bin_index, arg::clamp< bool > clamp=arg::clamp{false}) | |
| Construct with parameters. | |
| auto | n_bins () const -> std::size_t |
| Implements bin mapper requirement. | |
| auto | operator() (typename DataTypes::datapoint_type datapoint) const -> std::optional< typename DataTypes::bin_index_type > |
| Implements bin mapper requirement. | |
|
inlineexplicit |
Construct with parameters.
max_bin_index must be in the range of bin_index_type.
A negative bin_width value (together with a positive offset value) can be used to flip the histogram, provided that datapoint_type is a signed type with sufficient range.
| offset | minimum value mapped to the first bin |
| bin_width | width of each bin (in datapoint units); must not be 0 |
| max_bin_index | number of bins minus one (must not be negative) |
| clamp | if true, include datapoints outside of the mapped range in the first and last bins |