Prototype line filter for
An object of a class derived from
ScanLineFilter must be passed to the scan 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 output values, such
that each threads has its own output variables that the calling function can later combine (reduce). Note
that this function is called even if
dip::Framework::ScanOption::NoMultiThreading is given, or if the library
is compiled without multi-threading.
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
- ~ScanLineFilter() defaulted virtual
- A virtual destructor guarantees that we can destroy a derived class by a pointer to base
- void Filter(dip::Framework::ScanLineFilterParameters 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 nInput, dip::uint nOutput, dip::uint nTensorElements) -> dip::uint virtual
- The derived class can define this function for helping to determine whether to compute in parallel or not. It must return the number of clock cycles per input pixel. The default is valid for an arithmetic-like operation.