Prototype line filter for
An object of a class derived from
FullLineFilter must be passed to the full 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. It is also the first place where the line filter
can see what the pixel table looks like (as it depends on the processing dimension determined by the
framework), and so it’s a good place to determine some processing options.
Note that this function is called even if
dip::Framework::FullOption::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
- ~FullLineFilter() defaulted virtual
- A virtual destructor guarantees that we can destroy a derived class by a pointer to base
- void Filter(dip::Framework::FullLineFilterParameters const& params) pure virtual
- The derived class must must define this method, this is the actual line filter.
- void SetNumberOfThreads(dip::uint threads, dip::PixelTableOffsets const& pixelTable) virtual
- The derived class can define this function for setting up the processing.
- auto GetNumberOfOperations(dip::uint lineLength, dip::uint nTensorElements, dip::uint nKernelPixels, dip::uint nRuns) -> 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 image line. The default is valid for a convolution-like operation.