From 978ba61061040ddc2f0a54b81422b3ab799ba8ab Mon Sep 17 00:00:00 2001 From: Sonaion Date: Wed, 18 Dec 2019 17:57:49 +0100 Subject: [PATCH] updated Image --- src/Image/IntelliImage.h | 10 ++++- src/IntelliPhoto.pro | 2 - src/Tool/IntelliToolFloodFill.cpp | 66 ------------------------------- src/Tool/IntelliToolFloodFill.h | 23 ----------- 4 files changed, 8 insertions(+), 93 deletions(-) delete mode 100644 src/Tool/IntelliToolFloodFill.cpp delete mode 100644 src/Tool/IntelliToolFloodFill.h diff --git a/src/Image/IntelliImage.h b/src/Image/IntelliImage.h index 26ec56b..4faf796 100644 --- a/src/Image/IntelliImage.h +++ b/src/Image/IntelliImage.h @@ -99,18 +99,24 @@ public: virtual void setPolygon(const std::vector& polygonData)=0; /*! - * \brief An function that returns the Polygondata if existent. + * \brief A function that returns the Polygondata if existent. * \return The Polygondata if existent. */ virtual std::vector getPolygonData(){ return std::vector();} /*! - * \brief Loads and Sclaes an Image to the fitting dimensions. + * \brief A function that loads and sclaes an image to the fitting dimensions. * \param fileName - The path+name of the image which to loaded. * \return True if the image could be loaded, false otherwise. */ virtual bool loadImage(const QString &fileName); + /*! + * \brief A function that returns the pixelcolor at a certain point + * \param x - The x-coordinate of the point. + * \param y - The y-coordintae of the point. + * \return The color of the Pixel as QColor. + */ virtual QColor getPixelColor(int x, int y); }; diff --git a/src/IntelliPhoto.pro b/src/IntelliPhoto.pro index f10c416..9b0956d 100644 --- a/src/IntelliPhoto.pro +++ b/src/IntelliPhoto.pro @@ -25,7 +25,6 @@ SOURCES += \ Layer/PaintingArea.cpp \ Tool/IntelliTool.cpp \ Tool/IntelliToolCircle.cpp \ - Tool/IntelliToolFloodFill.cpp \ Tool/IntelliToolLine.cpp \ Tool/IntelliToolPen.cpp \ Tool/IntelliToolPlain.cpp \ @@ -42,7 +41,6 @@ HEADERS += \ Layer/PaintingArea.h \ Tool/IntelliTool.h \ Tool/IntelliToolCircle.h \ - Tool/IntelliToolFloodFill.h \ Tool/IntelliToolLine.h \ Tool/IntelliToolPen.h \ Tool/IntelliToolPlain.h \ diff --git a/src/Tool/IntelliToolFloodFill.cpp b/src/Tool/IntelliToolFloodFill.cpp deleted file mode 100644 index 7712f90..0000000 --- a/src/Tool/IntelliToolFloodFill.cpp +++ /dev/null @@ -1,66 +0,0 @@ -#include "IntelliToolFloodFill.h" -#include "Layer/PaintingArea.h" -#include "QColorDialog" -#include "QInputDialog" - -IntelliToolFloodFill::IntelliToolFloodFill(PaintingArea* Area, IntelliColorPicker* colorPicker) - :IntelliTool(Area, colorPicker){ -} - -IntelliToolFloodFill::~IntelliToolFloodFill(){ - -} - - -void IntelliToolFloodFill::onMouseRightPressed(int x, int y){ - IntelliTool::onMouseRightPressed(x,y); -} - -void IntelliToolFloodFill::onMouseRightReleased(int x, int y){ - IntelliTool::onMouseRightReleased(x,y); -} - -void IntelliToolFloodFill::onMouseLeftPressed(int x, int y){ - IntelliTool::onMouseLeftPressed(x,y); - this->Canvas->image->get - auto depthsearch = [](int x, int y, LayerObject* Canvas){ - - }; - - Canvas->image->calculateVisiblity(); - - -} - -void IntelliToolFloodFill::onMouseLeftReleased(int x, int y){ - IntelliTool::onMouseLeftReleased(x,y); -} - -void IntelliToolFloodFill::onWheelScrolled(int value){ - IntelliTool::onWheelScrolled(value); - this->lineWidth+=value; - if(this->lineWidth<=0){ - this->lineWidth=1; - } -} - -void IntelliToolFloodFill::onMouseMoved(int x, int y){ - IntelliTool::onMouseMoved(x,y); - if(this->drawing){ - this->Canvas->image->drawPlain(Qt::transparent); - QPoint next(x,y); - switch(lineStyle){ - case LineStyle::SOLID_LINE: - this->Canvas->image->drawLine(start,next,colorPicker->getFirstColor(),lineWidth); - break; - case LineStyle::DOTTED_LINE: - QPoint p1 =start.x() <= next.x() ? start : next; - QPoint p2 =start.x() < next.x() ? next : start; - int m = (float)(p2.y()-p1.y())/(float)(p2.x()-p1.x())+0.5f; - int c = start.y()-start.x()*m; - - break; - } - } - IntelliTool::onMouseMoved(x,y); -} diff --git a/src/Tool/IntelliToolFloodFill.h b/src/Tool/IntelliToolFloodFill.h deleted file mode 100644 index 0aa298f..0000000 --- a/src/Tool/IntelliToolFloodFill.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef INTELLITOOLFLOODFILL_H -#define INTELLITOOLFLOODFILL_H -#include "IntelliTool.h" - -#include "QColor" - -class IntelliToolFloodFill : public IntelliTool{ -public: - IntelliToolFloodFill(PaintingArea* Area, IntelliColorPicker* colorPicker); - virtual ~IntelliToolFloodFill() override; - - - virtual void onMouseRightPressed(int x, int y) override; - virtual void onMouseRightReleased(int x, int y) override; - virtual void onMouseLeftPressed(int x, int y) override; - virtual void onMouseLeftReleased(int x, int y) override; - - virtual void onWheelScrolled(int value) override; - - virtual void onMouseMoved(int x, int y) override; -}; - -#endif // INTELLITOOLFLOODFILL_H