00001 // This is oxl/osl/osl_1d_half_kernel.h 00002 #ifndef osl_1d_half_kernel_h_ 00003 #define osl_1d_half_kernel_h_ 00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE 00005 #pragma interface 00006 #endif 00007 //: 00008 // \file 00009 // \author fsm 00010 00011 //: This structure holds half of a symmetric convolution kernel. 00012 // The centre of the kernel is array[0]. 00013 template <class T> 00014 struct osl_1d_half_kernel 00015 { 00016 osl_1d_half_kernel(unsigned capacity_ =40) 00017 : capacity(capacity_) 00018 , count(0) 00019 , array(new T[capacity]) { } 00020 00021 ~osl_1d_half_kernel() { delete [] array; array = 0; } 00022 00023 unsigned const capacity; 00024 00025 unsigned count; 00026 T *array; 00027 }; 00028 00029 template <class T> 00030 void osl_create_gaussian (T gauss_sigma, osl_1d_half_kernel<T> *mask_ptr); 00031 00032 #endif // osl_1d_half_kernel_h_