Refractoring Update 1

- Refractored switchColor to slotSwapColor
- Corrected spelling mistake in variable name (weight-->width)
- Unified variable names
This commit is contained in:
2019-12-20 09:50:30 +01:00
parent ab8590c4fe
commit 52292ebfe7
10 changed files with 109 additions and 44 deletions

View File

@@ -61,14 +61,14 @@ public:
* \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 &fileName);
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 &fileName, const char *fileFormat);
bool save(const QString &filePath, const char *fileFormat);
/*!
* \brief The addLayer adds a layer to the current project/ painting area
@@ -90,7 +90,7 @@ public:
* \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, ImageType type = ImageType::Raster_Image);
int addLayerAt(int width, int height, int widthOffset=0, int heightOffset=0, ImageType type = ImageType::Raster_Image, int idx);
/*!
* \brief The deleteLayer method removes a layer at a given index
* \param index - The index of the layer to be removed
@@ -139,7 +139,7 @@ public:
/*!
* \brief The colorPickerSwitchColor swaps the primary color with the secondary drawing color
*/
void colorPickerSwitchColor();
void colorPickerSwapColors();
// Create tools
void createPenTool();
@@ -187,9 +187,9 @@ protected:
void resizeEvent(QResizeEvent *event) override;
private:
void setUp(int maxWidth, int maxHeight);
void activateUpperLayer();
void activateLowerLayer();
void setLayerDimensions(int maxWidth, int maxHeight);
void selectLayerUp();
void selectLayerDown();
QImage* Canvas;
int maxWidth;
@@ -201,12 +201,13 @@ private:
std::vector<LayerObject> layerBundle;
int activeLayer=-1;
void assembleLayers(bool forSaving=false);
void drawLayers(bool forSaving=false);
void resizeImage(QImage *image_res, const QSize &newSize);
void resizeLayer(QImage *image_res, const QSize &newSize);
// Helper for Tool
void createTempLayerAfter(int idx);
// TODO: Always create this layer on top and return the id here!
void createTempTopLayer(int idx);
};
#endif