|
IntelliPhoto
0.5
|
The PaintingArea class manages the methods and stores information about the current painting area, which is the currently opened project. More...
#include <PaintingArea.h>


Public Slots | |
| void | slotActivateLayer (int a) |
| The slotActivateLayer method handles the event of selecting one layer as active. More... | |
| void | slotDeleteActiveLayer () |
| The slotDeleteActiveLayer method handles the deletion of the active layer. More... | |
Public Member Functions | |
| PaintingArea (int maxWidth=600, int maxHeight=600, QWidget *parent=nullptr) | |
| PaintingArea is the constructor of the PaintingArea class, which initiates the working environment. More... | |
| ~PaintingArea () override | |
| This deconstructor is used to clear up the memory and remove the currently active window. More... | |
| bool | open (const QString &fileName) |
| The open method is used for loading a picture into the current layer. More... | |
| bool | save (const QString &fileName, const char *fileFormat) |
| The save method is used for exporting the current project as one picture. More... | |
| int | addLayer (int width, int height, int widthOffset=0, int heightOffset=0, ImageType type=ImageType::Raster_Image) |
| The addLayer adds a layer to the current project/ painting area. More... | |
| int | addLayerAt (int idx, int width, int height, int widthOffset=0, int heightOffset=0, ImageType type=ImageType::Raster_Image) |
| The addLayerAt adds a layer to the current project/ painting area at a specific position in the layer stack. More... | |
| void | deleteLayer (int index) |
| The deleteLayer method removes a layer at a given index. More... | |
| void | setLayerToActive (int index) |
| The setLayerToActive method marks a specific layer as active. More... | |
| void | setAlphaOfLayer (int index, int alpha) |
| The setAlphaOfLayer method sets the alpha value of a specific layer. More... | |
| void | floodFill (int r, int g, int b, int a) |
| The floodFill method fills a the active layer with a given color. More... | |
| void | movePositionActive (int x, int y) |
| The movePositionActive method moves the active layer to certain position. More... | |
| void | moveActiveLayer (int idx) |
| The moveActiveLayer moves the active layer to a specific position in the layer stack. More... | |
| void | colorPickerSetFirstColor () |
| The colorPickerSetFirstColor calls the QTColorPicker to determine the primary drawing color. More... | |
| void | colorPickerSetSecondColor () |
| The colorPickerSetSecondColor calls the QTColorPicker to determine the secondary drawing color. More... | |
| void | colorPickerSwitchColor () |
| The colorPickerSwitchColor swaps the primary color with the secondary drawing color. More... | |
| void | createPenTool () |
| void | createPlainTool () |
| void | createLineTool () |
| void | createRectangleTool () |
| void | createCircleTool () |
| void | createPolygonTool () |
| void | createFloodFillTool () |
| int | getWidthOfActive () |
| The getWidthOfActive gets the horizontal dimensions of the active layer. More... | |
| int | getHeightOfActive () |
| The getHeightOfActive gets the vertical dimensions of the active layer. More... | |
Protected Member Functions | |
| void | mousePressEvent (QMouseEvent *event) override |
| void | mouseMoveEvent (QMouseEvent *event) override |
| void | mouseReleaseEvent (QMouseEvent *event) override |
| void | wheelEvent (QWheelEvent *event) override |
| void | paintEvent (QPaintEvent *event) override |
| void | resizeEvent (QResizeEvent *event) override |
The PaintingArea class manages the methods and stores information about the current painting area, which is the currently opened project.
Definition at line 36 of file PaintingArea.h.
| PaintingArea::PaintingArea | ( | int | maxWidth = 600, |
| int | maxHeight = 600, |
||
| QWidget * | parent = nullptr |
||
| ) |
PaintingArea is the constructor of the PaintingArea class, which initiates the working environment.
| maxWidth | - The maximum amount of pixles that are inside painting area from left to right (default=600px) |
| maxHeight | - The maximum amount of pixles that are inside painting area from top to bottom (default=600px) |
| parent | - The parent window of the main window (default=nullptr) |
Definition at line 21 of file PaintingArea.cpp.

|
override |
This deconstructor is used to clear up the memory and remove the currently active window.
Definition at line 41 of file PaintingArea.cpp.
| int PaintingArea::addLayer | ( | int | width, |
| int | height, | ||
| int | widthOffset = 0, |
||
| int | heightOffset = 0, |
||
| ImageType | type = ImageType::Raster_Image |
||
| ) |
The addLayer adds a layer to the current project/ painting area.
| width | - Width of the layer in pixles |
| height | - Height of the layer in pixles |
| widthOffset | - Offset of the layer measured to the left border of the painting area in pixles |
| heightOffset | - Offset of the layer measured to the top border of the painting area in pixles |
| type | - Defining the ImageType of the new layer |
Definition at line 56 of file PaintingArea.cpp.

| int PaintingArea::addLayerAt | ( | int | idx, |
| int | width, | ||
| int | height, | ||
| int | widthOffset = 0, |
||
| int | heightOffset = 0, |
||
| ImageType | type = ImageType::Raster_Image |
||
| ) |
The addLayerAt adds a layer to the current project/ painting area at a specific position in the layer stack.
| idx | - ID of the position the new layer should be added |
| width | - Width of the layer in pixles |
| height | - Height of the layer in pixles |
| widthOffset | - Offset of the layer measured to the left border of the painting area in pixles |
| heightOffset | - Offset of the layer measured to the top border of the painting area in pixles |
| type | - Defining the ImageType of the new layer |
| void PaintingArea::colorPickerSetFirstColor | ( | ) |
The colorPickerSetFirstColor calls the QTColorPicker to determine the primary drawing color.
Definition at line 166 of file PaintingArea.cpp.

| void PaintingArea::colorPickerSetSecondColor | ( | ) |
The colorPickerSetSecondColor calls the QTColorPicker to determine the secondary drawing color.
Definition at line 171 of file PaintingArea.cpp.

| void PaintingArea::colorPickerSwitchColor | ( | ) |
The colorPickerSwitchColor swaps the primary color with the secondary drawing color.
Definition at line 176 of file PaintingArea.cpp.

| void PaintingArea::createCircleTool | ( | ) |
Definition at line 200 of file PaintingArea.cpp.
| void PaintingArea::createFloodFillTool | ( | ) |
Definition at line 209 of file PaintingArea.cpp.
| void PaintingArea::createLineTool | ( | ) |
Definition at line 190 of file PaintingArea.cpp.
| void PaintingArea::createPenTool | ( | ) |
Definition at line 180 of file PaintingArea.cpp.
| void PaintingArea::createPlainTool | ( | ) |
Definition at line 185 of file PaintingArea.cpp.
| void PaintingArea::createPolygonTool | ( | ) |
Definition at line 204 of file PaintingArea.cpp.
| void PaintingArea::createRectangleTool | ( | ) |
Definition at line 195 of file PaintingArea.cpp.
| void PaintingArea::deleteLayer | ( | int | index | ) |
The deleteLayer method removes a layer at a given index.
| index | - The index of the layer to be removed |
Definition at line 73 of file PaintingArea.cpp.
| void PaintingArea::floodFill | ( | int | r, |
| int | g, | ||
| int | b, | ||
| int | a | ||
| ) |
The floodFill method fills a the active layer with a given color.
| r | - Red value of the color the layer should be filled with |
| g | - Green value of the color the layer should be filled with |
| b | - Blue value of the color the layer should be filled with |
| a | - Alpha value of the color the layer should be filled with |
Definition at line 138 of file PaintingArea.cpp.

| int PaintingArea::getHeightOfActive | ( | ) |
The getHeightOfActive gets the vertical dimensions of the active layer.
Definition at line 218 of file PaintingArea.cpp.
| int PaintingArea::getWidthOfActive | ( | ) |
The getWidthOfActive gets the horizontal dimensions of the active layer.
Definition at line 214 of file PaintingArea.cpp.
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
| void PaintingArea::moveActiveLayer | ( | int | idx | ) |
The moveActiveLayer moves the active layer to a specific position in the layer stack.
| idx | - The id of the new position the layer should be in |
Definition at line 152 of file PaintingArea.cpp.
| void PaintingArea::movePositionActive | ( | int | x, |
| int | y | ||
| ) |
The movePositionActive method moves the active layer to certain position.
| x | - The x value the new center of the layer should be at |
| y | - The y value the new center of the layer should be at |
Definition at line 147 of file PaintingArea.cpp.
| bool PaintingArea::open | ( | const QString & | fileName | ) |
The open method is used for loading a picture into the current layer.
| fileName | - Path and filename which are used to determine where the to-be-opened file is stored |
Definition at line 102 of file PaintingArea.cpp.

|
overrideprotected |
Definition at line 275 of file PaintingArea.cpp.
|
overrideprotected |
Definition at line 286 of file PaintingArea.cpp.
| bool PaintingArea::save | ( | const QString & | fileName, |
| const char * | fileFormat | ||
| ) |
The save method is used for exporting the current project as one picture.
| fileName | |
| fileFormat |
Definition at line 114 of file PaintingArea.cpp.
| void PaintingArea::setAlphaOfLayer | ( | int | index, |
| int | alpha | ||
| ) |
The setAlphaOfLayer method sets the alpha value of a specific layer.
| index | - Index of the layer where the change should be applied |
| alpha | - New alpha value of the layer |
Definition at line 95 of file PaintingArea.cpp.
| void PaintingArea::setLayerToActive | ( | int | index | ) |
The setLayerToActive method marks a specific layer as active.
| index | - Index of the layer to be active |
Definition at line 89 of file PaintingArea.cpp.

|
slot |
The slotActivateLayer method handles the event of selecting one layer as active.
| a | - Index of the layer to be active |
Definition at line 160 of file PaintingArea.cpp.

|
slot |
The slotDeleteActiveLayer method handles the deletion of the active layer.
Definition at line 82 of file PaintingArea.cpp.
|
overrideprotected |