Merge branch 'Dev' into 'MuckeMachtSachen'

# Conflicts:
#   IntelliPhoto/Painting/GUI/IntelliPhotoGui.h
#   IntelliPhoto/Painting/Image/IntelliShapedImage.cpp
#   IntelliPhoto/Painting/IntelliPhoto.pro.user
#   IntelliPhoto/Painting/Layer/PaintingArea.cpp
#   IntelliPhoto/Painting/Layer/PaintingArea.h
This commit is contained in:
Jonas Mucke
2019-12-05 13:47:52 +00:00
13 changed files with 66 additions and 448 deletions

View File

@@ -19,10 +19,8 @@ bool IntelliImage::loadImage(const QString &fileName){
if (!loadedImage.load(fileName))
return false;
// scaled Image to size of Layer
// loadedImage = loadedImage.scaled(imageData.size(),Qt::IgnoreAspectRatio);
imageData = loadedImage.convertToFormat(QImage::Format_ARGB32);
loadedImage =loadedImage.scaled(imageData.size(),Qt::IgnoreAspectRatio);
imageData= loadedImage.convertToFormat(QImage::Format_ARGB32);
return true;
}

View File

@@ -29,8 +29,8 @@ public:
virtual void floodFill(const QColor& color);
//returns the filtered output
virtual QImage getDisplayable(const QSize& displaySize, int alpha)=0;
virtual QImage getDisplayable(int alpha=255)=0;
virtual QImage getDisplayable(const QSize& displaySize)=0;
virtual QImage getDisplayable()=0;
//returns the filtered output

View File

@@ -12,19 +12,12 @@ IntelliRasterImage::~IntelliRasterImage(){
}
QImage IntelliRasterImage::getDisplayable(int alpha){
return getDisplayable(imageData.size(), alpha);
QImage IntelliRasterImage::getDisplayable(){
return getDisplayable(imageData.size());
}
QImage IntelliRasterImage::getDisplayable(const QSize& displaySize, int alpha){
QImage IntelliRasterImage::getDisplayable(const QSize& displaySize){
QImage copy = imageData;
for(int y = 0; y<copy.height(); y++){
for(int x = 0; x<copy.width(); x++){
QColor clr = copy.pixelColor(x,y);
clr.setAlpha(alpha);
copy.setPixelColor(x,y, clr);
}
}
return copy.scaled(displaySize,Qt::IgnoreAspectRatio);
}

View File

@@ -10,8 +10,8 @@ public:
virtual ~IntelliRasterImage() override;
//returns the filtered output
virtual QImage getDisplayable(const QSize& displaySize,int alpha) override;
virtual QImage getDisplayable(int alpha=255) override;
virtual QImage getDisplayable(const QSize& displaySize) override;
virtual QImage getDisplayable() override;
//sets the data for the visible image

View File

@@ -12,7 +12,7 @@ IntelliShapedImage::~IntelliShapedImage(){
}
QImage IntelliShapedImage::getDisplayable(int alpha){
QImage IntelliShapedImage::getDisplayable(){
return getDisplayable(imageData.size());
}
@@ -49,10 +49,6 @@ QImage IntelliShapedImage::getDisplayable(const QSize& displaySize, int alpha){
QColor tmpColor(0,0,0);
tmpColor.setAlpha(0);
copy.setPixelColor(startPoint,tmpColor);
}else{
QColor clr = copy.pixelColor(x,y);
clr.setAlpha(alpha);
copy.setPixelColor(x,y,clr);
}
}
}

View File

@@ -12,8 +12,8 @@ public:
virtual ~IntelliShapedImage() override;
//returns the filtered output
virtual QImage getDisplayable(const QSize& displaySize, int alpha=255) override;
virtual QImage getDisplayable(int alpha=255) override;
virtual QImage getDisplayable(const QSize& displaySize) override;
virtual QImage getDisplayable() override;
//sets the data for the visible image
virtual void setPolygon(const std::vector<QPoint>& polygonData) override;