Implemented LAyer structure

alpha interpolation for saving is missing
resizing is missing
This commit is contained in:
Sonaion
2019-12-05 14:18:42 +01:00
parent 2ded50dfa3
commit ec650171e9
40 changed files with 632 additions and 4950 deletions

View File

@@ -17,6 +17,17 @@ QImage IntelliShapedImage::getDisplayable(int alpha){
}
QImage IntelliShapedImage::getDisplayable(const QSize& displaySize, int alpha){
if(polygonData.size()==0){
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);
}
QImage copy = imageData;
QPoint startPoint;
QPoint extrem(0,copy.width()+1);
@@ -50,6 +61,9 @@ QImage IntelliShapedImage::getDisplayable(const QSize& displaySize, int alpha){
}
void IntelliShapedImage::setPolygon(const std::vector<QPoint>& polygonData){
if(polygonData.size()<3){
return;
}
for(auto element:polygonData){
this->polygonData.push_back(QPoint(element.x(), element.y()));
}