10 #ifndef KJB_CPP_FILTER_H
11 #define KJB_CPP_FILTER_H
44 : m_kernel(rows % 2 != 0 ? rows : rows + 1, cols % 2 != 0 ? cols : cols + 1)
59 : m_kernel(fname.c_str())
64 : m_kernel(src.m_kernel)
77 swap(m_kernel, other.m_kernel);
108 m_kernel = src.m_kernel;
118 return m_kernel(row, col);
125 return m_kernel(row, col);
165 m_kernel.
write(fname.c_str());
188 Image
operator*(
const Image& image,
const Filter& kernel);
Filter(const Filter &src)
Copy ctor, performs a deep copy.
Definition: i_filter.h:63
Value_type & at(int row, int col)
Access value lvalue at row, column coordinates.
Definition: i_filter.h:145
~Filter()
Destroy filter's memory.
Definition: i_filter.h:70
Value_type at(int row, int col) const
Access value rvalue at row, column coordinates.
Definition: i_filter.h:155
Definition for the Matrix class, a thin wrapper on the KJB Matrix struct and its related functionalit...
Value_type operator()(int row, int col) const
Rvalue value access at given row & column, no bounds-checking.
Definition: i_filter.h:122
Object thrown when an index argument exceeds the size of a container.
Definition: l_exception.h:399
double Value_type
data type of the elements
Definition: m_matrix.h:108
int get_num_rows() const
Return the number of rows in the matrix.
Definition: m_matrix.h:543
Value_type & operator()(int row, int col)
Lvalue value access at given row & column, no bounds-checking.
Definition: i_filter.h:115
Filter(const std::string &fname)
Read filter from a named file.
Definition: i_filter.h:58
Filter(int rows, int cols)
Construct filter of specified size, defaults to zero by zero.
Definition: i_filter.h:43
Filter & operator=(const kjb::Matrix &src)
Assignment of a matrix to a filter.
Definition: i_filter.h:93
Filter & operator=(const Filter &src)
Deep copy assignment.
Definition: i_filter.h:104
#define KJB_THROW(ex)
Definition: l_exception.h:46
friend Image operator*(const Image &, const Filter &)
Convolve an image with a filter.
Definition: i_filter.cpp:51
Filter(const Matrix &src)
Construct filter from matrix.
Definition: i_filter.h:48
void write(std::string fname)
Write to a file.
Definition: i_filter.h:163
Filter(const char *fname)
Read filter from a named file.
Definition: i_filter.h:53
int get_num_cols() const
Return the number of columns in the matrix.
Definition: m_matrix.h:554
Filter laplacian_of_gaussian_filter(int size, double sigma)
Create a Laplacian of Gaussian filter.
Definition: i_filter.cpp:30
Filter class.
Definition: i_filter.h:36
void swap(kjb::Gsl_Multimin_fdf &m1, kjb::Gsl_Multimin_fdf &m2)
Swap two wrapped multimin objects.
Definition: gsl_multimin.h:693
Image gauss_sample_image(const Image &in, int resolution, double sigma)
this wraps C function kjb_c::gauss_sample_image (q.v.).
Definition: i_filter.cpp:68
int write(const char *filename=0) const
Writes the matrix contents to a file specified by name.
Definition: m_matrix.h:1021
void check_bounds(int row, int col) const
Test whether row, column coordinates are valid.
Definition: i_filter.h:132
int get_num_rows() const
Return the number of rows in the filter.
Definition: i_filter.h:81
Matrix::Value_type Value_type
Definition: i_filter.h:40
int get_num_cols() const
Return the number of columns in the filter.
Definition: i_filter.h:87
This class implements matrices, in the linear-algebra sense, with real-valued elements.
Definition: m_matrix.h:94
Code for a wrapper class around the C struct KJB_Image.
Support for error handling exception classes in libKJB.
Wrapped version of the C struct KJB_image.
Definition: i_image.h:76
Filter gaussian_filter(double sigma, int size)
Create a Gaussian filter with given sigma and size.
Definition: i_filter.cpp:17
Gsl_Vector operator*(double scalar, const Gsl_Vector &vector)
multiply scalar and vector, scalar written on the left side
Definition: gsl_vector.h:661
void swap(Filter &other)
Swap the implementation of two filters.
Definition: i_filter.h:74