mirror of
https://github.com/creyD/intelliphoto.git
synced 2026-04-15 12:50:33 +02:00
Restore of old painting
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -12,11 +12,11 @@ IntelliShapedImage::~IntelliShapedImage(){
|
||||
|
||||
}
|
||||
|
||||
QImage IntelliShapedImage::getDisplayable(int alpha){
|
||||
QImage IntelliShapedImage::getDisplayable(){
|
||||
return getDisplayable(imageData.size());
|
||||
}
|
||||
|
||||
QImage IntelliShapedImage::getDisplayable(const QSize& displaySize, int alpha){
|
||||
QImage IntelliShapedImage::getDisplayable(const QSize& displaySize){
|
||||
QImage copy = imageData;
|
||||
QPoint startPoint;
|
||||
QPoint extrem(0,copy.width()+1);
|
||||
@@ -38,10 +38,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user