Public Member Functions | |
float | apply (const float *array) const |
float | apply (const float *array, int left, int right) const |
Public Attributes | |
const float * | array |
coefficients | |
int | delta |
distance between cefficients in array | |
int | count |
number of coefficients | |
int | first |
index to multiply by array[0] | |
float | normalize |
common multiplier to make it sum to 1 |
Coefficients for the filter at a particular position & width.
float Filter::Coefficients::apply | ( | const float * | array | ) | const |
Multiply an array of pixels by the filter coefficients and return the sum of the results. It is equivalent to the following code:
float sum = pixels[first]*array[0]; for (int i = 1; i < count; i++) sum += pixels[first+i]*array[delta*i]; return sum*normalize;
Note that in many cases your input is a bounded array or is not an array at all. You can either write equivalent code to read your source, or copy it to an array and call this.