mirror of
https://github.com/creyD/intelliphoto.git
synced 2026-04-16 21:30:31 +02:00
Uncrustify all .cpp files
This commit is contained in:
@@ -4,11 +4,11 @@
|
|||||||
|
|
||||||
IntelliImage::IntelliImage(int width, int height, bool fastRendererOn)
|
IntelliImage::IntelliImage(int width, int height, bool fastRendererOn)
|
||||||
: imageData(QSize(width, height), fastRendererOn ? QImage::Format_Indexed8 : QImage::Format_ARGB32){
|
: imageData(QSize(width, height), fastRendererOn ? QImage::Format_Indexed8 : QImage::Format_ARGB32){
|
||||||
if(fastRendererOn){
|
if(fastRendererOn) {
|
||||||
imageData = imageData.convertToFormat(QImage::Format_ARGB32);
|
imageData = imageData.convertToFormat(QImage::Format_ARGB32);
|
||||||
}
|
}
|
||||||
imageData.fill(QColor(255,255,255,255));
|
imageData.fill(QColor(255,255,255,255));
|
||||||
if(fastRendererOn){
|
if(fastRendererOn) {
|
||||||
imageData = imageData.convertToFormat(QImage::Format_Indexed8);
|
imageData = imageData.convertToFormat(QImage::Format_Indexed8);
|
||||||
}
|
}
|
||||||
this->fastRenderer = fastRendererOn;
|
this->fastRenderer = fastRendererOn;
|
||||||
@@ -47,13 +47,13 @@ void IntelliImage::resizeImage(QImage*image, const QSize &newSize){
|
|||||||
QPainter painter(&newImage);
|
QPainter painter(&newImage);
|
||||||
painter.drawImage(QPoint(0, 0), *image);
|
painter.drawImage(QPoint(0, 0), *image);
|
||||||
*image = newImage;
|
*image = newImage;
|
||||||
if(fastRenderer){
|
if(fastRenderer) {
|
||||||
this->imageData = this->imageData.convertToFormat(QImage::Format_Indexed8);
|
this->imageData = this->imageData.convertToFormat(QImage::Format_Indexed8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void IntelliImage::drawPixel(const QPoint &p1, const QColor& color){
|
void IntelliImage::drawPixel(const QPoint &p1, const QColor& color){
|
||||||
if(fastRenderer){
|
if(fastRenderer) {
|
||||||
this->imageData = this->imageData.convertToFormat(QImage::Format_ARGB32);
|
this->imageData = this->imageData.convertToFormat(QImage::Format_ARGB32);
|
||||||
}
|
}
|
||||||
// Used to draw on the widget
|
// Used to draw on the widget
|
||||||
@@ -64,13 +64,13 @@ void IntelliImage::drawPixel(const QPoint &p1, const QColor& color){
|
|||||||
|
|
||||||
// Draw a line from the last registered point to the current
|
// Draw a line from the last registered point to the current
|
||||||
painter.drawPoint(p1);
|
painter.drawPoint(p1);
|
||||||
if(fastRenderer){
|
if(fastRenderer) {
|
||||||
this->imageData = this->imageData.convertToFormat(QImage::Format_Indexed8);
|
this->imageData = this->imageData.convertToFormat(QImage::Format_Indexed8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void IntelliImage::drawPoint(const QPoint &p1, const QColor& color, const int& penWidth){
|
void IntelliImage::drawPoint(const QPoint &p1, const QColor& color, const int& penWidth){
|
||||||
if(fastRenderer){
|
if(fastRenderer) {
|
||||||
this->imageData = this->imageData.convertToFormat(QImage::Format_ARGB32);
|
this->imageData = this->imageData.convertToFormat(QImage::Format_ARGB32);
|
||||||
}
|
}
|
||||||
// Used to draw on the widget
|
// Used to draw on the widget
|
||||||
@@ -80,13 +80,13 @@ void IntelliImage::drawPoint(const QPoint &p1, const QColor& color, const int& p
|
|||||||
painter.setPen(QPen(color, penWidth, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
painter.setPen(QPen(color, penWidth, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
||||||
// Draw a line from the last registered point to the current
|
// Draw a line from the last registered point to the current
|
||||||
painter.drawPoint(p1);
|
painter.drawPoint(p1);
|
||||||
if(fastRenderer){
|
if(fastRenderer) {
|
||||||
this->imageData = this->imageData.convertToFormat(QImage::Format_Indexed8);
|
this->imageData = this->imageData.convertToFormat(QImage::Format_Indexed8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void IntelliImage::drawLine(const QPoint &p1, const QPoint& p2, const QColor& color, const int& penWidth){
|
void IntelliImage::drawLine(const QPoint &p1, const QPoint& p2, const QColor& color, const int& penWidth){
|
||||||
if(fastRenderer){
|
if(fastRenderer) {
|
||||||
this->imageData = this->imageData.convertToFormat(QImage::Format_ARGB32);
|
this->imageData = this->imageData.convertToFormat(QImage::Format_ARGB32);
|
||||||
}
|
}
|
||||||
// Used to draw on the widget
|
// Used to draw on the widget
|
||||||
@@ -97,23 +97,23 @@ void IntelliImage::drawLine(const QPoint &p1, const QPoint& p2, const QColor& co
|
|||||||
|
|
||||||
// Draw a line from the last registered point to the current
|
// Draw a line from the last registered point to the current
|
||||||
painter.drawLine(p1, p2);
|
painter.drawLine(p1, p2);
|
||||||
if(fastRenderer){
|
if(fastRenderer) {
|
||||||
this->imageData = this->imageData.convertToFormat(QImage::Format_Indexed8);
|
this->imageData = this->imageData.convertToFormat(QImage::Format_Indexed8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void IntelliImage::drawPlain(const QColor& color){
|
void IntelliImage::drawPlain(const QColor& color){
|
||||||
if(fastRenderer){
|
if(fastRenderer) {
|
||||||
this->imageData = this->imageData.convertToFormat(QImage::Format_ARGB32);
|
this->imageData = this->imageData.convertToFormat(QImage::Format_ARGB32);
|
||||||
}
|
}
|
||||||
imageData.fill(color);
|
imageData.fill(color);
|
||||||
if(fastRenderer){
|
if(fastRenderer) {
|
||||||
this->imageData = this->imageData.convertToFormat(QImage::Format_Indexed8);
|
this->imageData = this->imageData.convertToFormat(QImage::Format_Indexed8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QColor IntelliImage::getPixelColor(QPoint& point){
|
QColor IntelliImage::getPixelColor(QPoint& point){
|
||||||
if(fastRenderer){
|
if(fastRenderer) {
|
||||||
QImage copy = this->imageData.convertToFormat(QImage::Format_ARGB32);
|
QImage copy = this->imageData.convertToFormat(QImage::Format_ARGB32);
|
||||||
return copy.pixelColor(point);
|
return copy.pixelColor(point);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ QImage IntelliRasterImage::getDisplayable(int alpha){
|
|||||||
|
|
||||||
QImage IntelliRasterImage::getDisplayable(const QSize& displaySize, int alpha){
|
QImage IntelliRasterImage::getDisplayable(const QSize& displaySize, int alpha){
|
||||||
QImage copy = imageData;
|
QImage copy = imageData;
|
||||||
if(fastRenderer){
|
if(fastRenderer) {
|
||||||
copy = copy.convertToFormat(QImage::Format_ARGB32);
|
copy = copy.convertToFormat(QImage::Format_ARGB32);
|
||||||
}
|
}
|
||||||
for(int y = 0; y<copy.height(); y++) {
|
for(int y = 0; y<copy.height(); y++) {
|
||||||
@@ -40,7 +40,7 @@ QImage IntelliRasterImage::getDisplayable(const QSize& displaySize, int alpha){
|
|||||||
copy.setPixelColor(x,y, clr);
|
copy.setPixelColor(x,y, clr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(fastRenderer){
|
if(fastRenderer) {
|
||||||
copy = copy.convertToFormat(QImage::Format_Indexed8);
|
copy = copy.convertToFormat(QImage::Format_Indexed8);
|
||||||
}
|
}
|
||||||
return copy.scaled(displaySize,Qt::IgnoreAspectRatio);
|
return copy.scaled(displaySize,Qt::IgnoreAspectRatio);
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ IntelliImage* IntelliShapedImage::getDeepCopy(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void IntelliShapedImage::calculateVisiblity(){
|
void IntelliShapedImage::calculateVisiblity(){
|
||||||
if(fastRenderer){
|
if(fastRenderer) {
|
||||||
this->imageData = imageData.convertToFormat(QImage::Format_ARGB32);
|
this->imageData = imageData.convertToFormat(QImage::Format_ARGB32);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@ void IntelliShapedImage::calculateVisiblity(){
|
|||||||
imageData.setPixelColor(x,y,clr);
|
imageData.setPixelColor(x,y,clr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(fastRenderer){
|
if(fastRenderer) {
|
||||||
this->imageData = this->imageData.convertToFormat(QImage::Format_Indexed8);
|
this->imageData = this->imageData.convertToFormat(QImage::Format_Indexed8);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@@ -59,14 +59,14 @@ void IntelliShapedImage::calculateVisiblity(){
|
|||||||
imageData.setPixelColor(x,y,clr);
|
imageData.setPixelColor(x,y,clr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(fastRenderer){
|
if(fastRenderer) {
|
||||||
this->imageData = this->imageData.convertToFormat(QImage::Format_Indexed8);
|
this->imageData = this->imageData.convertToFormat(QImage::Format_Indexed8);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QImage IntelliShapedImage::getDisplayable(const QSize& displaySize, int alpha){
|
QImage IntelliShapedImage::getDisplayable(const QSize& displaySize, int alpha){
|
||||||
QImage copy = imageData;
|
QImage copy = imageData;
|
||||||
if(fastRenderer){
|
if(fastRenderer) {
|
||||||
copy = copy.convertToFormat(QImage::Format_ARGB32);
|
copy = copy.convertToFormat(QImage::Format_ARGB32);
|
||||||
}
|
}
|
||||||
for(int y = 0; y<copy.height(); y++) {
|
for(int y = 0; y<copy.height(); y++) {
|
||||||
@@ -76,7 +76,7 @@ QImage IntelliShapedImage::getDisplayable(const QSize& displaySize, int alpha){
|
|||||||
copy.setPixelColor(x,y, clr);
|
copy.setPixelColor(x,y, clr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(fastRenderer){
|
if(fastRenderer) {
|
||||||
copy = copy.convertToFormat(QImage::Format_Indexed8);
|
copy = copy.convertToFormat(QImage::Format_Indexed8);
|
||||||
}
|
}
|
||||||
return copy.scaled(displaySize,Qt::IgnoreAspectRatio);
|
return copy.scaled(displaySize,Qt::IgnoreAspectRatio);
|
||||||
|
|||||||
@@ -158,8 +158,8 @@ void PaintingArea::movePositionActive(int x, int y){
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PaintingArea::moveActiveLayer(int idx){
|
void PaintingArea::moveActiveLayer(int idx){
|
||||||
if(Tool != nullptr){
|
if(Tool != nullptr) {
|
||||||
if(Tool->getIsDrawing()){
|
if(Tool->getIsDrawing()) {
|
||||||
IntelliTool* temp = copyActiveTool();
|
IntelliTool* temp = copyActiveTool();
|
||||||
delete this->Tool;
|
delete this->Tool;
|
||||||
this->Tool = temp;
|
this->Tool = temp;
|
||||||
|
|||||||
Reference in New Issue
Block a user