20 #include "../geometry.h"
21 #include "../parallelism.h"
22 #include "../bitmap/abstract_bitmap.h"
23 #include "../contours/contours.h"
114 void setSeeds(
const int seedsXY[],
int seedCount);
A very basic class for any image.
Task: an operation that can be executed by multiple threads in parallel.
Makes sure the bitmap content is accessible within an image processing task.
Flood fill algorithm implementation.
std::mutex access
access control assuring internal thread safety
void setSeeds(const IntPoint seeds[], int seedCount)
Specifies a set of seeds (starting points)
IntRectangle getBounds() const
Returns bounding box of the computed mask.
BorderMorphology
Morphological postprocessing operation applied to discovered connected components.
@ DILATE
apply a dilatation
const AbstractBitmap * getInput() const
Returns input bitmap (null if not set yet)
AbstractBitmap * ignoredSeeds
1-bit bitmap storing flags marking used pixels
BorderMorphology borderMorphology
border morphological postprocessing
void setComputeContours(bool)
Enables or disables contours computation.
std::vector< IntegerContour2D * > contours
contours to store borders for each seed
void setInput(AbstractBitmap *)
Sets the input bitmap.
AbstractBitmap * output
resulting mask
void setBorderPostprocessing(BorderMorphology operation, float holdRadius, float releaseRadius)
Specifies a morphological operation to apply to the mask border.
void setMaskPos(const IntPoint &)
Specifies left-top corner position of the mask to compute inside the input bitmap.
const IntegerContour2D & getContour(int contourIndex) const
Returns a contour by index if computeContours was true, throws an exception otherwise.
virtual void afterProcessing(ThreadIndex threadCount, GraphicPipeline *gpu, bool aborted) final
Instruction called after the task is executed.
float getTolerance() const
Returns yjr intensity tolerance threshold.
IntPoint maskPos
left-top corner of the mask to compute over the input bitmap
virtual void beforeProcessing(ThreadIndex threadCount, ProcessingTarget target, GraphicPipeline *gpu) final
Instruction called before the task is executed.
std::vector< IntPoint > seeds
set of starting points (seed points)
void setTolerance(float)
Sets the intensity tolerance threshold used to decide on similarity of neighboring pixels.
float tolerance
intensity tolerance value
AbstractBitmap * input
input bitmap
const AbstractBitmap * getOutput() const
Returns output bitmap (null if not set yet)
IntRectangle bounds
mask bounds
virtual bool process(TaskThread &thread) final
Executes the task on CPU within a given thread.
int getContourCount() const
Returns number of detected contours.
bool computeContours
if true, border contours will be computed per each seed
void setOutput(AbstractBitmap *)
Specifies the bitmap to put the resulting mask to.
ThreadIndex getMaxThreads() const
Gives the upper limint on the number of threads the task may be performed by.
Internal low-level GPU control API.
A sequence of integer-valued 2D points.
unsigned char ThreadIndex
number of threads / thread index