mirror of
https://github.com/TomHarte/CLK.git
synced 2026-04-22 08:16:42 +00:00
Reduce interface.
This commit is contained in:
@@ -762,7 +762,7 @@ using BufferingScanTarget = Outputs::Display::BufferingScanTarget;
|
||||
// best way to stay safe within the PCM sampling limits.
|
||||
if(!isSVideoOutput) {
|
||||
const SignalProcessing::FIRFilter sharpenFilter(15, 1368, 60.0f, 227.5f);
|
||||
const auto sharpen = sharpenFilter.get_coefficients();
|
||||
const auto sharpen = sharpenFilter.coefficients();
|
||||
size_t sharpenFilterSize = 15;
|
||||
bool isStart = true;
|
||||
for(size_t c = 0; c < 8; ++c) {
|
||||
|
||||
@@ -100,7 +100,7 @@ std::vector<short> coefficients_for_idealised_filter_response(
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<float> FIRFilter::get_coefficients() const {
|
||||
std::vector<float> FIRFilter::coefficients() const {
|
||||
std::vector<float> coefficients;
|
||||
coefficients.reserve(filter_coefficients_.size());
|
||||
for(const auto short_coefficient: filter_coefficients_) {
|
||||
@@ -147,41 +147,3 @@ FIRFilter::FIRFilter(const std::vector<float> &coefficients) {
|
||||
filter_coefficients_.push_back(short(coefficient * FixedMultiplier));
|
||||
}
|
||||
}
|
||||
|
||||
FIRFilter FIRFilter::operator+(const FIRFilter &rhs) const {
|
||||
const auto coefficients = get_coefficients();
|
||||
const auto rhs_coefficients = rhs.get_coefficients();
|
||||
|
||||
std::vector<float> sum;
|
||||
sum.reserve(coefficients.size());
|
||||
for(std::size_t i = 0; i < coefficients.size(); ++i) {
|
||||
sum.push_back((coefficients[i] + rhs_coefficients[i]) / 2.0f);
|
||||
}
|
||||
|
||||
return FIRFilter(sum);
|
||||
}
|
||||
|
||||
FIRFilter FIRFilter::operator-() const {
|
||||
const auto coefficients = get_coefficients();
|
||||
std::vector<float> negative_coefficients;
|
||||
|
||||
negative_coefficients.reserve(coefficients.size());
|
||||
for(const auto coefficient: coefficients) {
|
||||
negative_coefficients.push_back(1.0f - coefficient);
|
||||
}
|
||||
|
||||
return FIRFilter(negative_coefficients);
|
||||
}
|
||||
|
||||
FIRFilter FIRFilter::operator*(const FIRFilter &rhs) const {
|
||||
const std::vector<float> coefficients = get_coefficients();
|
||||
const std::vector<float> rhs_coefficients = rhs.get_coefficients();
|
||||
|
||||
std::vector<float> sum;
|
||||
sum.reserve(coefficients.size());
|
||||
for(std::size_t i = 0; i < coefficients.size(); ++i) {
|
||||
sum.push_back(coefficients[i] * rhs_coefficients[i]);
|
||||
}
|
||||
|
||||
return FIRFilter(sum);
|
||||
}
|
||||
|
||||
@@ -78,29 +78,12 @@ public:
|
||||
}
|
||||
|
||||
/*! @returns The number of taps used by this filter. */
|
||||
inline std::size_t get_number_of_taps() const {
|
||||
inline std::size_t size() const {
|
||||
return filter_coefficients_.size();
|
||||
}
|
||||
|
||||
/*! @returns The weighted coefficients that describe this filter. */
|
||||
std::vector<float> get_coefficients() const;
|
||||
|
||||
/*!
|
||||
@returns A filter that would have the effect of adding (and scaling) the outputs of the two filters.
|
||||
Defined only if both have the same number of taps.
|
||||
*/
|
||||
FIRFilter operator+(const FIRFilter &) const;
|
||||
|
||||
/*!
|
||||
@returns A filter that would have the effect of applying the two filters in succession.
|
||||
Defined only if both have the same number of taps.
|
||||
*/
|
||||
FIRFilter operator*(const FIRFilter &) const;
|
||||
|
||||
/*!
|
||||
@returns A filter that would have the opposite effect of this filter.
|
||||
*/
|
||||
FIRFilter operator-() const;
|
||||
std::vector<float> coefficients() const;
|
||||
|
||||
private:
|
||||
std::vector<short> filter_coefficients_;
|
||||
|
||||
Reference in New Issue
Block a user