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

@@ -3,15 +3,15 @@
#include <QPainter>
IntelliImage::IntelliImage(int width, int height, bool fastRendererOn)
: imageData(QSize(width, height), fastRendererOn ? QImage::Format_Indexed8 : QImage::Format_ARGB32){
if(fastRendererOn){
imageData = imageData.convertToFormat(QImage::Format_ARGB32);
}
imageData.fill(QColor(255,255,255,255));
if(fastRendererOn){
imageData = imageData.convertToFormat(QImage::Format_Indexed8);
}
this->fastRenderer = fastRendererOn;
: imageData(QSize(width, height), fastRendererOn ? QImage::Format_Indexed8 : QImage::Format_ARGB32){
if(fastRendererOn) {
imageData = imageData.convertToFormat(QImage::Format_ARGB32);
}
imageData.fill(QColor(255,255,255,255));
if(fastRendererOn) {
imageData = imageData.convertToFormat(QImage::Format_Indexed8);
}
this->fastRenderer = fastRendererOn;
}
@@ -30,7 +30,7 @@ bool IntelliImage::loadImage(const QString &filePath){
// scaled Image to size of Layer
loadedImage = loadedImage.scaled(imageData.size(),Qt::IgnoreAspectRatio);
imageData = loadedImage.convertToFormat(fastRenderer ? QImage::Format_Indexed8 : QImage::Format_ARGB32);
imageData = loadedImage.convertToFormat(fastRenderer ? QImage::Format_Indexed8 : QImage::Format_ARGB32);
return true;
}
@@ -40,23 +40,23 @@ void IntelliImage::resizeImage(QImage*image, const QSize &newSize){
return;
// Create a new image to display and fill it with white
QImage newImage(newSize, QImage::Format_ARGB32);
QImage newImage(newSize, QImage::Format_ARGB32);
newImage.fill(qRgb(255, 255, 255));
// Draw the image
QPainter painter(&newImage);
painter.drawImage(QPoint(0, 0), *image);
*image = newImage;
if(fastRenderer){
this->imageData = this->imageData.convertToFormat(QImage::Format_Indexed8);
}
if(fastRenderer) {
this->imageData = this->imageData.convertToFormat(QImage::Format_Indexed8);
}
}
void IntelliImage::drawPixel(const QPoint &p1, const QColor& color){
if(fastRenderer){
this->imageData = this->imageData.convertToFormat(QImage::Format_ARGB32);
}
// Used to draw on the widget
if(fastRenderer) {
this->imageData = this->imageData.convertToFormat(QImage::Format_ARGB32);
}
// Used to draw on the widget
QPainter painter(&imageData);
// Set the current settings for the pen
@@ -64,32 +64,32 @@ void IntelliImage::drawPixel(const QPoint &p1, const QColor& color){
// Draw a line from the last registered point to the current
painter.drawPoint(p1);
if(fastRenderer){
this->imageData = this->imageData.convertToFormat(QImage::Format_Indexed8);
}
if(fastRenderer) {
this->imageData = this->imageData.convertToFormat(QImage::Format_Indexed8);
}
}
void IntelliImage::drawPoint(const QPoint &p1, const QColor& color, const int& penWidth){
if(fastRenderer){
this->imageData = this->imageData.convertToFormat(QImage::Format_ARGB32);
}
// Used to draw on the widget
if(fastRenderer) {
this->imageData = this->imageData.convertToFormat(QImage::Format_ARGB32);
}
// Used to draw on the widget
QPainter painter(&imageData);
// Set the current settings for the pen
painter.setPen(QPen(color, penWidth, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
// Draw a line from the last registered point to the current
painter.drawPoint(p1);
if(fastRenderer){
this->imageData = this->imageData.convertToFormat(QImage::Format_Indexed8);
}
if(fastRenderer) {
this->imageData = this->imageData.convertToFormat(QImage::Format_Indexed8);
}
}
void IntelliImage::drawLine(const QPoint &p1, const QPoint& p2, const QColor& color, const int& penWidth){
if(fastRenderer){
this->imageData = this->imageData.convertToFormat(QImage::Format_ARGB32);
}
// Used to draw on the widget
if(fastRenderer) {
this->imageData = this->imageData.convertToFormat(QImage::Format_ARGB32);
}
// Used to draw on the widget
QPainter painter(&imageData);
// Set the current settings for the pen
@@ -97,34 +97,34 @@ void IntelliImage::drawLine(const QPoint &p1, const QPoint& p2, const QColor& co
// Draw a line from the last registered point to the current
painter.drawLine(p1, p2);
if(fastRenderer){
this->imageData = this->imageData.convertToFormat(QImage::Format_Indexed8);
}
if(fastRenderer) {
this->imageData = this->imageData.convertToFormat(QImage::Format_Indexed8);
}
}
void IntelliImage::drawPlain(const QColor& color){
if(fastRenderer){
this->imageData = this->imageData.convertToFormat(QImage::Format_ARGB32);
}
imageData.fill(color);
if(fastRenderer){
this->imageData = this->imageData.convertToFormat(QImage::Format_Indexed8);
}
if(fastRenderer) {
this->imageData = this->imageData.convertToFormat(QImage::Format_ARGB32);
}
imageData.fill(color);
if(fastRenderer) {
this->imageData = this->imageData.convertToFormat(QImage::Format_Indexed8);
}
}
QColor IntelliImage::getPixelColor(QPoint& point){
if(fastRenderer){
QImage copy = this->imageData.convertToFormat(QImage::Format_ARGB32);
return copy.pixelColor(point);
}
return imageData.pixelColor(point);
if(fastRenderer) {
QImage copy = this->imageData.convertToFormat(QImage::Format_ARGB32);
return copy.pixelColor(point);
}
return imageData.pixelColor(point);
}
QImage IntelliImage::getImageData(){
return this->imageData;
return this->imageData;
}
void IntelliImage::updateRendererSetting(bool fastRendererOn){
this->fastRenderer = fastRendererOn;
this->imageData = this->imageData.convertToFormat(fastRenderer ? QImage::Format_Indexed8 : QImage::Format_ARGB32);
this->fastRenderer = fastRendererOn;
this->imageData = this->imageData.convertToFormat(fastRenderer ? QImage::Format_Indexed8 : QImage::Format_ARGB32);
}