IntelliPhoto 0.5

PaintingArea.cpp
Go to the documentation of this file.
1 // ---------- PaintingArea.cpp ----------
2 #include "string.h"
3
4 #include <vector>
5
6 #include <QtWidgets>
7 #include <QPoint>
8 #include <QRect>
9
10 #include "PaintingArea.h"
11 #include "Image/IntelliRasterImage.h"
12 #include "Image/IntelliShapedImage.h"
13 #include "Tool/IntelliToolPen.h"
14 #include "Tool/IntelliToolPlain.h"
15 #include "Tool/IntelliToolLine.h"
16 #include "Tool/IntelliToolCircle.h"
17 #include "Tool/IntelliToolRectangle.h"
18 #include "Tool/IntelliToolFloodFill.h"
19 #include "Tool/IntelliToolPolygon.h"
20
21 PaintingArea::PaintingArea(int maxWidth, int maxHeight, QWidget*parent)
22 : QWidget(parent){
23 this->Tool = nullptr;
24 this->setLayerDimensions(maxWidth, maxHeight);
25 this->addLayer(200,200,0,0,IntelliImage::ImageType::SHAPEDIMAGE);
26 layerBundle[0].image->drawPlain(QColor(0,0,255,255));
27 std::vector<QPoint> polygon;
28 polygon.push_back(QPoint(100,000));
29 polygon.push_back(QPoint(200,100));
30 polygon.push_back(QPoint(100,200));
31 polygon.push_back(QPoint(000,100));
32 layerBundle[0].image->setPolygon(polygon);
33
34 this->addLayer(200,200,150,150,IntelliImage::ImageType::RASTERIMAGE);
35 layerBundle[1].image->drawPlain(QColor(0,255,0,255));
36 layerBundle[1].alpha=200;
37
38 activeLayer=0;
39 }
40
41 PaintingArea::~PaintingArea(){
42 delete Tool;
43 }
44
45 void PaintingArea::setLayerDimensions(int maxWidth, int maxHeight){
46 //set standart parameter
47 this->maxWidth = maxWidth;
48 this->maxHeight = maxHeight;
49 Canvas = new QImage(maxWidth,maxHeight, QImage::Format_ARGB32);
50
51 // Roots the widget to the top left even if resized
52 setAttribute(Qt::WA_StaticContents);
53
54 }
55
56 int PaintingArea::addLayer(int width, int height, int widthOffset, int heightOffset, IntelliImage::ImageType type){
57 LayerObject newLayer;
58 newLayer.width = width;
59 newLayer.height = height;
60 newLayer.widthOffset = widthOffset;
61 newLayer.heightOffset = heightOffset;
62 if(type==IntelliImage::ImageType::RASTERIMAGE) {
63 newLayer.image = new IntelliRasterImage(width,height,renderSettings.getFastRenderer());
64 }else if(type==IntelliImage::ImageType::SHAPEDIMAGE) {
65 newLayer.image = new IntelliShapedImage(width, height, renderSettings.getFastRenderer());
66 }
67 newLayer.alpha = 255;
68 this->layerBundle.push_back(newLayer);
69 activeLayer = static_cast<int>(layerBundle.size())-1;
70 return activeLayer;
71 }
72
73
74 void PaintingArea::deleteLayer(int idx){
75 if(idx<static_cast<int>(layerBundle.size())) {
76 this->layerBundle.erase(layerBundle.begin()+idx);
77 if(activeLayer>=idx && activeLayer != 0) {
78 activeLayer--;
79 }
80 }
81 }
82
83 void PaintingArea::slotDeleteActiveLayer(){
84 if(activeLayer>=0 && activeLayer < static_cast<int>(layerBundle.size())) {
85 this->layerBundle.erase(layerBundle.begin()+activeLayer);
86 activeLayer--;
87 }
88 }
89
90 void PaintingArea::setLayerActive(int idx){
91 if(idx>=0&&idx<static_cast<int>(layerBundle.size())) {
92 this->activeLayer=idx;
93 }
94 }
95
96 void PaintingArea::setLayerAlpha(int idx, int alpha){
97 if(idx>=0&&idx<static_cast<int>(layerBundle.size())) {
98 layerBundle[static_cast<size_t>(idx)].alpha=alpha;
99 }
100 }
101
102 // Used to load the image and place it in the widget
103 bool PaintingArea::open(const QString &filePath){
104 if(this->activeLayer==-1) {
105 return false;
106 }
107 IntelliImage* active = layerBundle[static_cast<size_t>(activeLayer)].image;
108 bool open = active->loadImage(filePath);
109 active->calculateVisiblity();
110 update();
111 return open;
112 }
113
114 // Save the current image
115 bool PaintingArea::save(const QString &filePath, const char*fileFormat){
116 if(layerBundle.size()==0) {
117 return false;
118 }
119 this->drawLayers(true);
120
121 if(!strcmp(fileFormat,"PNG")) {
122 QImage visibleImage = Canvas->convertToFormat(QImage::Format_Indexed8);
123 fileFormat = "png";
124 if (visibleImage.save(filePath, fileFormat)) {
125 return true;
126 } else {
127 return false;
128 }
129 }
130
131 if (Canvas->save(filePath, fileFormat)) {
132 return true;
133 } else {
134 return false;
135 }
136 }
137
138 // Color the image area with white
139 void PaintingArea::floodFill(int r, int g, int b, int a){
140 if(this->activeLayer==-1) {
141 return;
142 }
143 IntelliImage* active = layerBundle[static_cast<size_t>(activeLayer)].image;
144 active->drawPlain(QColor(r, g, b, a));
145 update();
146 }
147
148 void PaintingArea::movePositionActive(int x, int y){
149 if(Tool!=nullptr) {
150 if(Tool->getIsDrawing()) {
151 IntelliTool* temp = copyActiveTool();
152 delete this->Tool;
153 this->Tool = temp;
154 }
155 }
156 layerBundle[static_cast<size_t>(activeLayer)].widthOffset += x;
157 layerBundle[static_cast<size_t>(activeLayer)].heightOffset += y;
158 }
159
160 void PaintingArea::moveActiveLayer(int idx){
161 if(Tool != nullptr) {
162 if(Tool->getIsDrawing()) {
163 IntelliTool* temp = copyActiveTool();
164 delete this->Tool;
165 this->Tool = temp;
166 }
167 }
168 if(idx==1) {
169 this->selectLayerUp();
170 }else if(idx==-1) {
171 this->selectLayerDown();
172 }
173 }
174
175 void PaintingArea::slotActivateLayer(int a){
176 if(Tool != nullptr) {
177 if(Tool->getIsDrawing()) {
178 IntelliTool* temp = copyActiveTool();
179 delete this->Tool;
180 this->Tool = temp;
181 }
182 }
183 if(a>=0 && a < static_cast<int>(layerBundle.size())) {
184 this->setLayerActive(a);
185 }
186 }
187
188 void PaintingArea::colorPickerSetFirstColor(){
189 QColor clr = QColorDialog::getColor(colorPicker.getFirstColor(), nullptr, "Main Color", QColorDialog::DontUseNativeDialog);
190 this->colorPicker.setFirstColor(clr);
191 }
192
193 void PaintingArea::colorPickerSetSecondColor(){
194 QColor clr = QColorDialog::getColor(colorPicker.getSecondColor(), nullptr, "Secondary Color", QColorDialog::DontUseNativeDialog);
195 this->colorPicker.setSecondColor(clr);
196 }
197
198 void PaintingArea::colorPickerSwapColors(){
199 this->colorPicker.swapColors();
200 }
201
202 void PaintingArea::createPenTool(){
203 delete this->Tool;
204 Tool = new IntelliToolPen(this, &colorPicker, &Toolsettings);
205 }
206
207 void PaintingArea::createPlainTool(){
208 delete this->Tool;
209 Tool = new IntelliToolPlainTool(this, &colorPicker, &Toolsettings);
210 }
211
212 void PaintingArea::createLineTool(){
213 delete this->Tool;
214 Tool = new IntelliToolLine(this, &colorPicker, &Toolsettings);
215 }
216
217 void PaintingArea::createRectangleTool(){
218 delete this->Tool;
219 Tool = new IntelliToolRectangle(this, &colorPicker, &Toolsettings);
220 }
221
222 void PaintingArea::createCircleTool(){
223 delete this->Tool;
224 Tool = new IntelliToolCircle(this, &colorPicker, &Toolsettings);
225 }
226 void PaintingArea::createPolygonTool(){
227 delete this->Tool;
228 Tool = new IntelliToolPolygon(this, &colorPicker, &Toolsettings);
229 }
230
231 void PaintingArea::createFloodFillTool(){
232 delete this->Tool;
233 Tool = new IntelliToolFloodFill(this, &colorPicker, &Toolsettings);
234 }
235
236 int PaintingArea::getWidthOfActive(){
237 return this->layerBundle[static_cast<unsigned long long>(activeLayer)].width;
238 }
239
240 int PaintingArea::getHeightOfActive(){
241 return this->layerBundle[static_cast<unsigned long long>(activeLayer)].height;
242 }
243
244 IntelliImage::ImageType PaintingArea::getTypeOfImageRealLayer(){
245 return this->layerBundle[static_cast<unsigned long long>(activeLayer)].image->getTypeOfImage();
246 }
247
248 std::vector<QPoint> PaintingArea::getPolygonDataOfRealLayer(){
249 return this->layerBundle[static_cast<unsigned long long>(activeLayer)].image->getPolygonData();
250 }
251
252 // If a mouse button is pressed check if it was the
253 // left button and if so store the current position
254 // Set that we are currently drawing
255 void PaintingArea::mousePressEvent(QMouseEvent*event){
256 if(Tool == nullptr)
257 return;
258 int x = event->x()-layerBundle[static_cast<unsigned long long>(activeLayer)].widthOffset;
259 int y = event->y()-layerBundle[static_cast<unsigned long long>(activeLayer)].heightOffset;
260 if(event->button() == Qt::LeftButton) {
261 Tool->onMouseLeftPressed(x, y);
262 }else if(event->button() == Qt::RightButton) {
263 Tool->onMouseRightPressed(x, y);
264 }
265 update();
266 }
267
268 // When the mouse moves if the left button is clicked
269 // we call the drawline function which draws a line
270 // from the last position to the current
271 void PaintingArea::mouseMoveEvent(QMouseEvent*event){
272 if(Tool == nullptr)
273 return;
274 int x = event->x()-layerBundle[static_cast<unsigned long long>(activeLayer)].widthOffset;
275 int y = event->y()-layerBundle[static_cast<unsigned long long>(activeLayer)].heightOffset;
276 Tool->onMouseMoved(x, y);
277 update();
278 }
279
280 // If the button is released we set variables to stop drawing
281 void PaintingArea::mouseReleaseEvent(QMouseEvent*event){
282 if(Tool == nullptr)
283 return;
284 int x = event->x()-layerBundle[static_cast<unsigned long long>(activeLayer)].widthOffset;
285 int y = event->y()-layerBundle[static_cast<unsigned long long>(activeLayer)].heightOffset;
286 if(event->button() == Qt::LeftButton) {
287 Tool->onMouseLeftReleased(x, y);
288 }else if(event->button() == Qt::RightButton) {
289 Tool->onMouseRightReleased(x, y);
290 }
291 update();
292 }
293
294 void PaintingArea::wheelEvent(QWheelEvent*event){
295 if(this->Tool != nullptr) {
296 QPoint numDegrees = event->angleDelta() / 8;
297 if(!numDegrees.isNull()) {
298 QPoint numSteps = numDegrees / 15;
299 Tool->onWheelScrolled(numSteps.y()* -1);
300 }
301 }
302 }
303
304 // QPainter provides functions to draw on the widget
305 // The QPaintEvent is sent to widgets that need to
306 // update themselves
307 void PaintingArea::paintEvent(QPaintEvent*event){
308 this->drawLayers();
309
310 QPainter painter(this);
311 QRect dirtyRec = event->rect();
312 painter.drawImage(dirtyRec, *Canvas, dirtyRec);
313 update();
314 }
315
316 // Resize the image to slightly larger then the main window
317 // to cut down on the need to resize the image
318 void PaintingArea::resizeEvent(QResizeEvent*event){
319 //TODO wait till tool works
320 update();
321 }
322
323 void PaintingArea::resizeLayer(QImage*image_res, const QSize &newSize){
324 //TODO implement
325 }
326
327 void PaintingArea::selectLayerUp(){
328 if(activeLayer!=-1 && static_cast<unsigned long long>(activeLayer)<layerBundle.size()-1) {
329 std::swap(layerBundle[static_cast<unsigned long long>(activeLayer)], layerBundle[static_cast<unsigned long long>(activeLayer+1)]);
330 activeLayer++;
331 }
332 }
333
334 void PaintingArea::selectLayerDown(){
335 if(activeLayer!=-1 && activeLayer>0) {
336 std::swap(layerBundle[static_cast<unsigned long long>(activeLayer)], layerBundle[static_cast<unsigned long long>(activeLayer-1)]);
337 activeLayer--;
338 }
339 }
340
341 void PaintingArea::drawLayers(bool forSaving){
342 if(forSaving) {
343 Canvas->fill(Qt::GlobalColor::transparent);
344 }else{
345 Canvas->fill(Qt::GlobalColor::black);
346 }
347 for(size_t i=0; i<layerBundle.size(); i++) {
348 LayerObject layer = layerBundle[i];
349 QImage cpy = layer.image->getDisplayable(layer.alpha);
350 QColor clr_0;
351 QColor clr_1;
352 for(int y=0; y<layer.height; y++) {
353 if(layer.heightOffset+y<0) continue;
354 if(layer.heightOffset+y>=maxHeight) break;
355 for(int x=0; x<layer.width; x++) {
356 if(layer.widthOffset+x<0) continue;
357 if(layer.widthOffset+x>=maxWidth) break;
358 clr_0=Canvas->pixelColor(layer.widthOffset+x, layer.heightOffset+y);
359 clr_1=cpy.pixelColor(x,y);
360 float t = static_cast<float>(clr_1.alpha())/255.f;
361 int r =static_cast<int>(static_cast<float>(clr_1.red())*(t)+static_cast<float>(clr_0.red())*(1.f-t)+0.5f);
362 int g =static_cast<int>(static_cast<float>(clr_1.green())*(t)+static_cast<float>(clr_0.green())*(1.f-t)+0.5f);
363 int b =static_cast<int>(static_cast<float>(clr_1.blue())*(t)+static_cast<float>(clr_0.blue()*(1.f-t))+0.5f);
364 int a =std::min(clr_0.alpha()+clr_1.alpha(), 255);
365 clr_0.setRed(r);
366 clr_0.setGreen(g);
367 clr_0.setBlue(b);
368 clr_0.setAlpha(a);
369
370 Canvas->setPixelColor(layer.widthOffset+x, layer.heightOffset+y, clr_0);
371 }
372 }
373 }
374 }
375
376 void PaintingArea::createTempTopLayer(int idx){
377 if(idx>=0) {
378 LayerObject newLayer;
379 newLayer.alpha = 255;
380 newLayer.height = layerBundle[static_cast<unsigned long long>(idx)].height;
381 newLayer.width = layerBundle[static_cast<unsigned long long>(idx)].width;
382 newLayer.heightOffset = layerBundle[static_cast<unsigned long long>(idx)].heightOffset;
383 newLayer.widthOffset = layerBundle[static_cast<unsigned long long>(idx)].widthOffset;
384 newLayer.image = layerBundle[static_cast<unsigned long long>(idx)].image->getDeepCopy();
385 layerBundle.insert(layerBundle.begin()+idx+1,newLayer);
386 }
387 }
388
389 IntelliTool* PaintingArea::copyActiveTool(){
390 switch(Tool->getTooltype()) {
391 case IntelliTool::Tooltype::CIRCLE: return new IntelliToolCircle(this,&colorPicker, &Toolsettings);
392 case IntelliTool::Tooltype::FLOODFILL: return new IntelliToolFloodFill(this,&colorPicker, &Toolsettings);
393 case IntelliTool::Tooltype::LINE: return new IntelliToolLine(this,&colorPicker, &Toolsettings);
394 case IntelliTool::Tooltype::PEN: return new IntelliToolPen(this,&colorPicker, &Toolsettings);
395 case IntelliTool::Tooltype::PLAIN: return new IntelliToolPlainTool(this,&colorPicker, &Toolsettings);
396 case IntelliTool::Tooltype::POLYGON: return new IntelliToolPolygon(this,&colorPicker, &Toolsettings);
397 case IntelliTool::Tooltype::RECTANGLE: return new IntelliToolRectangle(this,&colorPicker, &Toolsettings);
398 default: return nullptr;
399 }
400 }
401
402 int PaintingArea::getNumberOfActiveLayer(){
403 return activeLayer;
404 }
405
406 IntelliImage* PaintingArea::getImageOfActiveLayer(){
407 return layerBundle[activeLayer].image;
408 }
PaintingArea::getWidthOfActive
int getWidthOfActive()
The getWidthOfActive gets the horizontal dimensions of the active layer.
Definition: PaintingArea.cpp:236
IntelliTool::Tooltype::PEN
PaintingArea::createCircleTool
void createCircleTool()
Definition: PaintingArea.cpp:222
IntelliTool::onMouseRightPressed
virtual void onMouseRightPressed(int x, int y)
A function managing the right click Pressed of a Mouse. Constructing the Canvas to draw on....
Definition: IntelliTool.cpp:15
IntelliTool::onMouseLeftReleased
virtual void onMouseLeftReleased(int x, int y)
A function managing the left click Released of a Mouse. Call this in child classes!
Definition: IntelliTool.cpp:33
PaintingArea::getImageOfActiveLayer
IntelliImage * getImageOfActiveLayer()
Definition: PaintingArea.cpp:406
PaintingArea::mouseReleaseEvent
void mouseReleaseEvent(QMouseEvent *event) override
Definition: PaintingArea.cpp:281
PaintingArea::createRectangleTool
void createRectangleTool()
Definition: PaintingArea.cpp:217
IntelliToolPolygon.h
IntelliTool::onMouseLeftPressed
virtual void onMouseLeftPressed(int x, int y)
A function managing the left click Pressed of a Mouse. Resetting the current draw....
Definition: IntelliTool.cpp:26
IntelliShapedImage.h
PaintingArea::save
bool save(const QString &filePath, const char *fileFormat)
The save method is used for exporting the current project as one picture.
Definition: PaintingArea.cpp:115
PaintingArea::setLayerAlpha
void setLayerAlpha(int idx, int alpha)
The setAlphaOfLayer method sets the alpha value of a specific layer.
Definition: PaintingArea.cpp:96
IntelliTool::Tooltype::FLOODFILL
PaintingArea::setLayerActive
void setLayerActive(int idx)
The setLayerToActive method marks a specific layer as active.
Definition: PaintingArea.cpp:90
LayerObject::widthOffset
int widthOffset
Definition: PaintingArea.h:29
PaintingArea::floodFill
void floodFill(int r, int g, int b, int a)
The floodFill method fills a the active layer with a given color.
Definition: PaintingArea.cpp:139
IntelliToolPlainTool
The IntelliToolPlainTool class represents a tool to fill the whole canvas with one color.
Definition: IntelliToolPlain.h:9
IntelliColorPicker::setSecondColor
void setSecondColor(QColor Color)
A function to set the secondary color.
Definition: IntelliColorPicker.cpp:28
IntelliShapedImage
The IntelliShapedImage manages a Shapedimage.
Definition: IntelliShapedImage.h:10
IntelliColorPicker::getSecondColor
QColor getSecondColor()
A function to read the secondary selected color.
Definition: IntelliColorPicker.cpp:20
LayerObject::heightOffset
int heightOffset
Definition: PaintingArea.h:30
PaintingArea::deleteLayer
void deleteLayer(int idx)
The deleteLayer method removes a layer at a given idx.
Definition: PaintingArea.cpp:74
PaintingArea::getHeightOfActive
int getHeightOfActive()
The getHeightOfActive gets the vertical dimensions of the active layer.
Definition: PaintingArea.cpp:240
IntelliToolFloodFill.h
IntelliImage::getDisplayable
virtual QImage getDisplayable(const QSize &displaySize, int alpha)=0
A function returning the displayable ImageData in a requested transparence and size.
PaintingArea::createPlainTool
void createPlainTool()
Definition: PaintingArea.cpp:207
PaintingArea::wheelEvent
void wheelEvent(QWheelEvent *event) override
Definition: PaintingArea.cpp:294
IntelliRenderSettings::getFastRenderer
bool getFastRenderer()
The getfastRenderer gets the value of the flag for the fastRenderer setting.
Definition: IntelliRenderSettings.cpp:8
LayerObject
The LayerObject struct holds all the information needed to construct a layer.
Definition: PaintingArea.h:25
PaintingArea::createPenTool
void createPenTool()
Definition: PaintingArea.cpp:202
IntelliToolPlain.h
PaintingArea::mousePressEvent
void mousePressEvent(QMouseEvent *event) override
Definition: PaintingArea.cpp:255
IntelliRasterImage.h
LayerObject::alpha
int alpha
Definition: PaintingArea.h:31
IntelliToolRectangle
The IntelliToolRectangle class represents a tool to draw a rectangle.
Definition: IntelliToolRectangle.h:11
PaintingArea::createLineTool
void createLineTool()
Definition: PaintingArea.cpp:212
IntelliToolLine.h
IntelliToolPen
The IntelliToolPen class represents a tool to draw a line.
Definition: IntelliToolPen.h:11
PaintingArea::colorPickerSetSecondColor
void colorPickerSetSecondColor()
The colorPickerSetSecondColor calls the QTColorPicker to determine the secondary drawing color.
Definition: PaintingArea.cpp:193
IntelliTool::onMouseRightReleased
virtual void onMouseRightReleased(int x, int y)
A function managing the right click Released of a Mouse. Merging the Canvas to Active....
Definition: IntelliTool.cpp:22
PaintingArea::colorPickerSetFirstColor
void colorPickerSetFirstColor()
The colorPickerSetFirstColor calls the QTColorPicker to determine the primary drawing color.
Definition: PaintingArea.cpp:188
IntelliTool::Tooltype::PLAIN
IntelliTool::Tooltype::POLYGON
IntelliTool::getTooltype
Tooltype getTooltype()
Definition: IntelliTool.cpp:85
PaintingArea::getTypeOfImageRealLayer
IntelliImage::ImageType getTypeOfImageRealLayer()
Definition: PaintingArea.cpp:244
LayerObject::width
int width
Definition: PaintingArea.h:27
IntelliToolRectangle.h
PaintingArea::~PaintingArea
~PaintingArea() override
This deconstructor is used to clear up the memory and remove the currently active window.
Definition: PaintingArea.cpp:41
PaintingArea::mouseMoveEvent
void mouseMoveEvent(QMouseEvent *event) override
Definition: PaintingArea.cpp:271
PaintingArea::getNumberOfActiveLayer
int getNumberOfActiveLayer()
Definition: PaintingArea.cpp:402
IntelliColorPicker::setFirstColor
void setFirstColor(QColor Color)
A function to set the primary color.
Definition: IntelliColorPicker.cpp:24
IntelliTool
An abstract class that manages the basic events, like mouse clicks or scrolls events.
Definition: IntelliTool.h:14
IntelliImage::ImageType::SHAPEDIMAGE
PaintingArea::slotDeleteActiveLayer
void slotDeleteActiveLayer()
The slotDeleteActiveLayer method handles the deletion of the active layer.
Definition: PaintingArea.cpp:83
PaintingArea::open
bool open(const QString &filePath)
The open method is used for loading a picture into the current layer.
Definition: PaintingArea.cpp:103
PaintingArea::createPolygonTool
void createPolygonTool()
Definition: PaintingArea.cpp:226
PaintingArea::moveActiveLayer
void moveActiveLayer(int idx)
The moveActiveLayer moves the active layer to a specific position in the layer stack.
Definition: PaintingArea.cpp:160
PaintingArea::colorPicker
IntelliColorPicker colorPicker
Definition: PaintingArea.h:175
PaintingArea::PaintingArea
PaintingArea(int maxWidth=600, int maxHeight=600, QWidget *parent=nullptr)
PaintingArea is the constructor of the PaintingArea class, which initiates the working environment.
Definition: PaintingArea.cpp:21
IntelliTool::getIsDrawing
bool getIsDrawing()
Definition: IntelliTool.cpp:89
PaintingArea.h
IntelliColorPicker::getFirstColor
QColor getFirstColor()
A function to read the primary selected color.
Definition: IntelliColorPicker.cpp:16
LayerObject::height
int height
Definition: PaintingArea.h:28
PaintingArea::createFloodFillTool
void createFloodFillTool()
Definition: PaintingArea.cpp:231
PaintingArea::slotActivateLayer
void slotActivateLayer(int a)
The slotActivateLayer method handles the event of selecting one layer as active.
Definition: PaintingArea.cpp:175
PaintingArea::paintEvent
void paintEvent(QPaintEvent *event) override
Definition: PaintingArea.cpp:307
IntelliImage::ImageType::RASTERIMAGE
IntelliTool::Tooltype::RECTANGLE
LayerObject::image
IntelliImage * image
Definition: PaintingArea.h:26
IntelliImage::loadImage
virtual bool loadImage(const QString &filePath)
A function that loads and sclaes an image to the fitting dimensions.
Definition: IntelliImage.cpp:22
PaintingArea::getPolygonDataOfRealLayer
std::vector< QPoint > getPolygonDataOfRealLayer()
Definition: PaintingArea.cpp:248
PaintingArea::Toolsettings
IntelliToolsettings Toolsettings
Definition: PaintingArea.h:174
PaintingArea::resizeEvent
void resizeEvent(QResizeEvent *event) override
Definition: PaintingArea.cpp:318
IntelliTool::Tooltype::LINE
IntelliColorPicker::swapColors
void swapColors()
A function switching primary and secondary color.
Definition: IntelliColorPicker.cpp:12
IntelliToolFloodFill
The IntelliToolFloodFill class represents a tool to flood FIll a certian area.
Definition: IntelliToolFloodFill.h:10
PaintingArea::colorPickerSwapColors
void colorPickerSwapColors()
The colorPickerSwitchColor swaps the primary color with the secondary drawing color.
Definition: PaintingArea.cpp:198
IntelliToolPen.h
IntelliToolCircle
The IntelliToolCircle class represents a tool to draw a circle.
Definition: IntelliToolCircle.h:10
PaintingArea::movePositionActive
void movePositionActive(int x, int y)
The movePositionActive method moves the active layer to certain position.
Definition: PaintingArea.cpp:148
IntelliImage
An abstract class which manages the basic IntelliImage operations.
Definition: IntelliImage.h:19
IntelliTool::onMouseMoved
virtual void onMouseMoved(int x, int y)
A function managing the mouse moved event. Call this in child classes!
Definition: IntelliTool.cpp:42
IntelliToolPolygon
The IntelliToolPolygon managed the Drawing of Polygonforms.
Definition: IntelliToolPolygon.h:11
IntelliImage::calculateVisiblity
virtual void calculateVisiblity()=0
An abstract function that calculates the visiblity of the Image data if needed.
IntelliTool::onWheelScrolled
virtual void onWheelScrolled(int value)
A function managing the scroll event. A positive value means scrolling outwards. Call this in child c...
Definition: IntelliTool.cpp:47
IntelliRasterImage
The IntelliRasterImage manages a RASTERIMAGE.
Definition: IntelliRasterImage.h:9
IntelliToolCircle.h
PaintingArea::addLayer
int addLayer(int width, int height, int widthOffset=0, int heightOffset=0, IntelliImage::ImageType type=IntelliImage::ImageType::RASTERIMAGE)
The addLayer adds a layer to the current project/ painting area.
Definition: PaintingArea.cpp:56
IntelliImage::ImageType
ImageType
The Types, which an Image can be.
Definition: IntelliImage.h:26
IntelliImage::drawPlain
virtual void drawPlain(const QColor &color)
A function that clears the whole image in a given Color.
Definition: IntelliImage.cpp:105
IntelliTool::Tooltype::CIRCLE
IntelliToolLine
The IntelliToolFloodFill class represents a tool to draw a line.
Definition: IntelliToolLine.h:10