The SynchronousImageTask class transforms a source image into a collection of shapes approximating the source image. A wrapper around the asynchronous ImageTask class, this blocks when stepping the model. This is a convenience class for use in scripts and console programs where we would rather block/wait when geometrizing something.
More...
#include <synchronousimagetask.h>
The SynchronousImageTask class transforms a source image into a collection of shapes approximating the source image. A wrapper around the asynchronous ImageTask class, this blocks when stepping the model. This is a convenience class for use in scripts and console programs where we would rather block/wait when geometrizing something.
◆ SynchronousImageTask() [1/2]
geometrize::task::SynchronousImageTask::SynchronousImageTask |
( |
Bitmap & |
target | ) |
|
86 : QObject{},
d{std::make_unique<SynchronousImageTask::SynchronousImageTaskImpl>(
this, target)}
◆ ~SynchronousImageTask()
geometrize::task::SynchronousImageTask::~SynchronousImageTask |
( |
| ) |
|
|
virtual |
◆ SynchronousImageTask() [2/2]
◆ drawBackgroundRectangle()
void geometrize::task::SynchronousImageTask::drawBackgroundRectangle |
( |
| ) |
|
drawBackgroundRectangle Convenience function that draws a background rectangle shape using the target image's background color.
111 d->drawBackgroundRectangle();
◆ getCurrent()
Bitmap & geometrize::task::SynchronousImageTask::getCurrent |
( |
| ) |
|
getCurrent Gets the current bitmap.
- Returns
- The current bitmap.
101 return d->getCurrent();
◆ getPreferences()
getPreferences Gets a reference to the current preferences of this task.
- Returns
- A reference to the current preferences of this task.
116 return d->getPreferences();
◆ getShapes()
std::vector< geometrize::ShapeResult > geometrize::task::SynchronousImageTask::getShapes |
( |
| ) |
const |
getShapes Gets a vector of shapes generated so far by this task.
- Returns
- The vector of shapes generated so far by this task.
126 return d->getShapes();
◆ getTarget()
Bitmap & geometrize::task::SynchronousImageTask::getTarget |
( |
| ) |
|
getTarget Gets the target bitmap.
- Returns
- The target bitmap.
96 return d->getTarget();
◆ operator=()
◆ setPreferences()
setPreferences Sets the preferences for this task.
- Parameters
-
preferences | The preferences to set. |
121 d->setPreferences(preferences);
◆ stepModel()
void geometrize::task::SynchronousImageTask::stepModel |
( |
| ) |
|
stepModel Steps the internal model, typically adding a shape.
The documentation for this class was generated from the following files: