|
IntelliPhoto
1
|
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... | |
| void | setRenderSettings (bool isFastRenderingOn) |
| setRenderSettings updates all Images to the new Rendersetting. More... | |
| bool | getRenderSettings () |
| getRenderSettings updates all Images to the new Rendersetting. More... | |
| bool | open (const QString &filePath) |
| The open method is used for loading a picture into the current layer. More... | |
| bool | save (const QString &filePath, const char *fileFormat) |
| The save method is used for exporting the current project as one picture. More... | |
| void | deleteAllLayers () |
| deleteAllLayers deletes all layers More... | |
| int | addLayer (int width, int height, int widthOffset=0, int heightOffset=0, int alpha=255, ImageType type=ImageType::RASTERIMAGE) |
| 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::RASTERIMAGE) |
| The addLayerAt adds a layer to the current project/ painting area at a specific position in the layer stack. More... | |
| void | deleteLayer (int idx, bool isTool=false) |
| The deleteLayer method removes a layer at a given idx. More... | |
| void | setLayerActive (int idx) |
| The setLayerToActive method marks a specific layer as active. More... | |
| void | setLayerAlpha (int idx, int alpha) |
| The setAlphaOfLayer method sets the alpha value of a specific layer. More... | |
| void | setPolygon (int idx) |
| setPolygon is used for setting polygondata, it only works on RASTER images 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 | colorPickerSwapColors () |
| The colorPickerSwitchColor swaps the primary color with the secondary drawing color. More... | |
| void | createPenTool () |
| createPenTool creates a Pen Tool. More... | |
| void | createPlainTool () |
| createPlainTool creates a Plain Tool. More... | |
| void | createLineTool () |
| createLineTool creates a Line Tool. More... | |
| void | createRectangleTool () |
| createRectangleTool creates a Rectangle Tool. More... | |
| void | createCircleTool () |
| createCircleTool creates a Circle Tool. More... | |
| void | createPolygonTool () |
| createPolygonTool creates a Polygon Tool. More... | |
| void | createFloodFillTool () |
| createFloodFillTool creates a Floodfill Tool. More... | |
| void | createGradientTool () |
| createGradientTool creates a Gradient Tool. More... | |
| 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... | |
| int | getMaxWidth () |
| getMaxWidth gets the max width of the Canvas. More... | |
| int | getMaxHeight () |
| getMaxHeight gets the max height of the Canvas. More... | |
| ImageType | getTypeOfImageActiveLayer () |
| getTypeOfImageActiveLayer get the type of the active Layer. More... | |
| std::vector< QPoint > | getPolygonDataOfActiveLayer () |
| getPolygonDataOfActiveLayer get the polygon data of the active Layer. More... | |
| int | getIndexOfActiveLayer () |
| getIndexOfActiveLayer returns the index of athe active Layer. More... | |
| IntelliImage * | getImageOfActiveLayer () |
| getImageOfActiveLayer returns the image of the active Layer. More... | |
| QImage | getImageDataOfActiveLayer () |
| getImageDataOfActiveLayer used to get the currents active imageData (if there isn't any active layer it return a 10*10 white picture) More... | |
| std::vector< LayerObject > * | getLayerBundle () |
| getLayerBundle returns the real active layerbundle (care!) More... | |
| void | historyadd () |
| historyadd adds an hisotry step More... | |
| void | historyGoBack () |
| historyGoBack go back in hisotry More... | |
| void | historyGoForward () |
| historyGoForward a function to undo the return of the previous state of the project. More... | |
| void | setCanvasDimensions (int maxWidth, int maxHeight) |
| setCanvasDimensions sets the dimension of the Canvas More... | |
| void | drawPixelOntoActive (QColor color, QPoint point) |
| drawPixelOntoActive draws a pixel onto the image data of the active Layer. More... | |
| void | setPolygonDataToActive (std::vector< QPoint > points) |
| setPolygonDataToActive sets polygondata to the active Layer. More... | |
Public Attributes | |
| IntelliToolsettings | Toolsettings |
| Toolsettings - a class to manage Tool settings. More... | |
| IntelliColorPicker | colorPicker |
| colorPicker a class to manage Tool color. More... | |
Protected Member Functions | |
| void | mousePressEvent (QMouseEvent *event) override |
| mousePressEvent handles a mouse pressed event. More... | |
| void | mouseMoveEvent (QMouseEvent *event) override |
| mouseMoveEvent handles a mouse moved event More... | |
| void | mouseReleaseEvent (QMouseEvent *event) override |
| mouseReleaseEvent handles a mouse released event More... | |
| void | wheelEvent (QWheelEvent *event) override |
| wheelEvent handles a mouse wheel event More... | |
| void | paintEvent (QPaintEvent *event) override |
| paintEvent handles a painting event More... | |
The PaintingArea class manages the methods and stores information about the current painting area, which is the currently opened project.
Definition at line 57 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 40 of file PaintingArea.cpp.
|
override |
This deconstructor is used to clear up the memory and remove the currently active window.
Definition at line 47 of file PaintingArea.cpp.
| int PaintingArea::addLayer | ( | int | width, |
| int | height, | ||
| int | widthOffset = 0, |
||
| int | heightOffset = 0, |
||
| int | alpha = 255, |
||
| ImageType | type = ImageType::RASTERIMAGE |
||
| ) |
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 |
| alpha | - Transparence of the layer |
| type | - Defining the ImageType of the new layer |
Definition at line 94 of file PaintingArea.cpp.
| int PaintingArea::addLayerAt | ( | int | idx, |
| int | width, | ||
| int | height, | ||
| int | widthOffset = 0, |
||
| int | heightOffset = 0, |
||
| ImageType | type = ImageType::RASTERIMAGE |
||
| ) |
The addLayerAt adds a layer to the current project/ painting area at a specific position in the layer stack.
| idx | - Index 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 229 of file PaintingArea.cpp.
| void PaintingArea::colorPickerSetSecondColor | ( | ) |
The colorPickerSetSecondColor calls the QTColorPicker to determine the secondary drawing color.
Definition at line 234 of file PaintingArea.cpp.
| void PaintingArea::colorPickerSwapColors | ( | ) |
The colorPickerSwitchColor swaps the primary color with the secondary drawing color.
Definition at line 239 of file PaintingArea.cpp.
| void PaintingArea::createCircleTool | ( | ) |
createCircleTool creates a Circle Tool.
Definition at line 263 of file PaintingArea.cpp.
| void PaintingArea::createFloodFillTool | ( | ) |
createFloodFillTool creates a Floodfill Tool.
Definition at line 272 of file PaintingArea.cpp.
| void PaintingArea::createGradientTool | ( | ) |
createGradientTool creates a Gradient Tool.
Definition at line 277 of file PaintingArea.cpp.
| void PaintingArea::createLineTool | ( | ) |
createLineTool creates a Line Tool.
Definition at line 253 of file PaintingArea.cpp.
| void PaintingArea::createPenTool | ( | ) |
createPenTool creates a Pen Tool.
Definition at line 243 of file PaintingArea.cpp.
| void PaintingArea::createPlainTool | ( | ) |
createPlainTool creates a Plain Tool.
Definition at line 248 of file PaintingArea.cpp.
| void PaintingArea::createPolygonTool | ( | ) |
createPolygonTool creates a Polygon Tool.
Definition at line 267 of file PaintingArea.cpp.
| void PaintingArea::createRectangleTool | ( | ) |
createRectangleTool creates a Rectangle Tool.
Definition at line 258 of file PaintingArea.cpp.
| void PaintingArea::deleteAllLayers | ( | ) |
deleteAllLayers deletes all layers
Definition at line 173 of file PaintingArea.cpp.
| void PaintingArea::deleteLayer | ( | int | idx, |
| bool | isTool = false |
||
| ) |
The deleteLayer method removes a layer at a given idx.
| idx | - The index of the layer to be removed |
| isTool | - Is the flag for when a tool uses this function. |
Definition at line 113 of file PaintingArea.cpp.
| void PaintingArea::drawPixelOntoActive | ( | QColor | color, |
| QPoint | point | ||
| ) |
drawPixelOntoActive draws a pixel onto the image data of the active Layer.
| color | - the color of the Pixel, which should be created. |
| point | - the Pixelposition. |
Definition at line 86 of file PaintingArea.cpp.
| int PaintingArea::getHeightOfActive | ( | ) |
The getHeightOfActive gets the vertical dimensions of the active layer.
Definition at line 286 of file PaintingArea.cpp.
| QImage PaintingArea::getImageDataOfActiveLayer | ( | ) |
getImageDataOfActiveLayer used to get the currents active imageData (if there isn't any active layer it return a 10*10 white picture)
Definition at line 476 of file PaintingArea.cpp.
| IntelliImage * PaintingArea::getImageOfActiveLayer | ( | ) |
getImageOfActiveLayer returns the image of the active Layer.
Definition at line 469 of file PaintingArea.cpp.
| int PaintingArea::getIndexOfActiveLayer | ( | ) |
getIndexOfActiveLayer returns the index of athe active Layer.
Definition at line 465 of file PaintingArea.cpp.
| std::vector< LayerObject > * PaintingArea::getLayerBundle | ( | ) |
getLayerBundle returns the real active layerbundle (care!)
Definition at line 491 of file PaintingArea.cpp.
| int PaintingArea::getMaxHeight | ( | ) |
getMaxHeight gets the max height of the Canvas.
Definition at line 294 of file PaintingArea.cpp.
| int PaintingArea::getMaxWidth | ( | ) |
getMaxWidth gets the max width of the Canvas.
Definition at line 290 of file PaintingArea.cpp.
| std::vector< QPoint > PaintingArea::getPolygonDataOfActiveLayer | ( | ) |
getPolygonDataOfActiveLayer get the polygon data of the active Layer.
Definition at line 302 of file PaintingArea.cpp.
| bool PaintingArea::getRenderSettings | ( | ) |
getRenderSettings updates all Images to the new Rendersetting.
| isFastRenderingOn | is the new given flag for the FastRenderer. |
Definition at line 68 of file PaintingArea.cpp.
| ImageType PaintingArea::getTypeOfImageActiveLayer | ( | ) |
getTypeOfImageActiveLayer get the type of the active Layer.
Definition at line 298 of file PaintingArea.cpp.
| int PaintingArea::getWidthOfActive | ( | ) |
The getWidthOfActive gets the horizontal dimensions of the active layer.
Definition at line 282 of file PaintingArea.cpp.
| void PaintingArea::historyadd | ( | ) |
historyadd adds an hisotry step
Definition at line 510 of file PaintingArea.cpp.
| void PaintingArea::historyGoBack | ( | ) |
historyGoBack go back in hisotry
Definition at line 517 of file PaintingArea.cpp.
| void PaintingArea::historyGoForward | ( | ) |
historyGoForward a function to undo the return of the previous state of the project.
Definition at line 526 of file PaintingArea.cpp.
|
overrideprotected |
mouseMoveEvent handles a mouse moved event
| event | - the specific mouse event. |
Definition at line 328 of file PaintingArea.cpp.
|
overrideprotected |
mousePressEvent handles a mouse pressed event.
| event | - the specific mouse event. |
Definition at line 309 of file PaintingArea.cpp.
|
overrideprotected |
mouseReleaseEvent handles a mouse released event
| event | - the specific mouse event. |
Definition at line 341 of file PaintingArea.cpp.
| void PaintingArea::moveActiveLayer | ( | int | idx | ) |
The moveActiveLayer moves the active layer to a specific position in the layer stack.
| idx | - The index of the new position the layer should be in |
Definition at line 211 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 204 of file PaintingArea.cpp.
| bool PaintingArea::open | ( | const QString & | filePath | ) |
The open method is used for loading a picture into the current layer.
| filePath | - Path and Name which are used to determine where the to-be-opened file is stored. |
Definition at line 162 of file PaintingArea.cpp.
|
overrideprotected |
paintEvent handles a painting event
| event | - the specific paint event. |
Definition at line 371 of file PaintingArea.cpp.
| bool PaintingArea::save | ( | const QString & | filePath, |
| const char * | fileFormat | ||
| ) |
The save method is used for exporting the current project as one picture.
| filePath | - Specifies the path and name of the file to create. |
| fileFormat | - Specifies the format of the file to create. |
Definition at line 181 of file PaintingArea.cpp.
| void PaintingArea::setCanvasDimensions | ( | int | maxWidth, |
| int | maxHeight | ||
| ) |
setCanvasDimensions sets the dimension of the Canvas
| maxWidth | - the width of the Canvas. |
| maxHeight | - the height of the Canvas. |
Definition at line 72 of file PaintingArea.cpp.
| void PaintingArea::setLayerActive | ( | int | idx | ) |
The setLayerToActive method marks a specific layer as active.
| idx | - The index of the layer to be active |
Definition at line 136 of file PaintingArea.cpp.
| void PaintingArea::setLayerAlpha | ( | int | idx, |
| int | alpha | ||
| ) |
The setAlphaOfLayer method sets the alpha value of a specific layer.
| idx | - The index of the layer where the change should be applied |
| alpha | - New alpha value of the layer |
Definition at line 143 of file PaintingArea.cpp.
| void PaintingArea::setPolygon | ( | int | idx | ) |
setPolygon is used for setting polygondata, it only works on RASTER images
| idx | - represents the number of the layer with should be transformed |
Definition at line 150 of file PaintingArea.cpp.
| void PaintingArea::setPolygonDataToActive | ( | std::vector< QPoint > | points | ) |
setPolygonDataToActive sets polygondata to the active Layer.
| points | - the points of the polygon data. |
Definition at line 90 of file PaintingArea.cpp.
| void PaintingArea::setRenderSettings | ( | bool | isFastRenderingOn | ) |
setRenderSettings updates all Images to the new Rendersetting.
| isFastRenderingOn | is the new given flag for the FastRenderer. |
Definition at line 51 of file PaintingArea.cpp.
|
slot |
The slotActivateLayer method handles the event of selecting one layer as active.
| a | - idx of the layer to be active |
Definition at line 222 of file PaintingArea.cpp.
|
slot |
The slotDeleteActiveLayer method handles the deletion of the active layer.
Definition at line 128 of file PaintingArea.cpp.
|
overrideprotected |
wheelEvent handles a mouse wheel event
| event | - the specific mouse event. |
Definition at line 356 of file PaintingArea.cpp.
| IntelliColorPicker PaintingArea::colorPicker |
colorPicker a class to manage Tool color.
Definition at line 286 of file PaintingArea.h.
| IntelliToolsettings PaintingArea::Toolsettings |
Toolsettings - a class to manage Tool settings.
Definition at line 281 of file PaintingArea.h.