SeparableLineFilter class
Prototype line filter for dip::Framework::Separable
.
Contents
An object of a class derived from SeparableLineFilter
must be passed to the separable framework. The derived
class can be a template class, such that the line filter is overloaded for each possible pixel data type.
A derived class can have data members that hold parameters to the line filter, that hold output values,
or that hold intermediate buffers. The SetNumberOfThreads
method is
called once before any processing starts. This is a good place to allocate space for temporary buffers, such
that each threads has its own buffers to write in. Note that this function is called even if
dip::Framework::SeparableOption::NoMultiThreading
is given, or if the library is compiled without multi-threading.
The GetNumberOfOperations
method is called to determine if it is worthwhile to start worker threads and
perform the computation in parallel. This function should not perform any other tasks, as it is not
guaranteed to be called. It is not important that the function be very precise, see Multithreading.
Constructors, destructors, assignment and conversion operators
- ~SeparableLineFilter() defaulted virtual
- A virtual destructor guarantees that we can destroy a derived class by a pointer to base
Functions
- void Filter(dip::Framework::SeparableLineFilterParameters const& params) pure virtual
- The derived class must must define this method, this is the actual line filter.
- void SetNumberOfThreads(dip::uint threads) virtual
- The derived class can define this function for setting up the processing.
- auto GetNumberOfOperations(dip::uint lineLength, dip::uint nTensorElements, dip::uint border, dip::uint procDim) -> dip::uint virtual
- The derived class can define this function for helping to determine whether to whether to compute in parallel or not. It must return the number of clock cycles per image line. The default is valid for a convolution-like operation.