Uncrustify all .cpp files

This commit is contained in:
2020-01-09 11:35:36 +01:00
parent e3b2968f4d
commit 624eb0fde6
4 changed files with 94 additions and 94 deletions

View File

@@ -5,9 +5,9 @@
#include <QDebug>
IntelliShapedImage::IntelliShapedImage(int width, int height, bool fastRendererOn)
: IntelliRasterImage(width, height, fastRendererOn){
TypeOfImage = IntelliImage::ImageType::SHAPEDIMAGE;
this->fastRenderer = fastRendererOn;
: IntelliRasterImage(width, height, fastRendererOn){
TypeOfImage = IntelliImage::ImageType::SHAPEDIMAGE;
this->fastRenderer = fastRendererOn;
}
IntelliShapedImage::~IntelliShapedImage(){
@@ -19,7 +19,7 @@ QImage IntelliShapedImage::getDisplayable(int alpha){
}
IntelliImage* IntelliShapedImage::getDeepCopy(){
IntelliShapedImage* shaped = new IntelliShapedImage(imageData.width(), imageData.height(), false);
IntelliShapedImage* shaped = new IntelliShapedImage(imageData.width(), imageData.height(), false);
shaped->setPolygon(this->polygonData);
shaped->imageData.fill(Qt::transparent);
shaped->TypeOfImage = IntelliImage::ImageType::SHAPEDIMAGE;
@@ -27,11 +27,11 @@ IntelliImage* IntelliShapedImage::getDeepCopy(){
}
void IntelliShapedImage::calculateVisiblity(){
if(fastRenderer){
this->imageData = imageData.convertToFormat(QImage::Format_ARGB32);
}
if(fastRenderer) {
this->imageData = imageData.convertToFormat(QImage::Format_ARGB32);
}
if(polygonData.size()<=2) {
if(polygonData.size()<=2) {
QColor clr;
for(int y=0; y<imageData.height(); y++) {
for(int x=0; x<imageData.width(); x++) {
@@ -40,9 +40,9 @@ void IntelliShapedImage::calculateVisiblity(){
imageData.setPixelColor(x,y,clr);
}
}
if(fastRenderer){
this->imageData = this->imageData.convertToFormat(QImage::Format_Indexed8);
}
if(fastRenderer) {
this->imageData = this->imageData.convertToFormat(QImage::Format_Indexed8);
}
return;
}
QColor clr;
@@ -50,7 +50,7 @@ void IntelliShapedImage::calculateVisiblity(){
for(int x=0; x<imageData.width(); x++) {
QPoint ptr(x,y);
clr = imageData.pixelColor(x,y);
bool isInPolygon = IntelliTriangulation::isInPolygon(triangles, ptr);
bool isInPolygon = IntelliTriangulation::isInPolygon(triangles, ptr);
if(isInPolygon) {
clr.setAlpha(std::min(255, clr.alpha()));
}else{
@@ -59,16 +59,16 @@ void IntelliShapedImage::calculateVisiblity(){
imageData.setPixelColor(x,y,clr);
}
}
if(fastRenderer){
this->imageData = this->imageData.convertToFormat(QImage::Format_Indexed8);
}
if(fastRenderer) {
this->imageData = this->imageData.convertToFormat(QImage::Format_Indexed8);
}
}
QImage IntelliShapedImage::getDisplayable(const QSize& displaySize, int alpha){
QImage copy = imageData;
if(fastRenderer){
copy = copy.convertToFormat(QImage::Format_ARGB32);
}
if(fastRenderer) {
copy = copy.convertToFormat(QImage::Format_ARGB32);
}
for(int y = 0; y<copy.height(); y++) {
for(int x = 0; x<copy.width(); x++) {
QColor clr = copy.pixelColor(x,y);
@@ -76,9 +76,9 @@ QImage IntelliShapedImage::getDisplayable(const QSize& displaySize, int alpha){
copy.setPixelColor(x,y, clr);
}
}
if(fastRenderer){
copy = copy.convertToFormat(QImage::Format_Indexed8);
}
if(fastRenderer) {
copy = copy.convertToFormat(QImage::Format_Indexed8);
}
return copy.scaled(displaySize,Qt::IgnoreAspectRatio);
}
@@ -90,7 +90,7 @@ void IntelliShapedImage::setPolygon(const std::vector<QPoint>& polygonData){
for(auto element:polygonData) {
this->polygonData.push_back(QPoint(element.x(), element.y()));
}
triangles = IntelliTriangulation::calculateTriangles(polygonData);
triangles = IntelliTriangulation::calculateTriangles(polygonData);
}
calculateVisiblity();
return;