mirror of
https://github.com/creyD/intelliphoto.git
synced 2026-04-14 12:20:32 +02:00
Uncrustified header files
This commit is contained in:
@@ -22,13 +22,13 @@
|
|||||||
* \param widthOffset - Stores the number of pixles from the left side of the painting area
|
* \param widthOffset - Stores the number of pixles from the left side of the painting area
|
||||||
* \param heightOffset - Stores the number of pixles from the top of the painting area
|
* \param heightOffset - Stores the number of pixles from the top of the painting area
|
||||||
*/
|
*/
|
||||||
struct LayerObject{
|
struct LayerObject {
|
||||||
IntelliImage* image;
|
IntelliImage* image;
|
||||||
int width;
|
int width;
|
||||||
int height;
|
int height;
|
||||||
int widthOffset;
|
int widthOffset;
|
||||||
int heightOffset;
|
int heightOffset;
|
||||||
int alpha=255;
|
int alpha=255;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -36,193 +36,193 @@ struct LayerObject{
|
|||||||
*/
|
*/
|
||||||
class PaintingArea : public QWidget
|
class PaintingArea : public QWidget
|
||||||
{
|
{
|
||||||
// Declares our class as a QObject which is the base class
|
// Declares our class as a QObject which is the base class
|
||||||
// for all Qt objects
|
// for all Qt objects
|
||||||
// QObjects handle events
|
// QObjects handle events
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
friend IntelliTool;
|
friend IntelliTool;
|
||||||
friend IntelliPhotoGui;
|
friend IntelliPhotoGui;
|
||||||
public:
|
public:
|
||||||
/*!
|
/*!
|
||||||
* \brief PaintingArea is the constructor of the PaintingArea class, which initiates the working environment
|
* \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 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 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)
|
* \param parent - The parent window of the main window (default=nullptr)
|
||||||
*/
|
*/
|
||||||
PaintingArea(int maxWidth=600, int maxHeight=600, QWidget *parent = 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
|
* \brief This deconstructor is used to clear up the memory and remove the currently active window
|
||||||
*/
|
*/
|
||||||
~PaintingArea() override;
|
~PaintingArea() override;
|
||||||
|
|
||||||
// Handles all events
|
// Handles all events
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief The open method is used for loading a picture into the current layer
|
* \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
|
* \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
|
* \return Returns a boolean variable whether the file was successfully opened or not
|
||||||
*/
|
*/
|
||||||
bool open(const QString &filePath);
|
bool open(const QString &filePath);
|
||||||
/*!
|
/*!
|
||||||
* \brief The save method is used for exporting the current project as one picture
|
* \brief The save method is used for exporting the current project as one picture
|
||||||
* \param fileName
|
* \param fileName
|
||||||
* \param fileFormat
|
* \param fileFormat
|
||||||
* \return Returns a boolean variable, true if the file was saved successfully, false if not
|
* \return Returns a boolean variable, true if the file was saved successfully, false if not
|
||||||
*/
|
*/
|
||||||
bool save(const QString &filePath, const char *fileFormat);
|
bool save(const QString &filePath, const char*fileFormat);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief The addLayer adds a layer to the current project/ painting area
|
* \brief The addLayer adds a layer to the current project/ painting area
|
||||||
* \param width - Width of the layer in pixles
|
* \param width - Width of the layer in pixles
|
||||||
* \param height - Height 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 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 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
|
* \param type - Defining the ImageType of the new layer
|
||||||
* \return Returns the number of layers in the project
|
* \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);
|
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
|
* \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 idx - Index of the position the new layer should be added
|
||||||
* \param width - Width of the layer in pixles
|
* \param width - Width of the layer in pixles
|
||||||
* \param height - Height 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 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 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
|
* \param type - Defining the ImageType of the new layer
|
||||||
* \return Returns the id of the layer position
|
* \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);
|
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
|
* \brief The deleteLayer method removes a layer at a given idx
|
||||||
* \param idx - The index of the layer to be removed
|
* \param idx - The index of the layer to be removed
|
||||||
*/
|
*/
|
||||||
void deleteLayer(int idx);
|
void deleteLayer(int idx);
|
||||||
/*!
|
/*!
|
||||||
* \brief The setLayerToActive method marks a specific layer as active
|
* \brief The setLayerToActive method marks a specific layer as active
|
||||||
* \param idx - The index of the layer to be active
|
* \param idx - The index of the layer to be active
|
||||||
*/
|
*/
|
||||||
void setLayerActive(int idx);
|
void setLayerActive(int idx);
|
||||||
/*!
|
/*!
|
||||||
* \brief The setAlphaOfLayer method sets the alpha value of a specific layer
|
* \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 idx - The index of the layer where the change should be applied
|
||||||
* \param alpha - New alpha value of the layer
|
* \param alpha - New alpha value of the layer
|
||||||
*/
|
*/
|
||||||
void setLayerAlpha(int idx, int alpha);
|
void setLayerAlpha(int idx, int alpha);
|
||||||
/*!
|
/*!
|
||||||
* \brief The floodFill method fills a the active layer with a given color
|
* \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 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 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 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
|
* \param a - Alpha value of the color the layer should be filled with
|
||||||
*/
|
*/
|
||||||
void floodFill(int r, int g, int b, int a);
|
void floodFill(int r, int g, int b, int a);
|
||||||
/*!
|
/*!
|
||||||
* \brief The movePositionActive method moves the active layer to certain position
|
* \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 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
|
* \param y - The y value the new center of the layer should be at
|
||||||
*/
|
*/
|
||||||
void movePositionActive(int x, int y);
|
void movePositionActive(int x, int y);
|
||||||
/*!
|
/*!
|
||||||
* \brief The moveActiveLayer moves the active layer to a specific position in the layer stack
|
* \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
|
* \param idx - The index of the new position the layer should be in
|
||||||
*/
|
*/
|
||||||
void moveActiveLayer(int idx);
|
void moveActiveLayer(int idx);
|
||||||
|
|
||||||
//change properties of colorPicker
|
//change properties of colorPicker
|
||||||
/*!
|
/*!
|
||||||
* \brief The colorPickerSetFirstColor calls the QTColorPicker to determine the primary drawing color
|
* \brief The colorPickerSetFirstColor calls the QTColorPicker to determine the primary drawing color
|
||||||
*/
|
*/
|
||||||
void colorPickerSetFirstColor();
|
void colorPickerSetFirstColor();
|
||||||
/*!
|
/*!
|
||||||
* \brief The colorPickerSetSecondColor calls the QTColorPicker to determine the secondary drawing color
|
* \brief The colorPickerSetSecondColor calls the QTColorPicker to determine the secondary drawing color
|
||||||
*/
|
*/
|
||||||
void colorPickerSetSecondColor();
|
void colorPickerSetSecondColor();
|
||||||
/*!
|
/*!
|
||||||
* \brief The colorPickerSwitchColor swaps the primary color with the secondary drawing color
|
* \brief The colorPickerSwitchColor swaps the primary color with the secondary drawing color
|
||||||
*/
|
*/
|
||||||
void colorPickerSwapColors();
|
void colorPickerSwapColors();
|
||||||
|
|
||||||
// Create tools
|
// Create tools
|
||||||
void createPenTool();
|
void createPenTool();
|
||||||
void createPlainTool();
|
void createPlainTool();
|
||||||
void createLineTool();
|
void createLineTool();
|
||||||
void createRectangleTool();
|
void createRectangleTool();
|
||||||
void createCircleTool();
|
void createCircleTool();
|
||||||
void createPolygonTool();
|
void createPolygonTool();
|
||||||
void createFloodFillTool();
|
void createFloodFillTool();
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief The getWidthOfActive gets the horizontal dimensions of the active layer
|
* \brief The getWidthOfActive gets the horizontal dimensions of the active layer
|
||||||
* \return Returns the horizontal pixle count of the active layer
|
* \return Returns the horizontal pixle count of the active layer
|
||||||
*/
|
*/
|
||||||
int getWidthOfActive();
|
int getWidthOfActive();
|
||||||
/*!
|
/*!
|
||||||
* \brief The getHeightOfActive gets the vertical dimensions of the active layer
|
* \brief The getHeightOfActive gets the vertical dimensions of the active layer
|
||||||
* \return Returns the vertical pixle count of the active layer
|
* \return Returns the vertical pixle count of the active layer
|
||||||
*/
|
*/
|
||||||
int getHeightOfActive();
|
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;
|
IntelliToolsettings Toolsettings;
|
||||||
IntelliColorPicker colorPicker;
|
IntelliColorPicker colorPicker;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
// Events to handle
|
// Events to handle
|
||||||
/*!
|
/*!
|
||||||
* \brief The slotActivateLayer method handles the event of selecting one layer as active
|
* \brief The slotActivateLayer method handles the event of selecting one layer as active
|
||||||
* \param a - idx of the layer to be active
|
* \param a - idx of the layer to be active
|
||||||
*/
|
*/
|
||||||
void slotActivateLayer(int a);
|
void slotActivateLayer(int a);
|
||||||
/*!
|
/*!
|
||||||
* \brief The slotDeleteActiveLayer method handles the deletion of the active layer
|
* \brief The slotDeleteActiveLayer method handles the deletion of the active layer
|
||||||
*/
|
*/
|
||||||
void slotDeleteActiveLayer();
|
void slotDeleteActiveLayer();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void mousePressEvent(QMouseEvent *event) override;
|
void mousePressEvent(QMouseEvent*event) override;
|
||||||
void mouseMoveEvent(QMouseEvent *event) override;
|
void mouseMoveEvent(QMouseEvent*event) override;
|
||||||
void mouseReleaseEvent(QMouseEvent *event) override;
|
void mouseReleaseEvent(QMouseEvent*event) override;
|
||||||
|
|
||||||
void wheelEvent(QWheelEvent *event) override;
|
void wheelEvent(QWheelEvent*event) override;
|
||||||
// Updates the painting area where we are painting
|
// Updates the painting area where we are painting
|
||||||
void paintEvent(QPaintEvent *event) override;
|
void paintEvent(QPaintEvent*event) override;
|
||||||
|
|
||||||
// Makes sure the area we are drawing on remains
|
// Makes sure the area we are drawing on remains
|
||||||
// as large as the widget
|
// as large as the widget
|
||||||
void resizeEvent(QResizeEvent *event) override;
|
void resizeEvent(QResizeEvent*event) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setLayerDimensions(int maxWidth, int maxHeight);
|
void setLayerDimensions(int maxWidth, int maxHeight);
|
||||||
void selectLayerUp();
|
void selectLayerUp();
|
||||||
void selectLayerDown();
|
void selectLayerDown();
|
||||||
IntelliTool* copyActiveTool();
|
IntelliTool* copyActiveTool();
|
||||||
|
|
||||||
QImage* Canvas;
|
QImage* Canvas;
|
||||||
int maxWidth;
|
int maxWidth;
|
||||||
int maxHeight;
|
int maxHeight;
|
||||||
|
|
||||||
IntelliRenderSettings renderSettings;
|
IntelliRenderSettings renderSettings;
|
||||||
IntelliTool* Tool;
|
IntelliTool* Tool;
|
||||||
IntelliPhotoGui* DumpyGui;
|
IntelliPhotoGui* DumpyGui;
|
||||||
|
|
||||||
std::vector<LayerObject> layerBundle;
|
std::vector<LayerObject> layerBundle;
|
||||||
int activeLayer=-1;
|
int activeLayer=-1;
|
||||||
|
|
||||||
void drawLayers(bool forSaving=false);
|
void drawLayers(bool forSaving=false);
|
||||||
|
|
||||||
void resizeLayer(QImage *image_res, const QSize &newSize);
|
void resizeLayer(QImage*image_res, const QSize &newSize);
|
||||||
|
|
||||||
// Helper for Tool
|
// Helper for Tool
|
||||||
// TODO: Always create this layer on top and return the id here!
|
// TODO: Always create this layer on top and return the id here!
|
||||||
void createTempTopLayer(int idx);
|
void createTempTopLayer(int idx);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user