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 Member Functions | Private Attributes | List of all members
geometrize::dialog::ImageTaskImageWidget::ImageTaskImageWidgetImpl Class Reference
Collaboration diagram for geometrize::dialog::ImageTaskImageWidget::ImageTaskImageWidgetImpl:
Collaboration graph
[legend]

Public Member Functions

 ImageTaskImageWidgetImpl (ImageTaskImageWidget *pQ)
 
 ~ImageTaskImageWidgetImpl ()=default
 
ImageTaskImageWidgetImpl operator= (const ImageTaskImageWidgetImpl &)=delete
 
 ImageTaskImageWidgetImpl (const ImageTaskImageWidgetImpl &)=delete
 
void setTargetImageOpacity (const unsigned int opacity)
 
void setTargetImage (const QImage &image)
 
void onLanguageChange ()
 

Private Member Functions

void populateUi ()
 
void updateTargetImageOpacity (const unsigned int opacity)
 

Private Attributes

ImageTaskImageWidgetq
 
std::unique_ptr
< Ui::ImageTaskImageWidget > 
ui
 

Constructor & Destructor Documentation

geometrize::dialog::ImageTaskImageWidget::ImageTaskImageWidgetImpl::ImageTaskImageWidgetImpl ( ImageTaskImageWidget pQ)
inline
23  : q{pQ}, ui{std::make_unique<Ui::ImageTaskImageWidget>()}
24  {
25  ui->setupUi(q);
26 
27  q->connect(ui->targetImageOpacitySlider, &QSlider::valueChanged, [this](int value) {
28  updateTargetImageOpacity(static_cast<unsigned int>(value));
29  emit q->targetImageOpacityChanged(static_cast<unsigned int>(value));
30  });
31 
32  q->connect(ui->pickTargetImageButton, &QPushButton::clicked, [this]() {
34  if(imagePath.isEmpty()) {
35  return;
36  }
37 
38  const QImage image{geometrize::image::loadImage(imagePath.toStdString())};
39  if(image.isNull()) {
40  return;
41  }
42 
43  emit q->targetImageSelected(image);
44  });
45 
46  populateUi();
47  }
QImage loadImage(const std::string &filePath)
loadImage Loads an image from the image at the file path. Converts to RGBA8888 format.
Definition: imageloader.cpp:62
std::unique_ptr< Ui::ImageTaskImageWidget > ui
Definition: imagetaskimagewidget.cpp:88
void targetImageSelected(const QImage &image)
targetImageSelected Signal dispatched when a candidate target image is selected, typically by the use...
void populateUi()
Definition: imagetaskimagewidget.cpp:77
void updateTargetImageOpacity(const unsigned int opacity)
Definition: imagetaskimagewidget.cpp:81
void targetImageOpacityChanged(unsigned int opacity)
targetImageOpacityChanged Signal dispatched when the target image opacity is changed.
ImageTaskImageWidget * q
Definition: imagetaskimagewidget.cpp:87
QString openTargetImagePickerDialog(QWidget *parent)
Definition: uiactions.cpp:244
geometrize::dialog::ImageTaskImageWidget::ImageTaskImageWidgetImpl::~ImageTaskImageWidgetImpl ( )
default
geometrize::dialog::ImageTaskImageWidget::ImageTaskImageWidgetImpl::ImageTaskImageWidgetImpl ( const ImageTaskImageWidgetImpl )
delete

Member Function Documentation

void geometrize::dialog::ImageTaskImageWidget::ImageTaskImageWidgetImpl::onLanguageChange ( )
inline
71  {
72  ui->retranslateUi(q);
73  populateUi();
74  }
std::unique_ptr< Ui::ImageTaskImageWidget > ui
Definition: imagetaskimagewidget.cpp:88
void populateUi()
Definition: imagetaskimagewidget.cpp:77
ImageTaskImageWidget * q
Definition: imagetaskimagewidget.cpp:87
ImageTaskImageWidgetImpl geometrize::dialog::ImageTaskImageWidget::ImageTaskImageWidgetImpl::operator= ( const ImageTaskImageWidgetImpl )
delete
void geometrize::dialog::ImageTaskImageWidget::ImageTaskImageWidgetImpl::populateUi ( )
inlineprivate
78  {
79  }
void geometrize::dialog::ImageTaskImageWidget::ImageTaskImageWidgetImpl::setTargetImage ( const QImage &  image)
inline
59  {
60  if(image.isNull()) {
61  return;
62  }
63 
64  const int thumbnailSize{250};
65  ui->targetImageLabel->setPixmap(QPixmap::fromImage(image.scaled(thumbnailSize, thumbnailSize, Qt::KeepAspectRatio)));
66 
67  emit q->targetImageSet(image);
68  }
std::unique_ptr< Ui::ImageTaskImageWidget > ui
Definition: imagetaskimagewidget.cpp:88
void targetImageSet(const QImage &image)
targetImageSet Signal dispatched when a target image is set and made visible in this widget (and is p...
ImageTaskImageWidget * q
Definition: imagetaskimagewidget.cpp:87
void geometrize::dialog::ImageTaskImageWidget::ImageTaskImageWidgetImpl::setTargetImageOpacity ( const unsigned int  opacity)
inline
53  {
54  updateTargetImageOpacity(opacity);
55  emit q->targetImageOpacityChanged(opacity);
56  }
void updateTargetImageOpacity(const unsigned int opacity)
Definition: imagetaskimagewidget.cpp:81
void targetImageOpacityChanged(unsigned int opacity)
targetImageOpacityChanged Signal dispatched when the target image opacity is changed.
ImageTaskImageWidget * q
Definition: imagetaskimagewidget.cpp:87
void geometrize::dialog::ImageTaskImageWidget::ImageTaskImageWidgetImpl::updateTargetImageOpacity ( const unsigned int  opacity)
inlineprivate
82  {
83  ui->targetImageOpacitySlider->setValue(opacity);
84  ui->targetImageOpacityValueLabel->setText(QLocale().toString(opacity));
85  }
std::unique_ptr< Ui::ImageTaskImageWidget > ui
Definition: imagetaskimagewidget.cpp:88

Member Data Documentation

ImageTaskImageWidget* geometrize::dialog::ImageTaskImageWidget::ImageTaskImageWidgetImpl::q
private
std::unique_ptr<Ui::ImageTaskImageWidget> geometrize::dialog::ImageTaskImageWidget::ImageTaskImageWidgetImpl::ui
private

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