#include <kino_plugin_utility.h>
Public Member Functions | |
| convolve_filter () | |
| void | push_weight (const double Weight) |
| unsigned int | width () |
| unsigned int | neighbors () |
| unsigned int | middle () |
| void | push_value (const PixelType Value) |
| PixelType | get_value () |
| PixelType | get_value (const unsigned int Start, const unsigned int End) |
Private Types | |
| typedef std::vector< double > | weight_collection_type |
| typedef std::deque< PixelType > | value_collection_type |
Private Attributes | |
| weight_collection_type | m_weights |
| value_collection_type | m_values |
| double | m_scale |
Definition at line 91 of file kino_plugin_utility.h.
|
|||||
|
Definition at line 180 of file kino_plugin_utility.h. |
|
|||||
|
Definition at line 177 of file kino_plugin_utility.h. |
|
|||||||||
|
Definition at line 94 of file kino_plugin_utility.h. 00094 : 00095 m_scale(0) 00096 { 00097 }
|
|
||||||||||||||||
|
Definition at line 153 of file kino_plugin_utility.h. References kino::convolve_filter< PixelType >::m_values, and kino::convolve_filter< PixelType >::m_weights. 00154 {
00155 double scale = std::accumulate(m_weights.begin() + Start, m_weights.begin() + End, 0.0);
00156 if(scale)
00157 scale = 1.0 / scale;
00158
00159 PixelType result;
00160
00161 weight_collection_type::const_iterator weight = m_weights.begin() + Start;
00162 for(typename value_collection_type::iterator value = m_values.begin() + Start; value != m_values.begin() + End; ++value, ++weight)
00163 {
00164 result.red += (value->red) * (*weight);
00165 result.green += (value->green) * (*weight);
00166 result.blue += (value->blue) * (*weight);
00167 }
00168
00169 result.red *= scale;
00170 result.green *= scale;
00171 result.blue *= scale;
00172
00173 return result;
00174 }
|
|
|||||||||
|
Definition at line 134 of file kino_plugin_utility.h. References kino::convolve_filter< PixelType >::m_scale, kino::convolve_filter< PixelType >::m_values, and kino::convolve_filter< PixelType >::m_weights. 00135 {
00136 PixelType result;
00137
00138 weight_collection_type::const_iterator weight = m_weights.begin();
00139 for(typename value_collection_type::iterator value = m_values.begin(); value != m_values.end(); ++value, ++weight)
00140 {
00141 result.red += (value->red) * (*weight);
00142 result.green += (value->green) * (*weight);
00143 result.blue += (value->blue) * (*weight);
00144 }
00145
00146 result.red *= m_scale;
00147 result.green *= m_scale;
00148 result.blue *= m_scale;
00149
00150 return result;
00151 }
|
|
|||||||||
|
Definition at line 119 of file kino_plugin_utility.h. References kino::convolve_filter< PixelType >::m_weights. 00120 {
00121 return m_weights.size() / 2;
00122 }
|
|
|||||||||
|
Definition at line 114 of file kino_plugin_utility.h. References kino::convolve_filter< PixelType >::m_weights. 00115 {
00116 return m_weights.size() / 2;
00117 }
|
|
||||||||||
|
Definition at line 124 of file kino_plugin_utility.h. References kino::convolve_filter< PixelType >::m_values, and kino::convolve_filter< PixelType >::m_weights. 00125 {
00126 // Sanity checks ...
00127 assert(m_weights.size());
00128 assert(m_weights.size() == m_values.size());
00129
00130 m_values.push_back(Value);
00131 m_values.pop_front();
00132 }
|
|
||||||||||
|
Definition at line 99 of file kino_plugin_utility.h. References kino::convolve_filter< PixelType >::m_scale, kino::convolve_filter< PixelType >::m_values, and kino::convolve_filter< PixelType >::m_weights. 00100 {
00101 m_weights.push_back(Weight);
00102 m_values.resize(m_weights.size());
00103
00104 m_scale = std::accumulate(m_weights.begin(), m_weights.end(), 0.0);
00105 if(m_scale)
00106 m_scale = 1.0 / m_scale;
00107 }
|
|
|||||||||
|
Definition at line 109 of file kino_plugin_utility.h. References kino::convolve_filter< PixelType >::m_weights. 00110 {
00111 return m_weights.size();
00112 }
|
|
|||||
|
Definition at line 183 of file kino_plugin_utility.h. Referenced by kino::convolve_filter< PixelType >::get_value(), and kino::convolve_filter< PixelType >::push_weight(). |
|
|||||
|
Definition at line 181 of file kino_plugin_utility.h. Referenced by kino::convolve_filter< PixelType >::get_value(), kino::convolve_filter< PixelType >::push_value(), and kino::convolve_filter< PixelType >::push_weight(). |
|
|||||
1.4.2