Geometrize  1.0
An application for geometrizing images into geometric primitives
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
Classes | Public Member Functions | Private Attributes | List of all members
geometrize::task::SynchronousImageTask Class Reference

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>

Inheritance diagram for geometrize::task::SynchronousImageTask:
Inheritance graph
[legend]
Collaboration diagram for geometrize::task::SynchronousImageTask:
Collaboration graph
[legend]

Classes

class  SynchronousImageTaskImpl
 

Public Member Functions

 SynchronousImageTask (Bitmap &target)
 
virtual ~SynchronousImageTask ()
 
SynchronousImageTaskoperator= (const SynchronousImageTask &)=delete
 
 SynchronousImageTask (const SynchronousImageTask &)=delete
 
Bitmap & getTarget ()
 getTarget Gets the target bitmap. More...
 
Bitmap & getCurrent ()
 getCurrent Gets the current bitmap. More...
 
void stepModel ()
 stepModel Steps the internal model, typically adding a shape. More...
 
void drawBackgroundRectangle ()
 drawBackgroundRectangle Convenience function that draws a background rectangle shape using the target image's background color. More...
 
geometrize::preferences::ImageTaskPreferencesgetPreferences ()
 getPreferences Gets a reference to the current preferences of this task. More...
 
void setPreferences (preferences::ImageTaskPreferences preferences)
 setPreferences Sets the preferences for this task. More...
 
std::vector
< geometrize::ShapeResult > 
getShapes () const
 getShapes Gets a vector of shapes generated so far by this task. More...
 

Private Attributes

std::unique_ptr
< SynchronousImageTaskImpl
d
 

Detailed Description

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.

Constructor & Destructor Documentation

geometrize::task::SynchronousImageTask::SynchronousImageTask ( Bitmap &  target)
86  : QObject{}, d{std::make_unique<SynchronousImageTask::SynchronousImageTaskImpl>(this, target)}
87 {
88 }
std::unique_ptr< SynchronousImageTaskImpl > d
Definition: synchronousimagetask.h:77
geometrize::task::SynchronousImageTask::~SynchronousImageTask ( )
virtual
91 {
92 }
geometrize::task::SynchronousImageTask::SynchronousImageTask ( const SynchronousImageTask )
delete

Member Function Documentation

void geometrize::task::SynchronousImageTask::drawBackgroundRectangle ( )

drawBackgroundRectangle Convenience function that draws a background rectangle shape using the target image's background color.

110 {
111  d->drawBackgroundRectangle();
112 }
std::unique_ptr< SynchronousImageTaskImpl > d
Definition: synchronousimagetask.h:77
Bitmap & geometrize::task::SynchronousImageTask::getCurrent ( )

getCurrent Gets the current bitmap.

Returns
The current bitmap.
100 {
101  return d->getCurrent();
102 }
std::unique_ptr< SynchronousImageTaskImpl > d
Definition: synchronousimagetask.h:77
geometrize::preferences::ImageTaskPreferences & geometrize::task::SynchronousImageTask::getPreferences ( )

getPreferences Gets a reference to the current preferences of this task.

Returns
A reference to the current preferences of this task.
115 {
116  return d->getPreferences();
117 }
std::unique_ptr< SynchronousImageTaskImpl > d
Definition: synchronousimagetask.h:77
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.
125 {
126  return d->getShapes();
127 }
std::unique_ptr< SynchronousImageTaskImpl > d
Definition: synchronousimagetask.h:77
Bitmap & geometrize::task::SynchronousImageTask::getTarget ( )

getTarget Gets the target bitmap.

Returns
The target bitmap.
95 {
96  return d->getTarget();
97 }
std::unique_ptr< SynchronousImageTaskImpl > d
Definition: synchronousimagetask.h:77
SynchronousImageTask& geometrize::task::SynchronousImageTask::operator= ( const SynchronousImageTask )
delete
void geometrize::task::SynchronousImageTask::setPreferences ( preferences::ImageTaskPreferences  preferences)

setPreferences Sets the preferences for this task.

Parameters
preferencesThe preferences to set.
120 {
121  d->setPreferences(preferences);
122 }
std::unique_ptr< SynchronousImageTaskImpl > d
Definition: synchronousimagetask.h:77
void geometrize::task::SynchronousImageTask::stepModel ( )

stepModel Steps the internal model, typically adding a shape.

105 {
106  d->step();
107 }
std::unique_ptr< SynchronousImageTaskImpl > d
Definition: synchronousimagetask.h:77

Member Data Documentation

std::unique_ptr<SynchronousImageTaskImpl> geometrize::task::SynchronousImageTask::d
private

The documentation for this class was generated from the following files: