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

Public Member Functions

 SynchronousImageTaskImpl (SynchronousImageTask *pQ, Bitmap &target)
 
SynchronousImageTaskImpl operator= (const SynchronousImageTaskImpl &)=delete
 
 SynchronousImageTaskImpl (const SynchronousImageTaskImpl &)=delete
 
 ~SynchronousImageTaskImpl ()
 
Bitmap & getTarget ()
 
Bitmap & getCurrent ()
 
void step ()
 
void drawBackgroundRectangle ()
 
geometrize::preferences::ImageTaskPreferencesgetPreferences ()
 
void setPreferences (preferences::ImageTaskPreferences preferences)
 
std::vector
< geometrize::ShapeResult > 
getShapes () const
 

Private Attributes

SynchronousImageTaskq
 
std::vector
< geometrize::ShapeResult > 
m_shapes
 
geometrize::preferences::ImageTaskPreferences m_preferences
 
std::unique_ptr
< geometrize::task::ImageTask
m_task
 
QMetaObject::Connection m_stepConnection
 

Constructor & Destructor Documentation

geometrize::task::SynchronousImageTask::SynchronousImageTaskImpl::SynchronousImageTaskImpl ( SynchronousImageTask pQ,
Bitmap &  target 
)
inline
26  :
27  q{pQ},
28  m_task{std::make_unique<geometrize::task::ImageTask>(target, Qt::DirectConnection)},
30  {
31  m_stepConnection = q->connect(m_task.get(), &ImageTask::signal_modelDidStep, [this](const std::vector<geometrize::ShapeResult> shapes) {
32  std::copy(shapes.begin(), shapes.end(), std::back_inserter(m_shapes));
33  });
34  }
void signal_modelDidStep(std::vector< geometrize::ShapeResult > shapes)
signal_modelDidStep Signal that is emitted immediately after the underlying image task model is stepp...
QMetaObject::Connection m_stepConnection
Definition: synchronousimagetask.cpp:83
SynchronousImageTask * q
Definition: synchronousimagetask.cpp:79
std::vector< geometrize::ShapeResult > m_shapes
Definition: synchronousimagetask.cpp:80
std::unique_ptr< geometrize::task::ImageTask > m_task
Definition: synchronousimagetask.cpp:82
geometrize::task::SynchronousImageTask::SynchronousImageTaskImpl::SynchronousImageTaskImpl ( const SynchronousImageTaskImpl )
delete
geometrize::task::SynchronousImageTask::SynchronousImageTaskImpl::~SynchronousImageTaskImpl ( )
inline
38  {
39  QObject::disconnect(m_stepConnection);
40  }
QMetaObject::Connection m_stepConnection
Definition: synchronousimagetask.cpp:83

Member Function Documentation

void geometrize::task::SynchronousImageTask::SynchronousImageTaskImpl::drawBackgroundRectangle ( )
inline
58  {
59  const geometrize::rgba color{geometrize::commonutil::getAverageImageColor(m_task->getTarget())};
60  m_task->drawBackgroundRectangle(color);
61  }
std::unique_ptr< geometrize::task::ImageTask > m_task
Definition: synchronousimagetask.cpp:82
Bitmap& geometrize::task::SynchronousImageTask::SynchronousImageTaskImpl::getCurrent ( )
inline
48  {
49  return m_task->getCurrent();
50  }
std::unique_ptr< geometrize::task::ImageTask > m_task
Definition: synchronousimagetask.cpp:82
geometrize::preferences::ImageTaskPreferences& geometrize::task::SynchronousImageTask::SynchronousImageTaskImpl::getPreferences ( )
inline
64  {
65  return m_task->getPreferences();
66  }
std::unique_ptr< geometrize::task::ImageTask > m_task
Definition: synchronousimagetask.cpp:82
std::vector<geometrize::ShapeResult> geometrize::task::SynchronousImageTask::SynchronousImageTaskImpl::getShapes ( ) const
inline
74  {
75  return m_shapes;
76  }
std::vector< geometrize::ShapeResult > m_shapes
Definition: synchronousimagetask.cpp:80
Bitmap& geometrize::task::SynchronousImageTask::SynchronousImageTaskImpl::getTarget ( )
inline
43  {
44  return m_task->getTarget();
45  }
std::unique_ptr< geometrize::task::ImageTask > m_task
Definition: synchronousimagetask.cpp:82
SynchronousImageTaskImpl geometrize::task::SynchronousImageTask::SynchronousImageTaskImpl::operator= ( const SynchronousImageTaskImpl )
delete
void geometrize::task::SynchronousImageTask::SynchronousImageTaskImpl::setPreferences ( preferences::ImageTaskPreferences  preferences)
inline
69  {
70  m_task->setPreferences(preferences);
71  }
std::unique_ptr< geometrize::task::ImageTask > m_task
Definition: synchronousimagetask.cpp:82
void geometrize::task::SynchronousImageTask::SynchronousImageTaskImpl::step ( )
inline
53  {
54  m_task->stepModel();
55  }
std::unique_ptr< geometrize::task::ImageTask > m_task
Definition: synchronousimagetask.cpp:82

Member Data Documentation

geometrize::preferences::ImageTaskPreferences geometrize::task::SynchronousImageTask::SynchronousImageTaskImpl::m_preferences
private
std::vector<geometrize::ShapeResult> geometrize::task::SynchronousImageTask::SynchronousImageTaskImpl::m_shapes
private
QMetaObject::Connection geometrize::task::SynchronousImageTask::SynchronousImageTaskImpl::m_stepConnection
private
std::unique_ptr<geometrize::task::ImageTask> geometrize::task::SynchronousImageTask::SynchronousImageTaskImpl::m_task
private
SynchronousImageTask* geometrize::task::SynchronousImageTask::SynchronousImageTaskImpl::q
private

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