Uncrustifyed Status

This commit is contained in:
2020-01-13 19:37:22 +01:00
parent 7491472962
commit cc56f61247
14 changed files with 577 additions and 577 deletions

View File

@@ -43,12 +43,12 @@ PaintingArea::~PaintingArea(){
}
void PaintingArea::setRenderSettings(bool isFastRenderingOn){
if(isFastRenderingOn != renderSettings.isFastRenderering()){
renderSettings.setFastRendering(isFastRenderingOn);
for(auto& layer : layerBundle){
layer.image->updateRendererSetting(isFastRenderingOn);
}
}
if(isFastRenderingOn != renderSettings.isFastRenderering()) {
renderSettings.setFastRendering(isFastRenderingOn);
for(auto& layer : layerBundle) {
layer.image->updateRendererSetting(isFastRenderingOn);
}
}
}
void PaintingArea::setLayerDimensions(int maxWidth, int maxHeight){
@@ -68,10 +68,10 @@ int PaintingArea::addLayer(int width, int height, int widthOffset, int heightOff
newLayer.height = height;
newLayer.widthOffset = widthOffset;
newLayer.heightOffset = heightOffset;
if(type==IntelliImage::ImageType::RASTERIMAGE) {
newLayer.image = new IntelliRasterImage(width,height,renderSettings.isFastRenderering());
}else if(type==IntelliImage::ImageType::SHAPEDIMAGE) {
newLayer.image = new IntelliShapedImage(width, height, renderSettings.isFastRenderering());
if(type==IntelliImage::ImageType::RASTERIMAGE) {
newLayer.image = new IntelliRasterImage(width,height,renderSettings.isFastRenderering());
}else if(type==IntelliImage::ImageType::SHAPEDIMAGE) {
newLayer.image = new IntelliShapedImage(width, height, renderSettings.isFastRenderering());
}
newLayer.alpha = 255;
this->layerBundle.push_back(newLayer);
@@ -83,12 +83,12 @@ int PaintingArea::addLayer(int width, int height, int widthOffset, int heightOff
void PaintingArea::deleteLayer(int idx){
if(idx<static_cast<int>(layerBundle.size())) {
this->layerBundle.erase(layerBundle.begin()+idx);
if(activeLayer>=idx) {
if(activeLayer>=idx) {
activeLayer--;
}
if(activeLayer < 0 && layerBundle.size()){
activeLayer=0;
}
if(activeLayer < 0 && layerBundle.size()) {
activeLayer=0;
}
}
}
@@ -265,9 +265,9 @@ std::vector<QPoint> PaintingArea::getPolygonDataOfRealLayer(){
// left button and if so store the current position
// Set that we are currently drawing
void PaintingArea::mousePressEvent(QMouseEvent*event){
if(this->activeLayer < 0){
return;
}
if(this->activeLayer < 0) {
return;
}
if(Tool == nullptr)
return;
int x = event->x()-layerBundle[static_cast<unsigned long long>(activeLayer)].widthOffset;
@@ -284,9 +284,9 @@ void PaintingArea::mousePressEvent(QMouseEvent*event){
// we call the drawline function which draws a line
// from the last position to the current
void PaintingArea::mouseMoveEvent(QMouseEvent*event){
if(this->activeLayer < 0){
return;
}
if(this->activeLayer < 0) {
return;
}
if(Tool == nullptr)
return;
int x = event->x()-layerBundle[static_cast<unsigned long long>(activeLayer)].widthOffset;
@@ -297,9 +297,9 @@ void PaintingArea::mouseMoveEvent(QMouseEvent*event){
// If the button is released we set variables to stop drawing
void PaintingArea::mouseReleaseEvent(QMouseEvent*event){
if(this->activeLayer < 0)
return;
if(Tool == nullptr)
if(this->activeLayer < 0)
return;
if(Tool == nullptr)
return;
int x = event->x()-layerBundle[static_cast<unsigned long long>(activeLayer)].widthOffset;
int y = event->y()-layerBundle[static_cast<unsigned long long>(activeLayer)].heightOffset;
@@ -312,9 +312,9 @@ void PaintingArea::mouseReleaseEvent(QMouseEvent*event){
}
void PaintingArea::wheelEvent(QWheelEvent*event){
if(this->activeLayer < 0)
return;
if(this->Tool != nullptr) {
if(this->activeLayer < 0)
return;
if(this->Tool != nullptr) {
QPoint numDegrees = event->angleDelta() / 8;
if(!numDegrees.isNull()) {
QPoint numSteps = numDegrees / 15;
@@ -405,9 +405,9 @@ bool PaintingArea::createTempTopLayer(int idx){
newLayer.widthOffset = layerBundle[static_cast<unsigned long long>(idx)].widthOffset;
newLayer.image = layerBundle[static_cast<unsigned long long>(idx)].image->getDeepCopy();
layerBundle.insert(layerBundle.begin()+idx+1,newLayer);
return true;
return true;
}
return false;
return false;
}
IntelliTool* PaintingArea::copyActiveTool(){
@@ -428,8 +428,8 @@ int PaintingArea::getNumberOfActiveLayer(){
}
IntelliImage* PaintingArea::getImageOfActiveLayer(){
if(activeLayer<0){
return nullptr;
}
if(activeLayer<0) {
return nullptr;
}
return layerBundle[activeLayer].image;
}

View File

@@ -43,142 +43,142 @@ Q_OBJECT
friend IntelliTool;
friend IntelliPhotoGui;
public:
/*!
* \brief PaintingArea is the constructor of the PaintingArea class, which initiates the working environment
* \param maxWidth - The maximum amount of pixles that are inside painting area from left to right (default=600px)
* \param maxHeight - The maximum amount of pixles that are inside painting area from top to bottom (default=600px)
* \param parent - The parent window of the main window (default=nullptr)
*/
PaintingArea(int maxWidth=600, int maxHeight=600, QWidget *parent = nullptr);
/*!
* \brief PaintingArea is the constructor of the PaintingArea class, which initiates the working environment
* \param maxWidth - The maximum amount of pixles that are inside painting area from left to right (default=600px)
* \param maxHeight - The maximum amount of pixles that are inside painting area from top to bottom (default=600px)
* \param parent - The parent window of the main window (default=nullptr)
*/
PaintingArea(int maxWidth=600, int maxHeight=600, QWidget*parent = nullptr);
/*!
* \brief This deconstructor is used to clear up the memory and remove the currently active window
*/
~PaintingArea() override;
/*!
* \brief This deconstructor is used to clear up the memory and remove the currently active window
*/
~PaintingArea() override;
// Handles all events
// Handles all events
/*!
* \brief setRenderSettings updates all Images to the new Rendersetting.
* \param isFastRenderingOn is the new given flag for the FastRenderer.
*/
void setRenderSettings(bool isFastRenderingOn);
/*!
* \brief setRenderSettings updates all Images to the new Rendersetting.
* \param isFastRenderingOn is the new given flag for the FastRenderer.
*/
void setRenderSettings(bool isFastRenderingOn);
/*!
* \brief The open method is used for loading a picture into the current layer
* \param fileName - Path and filename which are used to determine where the to-be-opened file is stored
* \return Returns a boolean variable whether the file was successfully opened or not
*/
bool open(const QString &filePath);
/*!
* \brief The save method is used for exporting the current project as one picture
* \param fileName
* \param fileFormat
* \return Returns a boolean variable, true if the file was saved successfully, false if not
*/
bool save(const QString &filePath, const char *fileFormat);
/*!
* \brief The open method is used for loading a picture into the current layer
* \param fileName - Path and filename which are used to determine where the to-be-opened file is stored
* \return Returns a boolean variable whether the file was successfully opened or not
*/
bool open(const QString &filePath);
/*!
* \brief The save method is used for exporting the current project as one picture
* \param fileName
* \param fileFormat
* \return Returns a boolean variable, true if the file was saved successfully, false if not
*/
bool save(const QString &filePath, const char*fileFormat);
/*!
* \brief The addLayer adds a layer to the current project/ painting area
* \param width - Width of the layer in pixles
* \param height - Height of the layer in pixles
* \param widthOffset - Offset of the layer measured to the left border of the painting area in pixles
* \param heightOffset - Offset of the layer measured to the top border of the painting area in pixles
* \param type - Defining the ImageType of the new layer
* \return Returns the number of layers in the project
*/
int addLayer(int width, int height, int widthOffset=0, int heightOffset=0, IntelliImage::ImageType type = IntelliImage::ImageType::RASTERIMAGE);
/*!
* \brief The addLayerAt adds a layer to the current project/ painting area at a specific position in the layer stack
* \param idx - Index of the position the new layer should be added
* \param width - Width of the layer in pixles
* \param height - Height of the layer in pixles
* \param widthOffset - Offset of the layer measured to the left border of the painting area in pixles
* \param heightOffset - Offset of the layer measured to the top border of the painting area in pixles
* \param type - Defining the ImageType of the new layer
* \return Returns the id of the layer position
*/
int addLayerAt(int idx, int width, int height, int widthOffset=0, int heightOffset=0, IntelliImage::ImageType type = IntelliImage::ImageType::RASTERIMAGE);
/*!
* \brief The deleteLayer method removes a layer at a given idx
* \param idx - The index of the layer to be removed
*/
void deleteLayer(int idx);
/*!
* \brief The setLayerToActive method marks a specific layer as active
* \param idx - The index of the layer to be active
*/
void setLayerActive(int idx);
/*!
* \brief The setAlphaOfLayer method sets the alpha value of a specific layer
* \param idx - The index of the layer where the change should be applied
* \param alpha - New alpha value of the layer
*/
void setLayerAlpha(int idx, int alpha);
/*!
* \brief The floodFill method fills a the active layer with a given color
* \param r - Red value of the color the layer should be filled with
* \param g - Green value of the color the layer should be filled with
* \param b - Blue value of the color the layer should be filled with
* \param a - Alpha value of the color the layer should be filled with
*/
void floodFill(int r, int g, int b, int a);
/*!
* \brief The movePositionActive method moves the active layer to certain position
* \param x - The x value the new center of the layer should be at
* \param y - The y value the new center of the layer should be at
*/
void movePositionActive(int x, int y);
/*!
* \brief The moveActiveLayer moves the active layer to a specific position in the layer stack
* \param idx - The index of the new position the layer should be in
*/
void moveActiveLayer(int idx);
/*!
* \brief The addLayer adds a layer to the current project/ painting area
* \param width - Width of the layer in pixles
* \param height - Height of the layer in pixles
* \param widthOffset - Offset of the layer measured to the left border of the painting area in pixles
* \param heightOffset - Offset of the layer measured to the top border of the painting area in pixles
* \param type - Defining the ImageType of the new layer
* \return Returns the number of layers in the project
*/
int addLayer(int width, int height, int widthOffset=0, int heightOffset=0, IntelliImage::ImageType type = IntelliImage::ImageType::RASTERIMAGE);
/*!
* \brief The addLayerAt adds a layer to the current project/ painting area at a specific position in the layer stack
* \param idx - Index of the position the new layer should be added
* \param width - Width of the layer in pixles
* \param height - Height of the layer in pixles
* \param widthOffset - Offset of the layer measured to the left border of the painting area in pixles
* \param heightOffset - Offset of the layer measured to the top border of the painting area in pixles
* \param type - Defining the ImageType of the new layer
* \return Returns the id of the layer position
*/
int addLayerAt(int idx, int width, int height, int widthOffset=0, int heightOffset=0, IntelliImage::ImageType type = IntelliImage::ImageType::RASTERIMAGE);
/*!
* \brief The deleteLayer method removes a layer at a given idx
* \param idx - The index of the layer to be removed
*/
void deleteLayer(int idx);
/*!
* \brief The setLayerToActive method marks a specific layer as active
* \param idx - The index of the layer to be active
*/
void setLayerActive(int idx);
/*!
* \brief The setAlphaOfLayer method sets the alpha value of a specific layer
* \param idx - The index of the layer where the change should be applied
* \param alpha - New alpha value of the layer
*/
void setLayerAlpha(int idx, int alpha);
/*!
* \brief The floodFill method fills a the active layer with a given color
* \param r - Red value of the color the layer should be filled with
* \param g - Green value of the color the layer should be filled with
* \param b - Blue value of the color the layer should be filled with
* \param a - Alpha value of the color the layer should be filled with
*/
void floodFill(int r, int g, int b, int a);
/*!
* \brief The movePositionActive method moves the active layer to certain position
* \param x - The x value the new center of the layer should be at
* \param y - The y value the new center of the layer should be at
*/
void movePositionActive(int x, int y);
/*!
* \brief The moveActiveLayer moves the active layer to a specific position in the layer stack
* \param idx - The index of the new position the layer should be in
*/
void moveActiveLayer(int idx);
//change properties of colorPicker
/*!
* \brief The colorPickerSetFirstColor calls the QTColorPicker to determine the primary drawing color
*/
void colorPickerSetFirstColor();
/*!
* \brief The colorPickerSetSecondColor calls the QTColorPicker to determine the secondary drawing color
*/
void colorPickerSetSecondColor();
/*!
* \brief The colorPickerSwitchColor swaps the primary color with the secondary drawing color
*/
void colorPickerSwapColors();
//change properties of colorPicker
/*!
* \brief The colorPickerSetFirstColor calls the QTColorPicker to determine the primary drawing color
*/
void colorPickerSetFirstColor();
/*!
* \brief The colorPickerSetSecondColor calls the QTColorPicker to determine the secondary drawing color
*/
void colorPickerSetSecondColor();
/*!
* \brief The colorPickerSwitchColor swaps the primary color with the secondary drawing color
*/
void colorPickerSwapColors();
// Create tools
void createPenTool();
void createPlainTool();
void createLineTool();
void createRectangleTool();
void createCircleTool();
void createPolygonTool();
void createFloodFillTool();
// Create tools
void createPenTool();
void createPlainTool();
void createLineTool();
void createRectangleTool();
void createCircleTool();
void createPolygonTool();
void createFloodFillTool();
/*!
* \brief The getWidthOfActive gets the horizontal dimensions of the active layer
* \return Returns the horizontal pixle count of the active layer
*/
int getWidthOfActive();
/*!
* \brief The getHeightOfActive gets the vertical dimensions of the active layer
* \return Returns the vertical pixle count of the active layer
*/
int getHeightOfActive();
/*!
* \brief The getWidthOfActive gets the horizontal dimensions of the active layer
* \return Returns the horizontal pixle count of the active layer
*/
int getWidthOfActive();
/*!
* \brief The getHeightOfActive gets the vertical dimensions of the active layer
* \return Returns the vertical pixle count of the active layer
*/
int getHeightOfActive();
IntelliImage::ImageType getTypeOfImageRealLayer();
IntelliImage::ImageType getTypeOfImageRealLayer();
std::vector<QPoint> getPolygonDataOfRealLayer();
std::vector<QPoint> getPolygonDataOfRealLayer();
int getNumberOfActiveLayer();
int getNumberOfActiveLayer();
IntelliImage* getImageOfActiveLayer();
IntelliImage* getImageOfActiveLayer();
IntelliToolsettings Toolsettings;
IntelliColorPicker colorPicker;
IntelliToolsettings Toolsettings;
IntelliColorPicker colorPicker;
public slots:
// Events to handle
@@ -226,8 +226,8 @@ void drawLayers(bool forSaving=false);
void resizeLayer(QImage*image_res, const QSize &newSize);
// Helper for Tool
bool createTempTopLayer(int idx);
// Helper for Tool
bool createTempTopLayer(int idx);
};
#endif