redo old strcuture to dev

This commit is contained in:
Jonas Mucke
2019-12-04 18:02:14 +01:00
parent dd0899ff67
commit 69c2750358
33 changed files with 515 additions and 4942 deletions

View File

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

View File

@@ -12,12 +12,19 @@ IntelliRasterImage::~IntelliRasterImage(){
}
QImage IntelliRasterImage::getDisplayable(){
return getDisplayable(imageData.size());
QImage IntelliRasterImage::getDisplayable(int alpha){
return getDisplayable(imageData.size(), alpha);
}
QImage IntelliRasterImage::getDisplayable(const QSize& displaySize){
QImage IntelliRasterImage::getDisplayable(const QSize& displaySize, int alpha){
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) override;
virtual QImage getDisplayable() override;
virtual QImage getDisplayable(const QSize& displaySize,int alpha) override;
virtual QImage getDisplayable(int alpha=255) override;
//sets the data for the visible image

View File

@@ -12,11 +12,11 @@ IntelliShapedImage::~IntelliShapedImage(){
}
QImage IntelliShapedImage::getDisplayable(){
QImage IntelliShapedImage::getDisplayable(int alpha){
return getDisplayable(imageData.size());
}
QImage IntelliShapedImage::getDisplayable(const QSize& displaySize){
QImage IntelliShapedImage::getDisplayable(const QSize& displaySize, int alpha){
QImage copy = imageData;
QPoint startPoint;
QPoint extrem(0,copy.width()+1);
@@ -38,6 +38,10 @@ QImage IntelliShapedImage::getDisplayable(const QSize& displaySize){
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) override;
virtual QImage getDisplayable() override;
virtual QImage getDisplayable(const QSize& displaySize, int alpha=255) override;
virtual QImage getDisplayable(int alpha=255) override;
//sets the data for the visible image
virtual void setPolygon(const std::vector<QPoint>& polygonData) override;