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"
13 #include "Tool/IntelliToolPen.h"
14 #include "Tool/IntelliToolPlain.h"
15 #include "Tool/IntelliToolLine.h"
16 #include "Tool/IntelliToolCircle.h"
20 
21 
22 PaintingArea::PaintingArea(int maxWidth, int maxHeight, QWidget*parent)
23  : QWidget(parent){
24  this->Tool = nullptr;
25  this->setLayerDimensions(maxWidth, maxHeight);
26 
27  activeLayer = -1;
28 }
29 
31  delete Tool;
32 }
33 
34 void PaintingArea::setRenderSettings(bool isFastRenderingOn){
35  if(isFastRenderingOn != renderSettings.isFastRenderering() && !Tool->getIsDrawing()) {
36  renderSettings.setFastRendering(isFastRenderingOn);
37  for(auto& layer : layerBundle) {
38  layer.image->updateRendererSetting(isFastRenderingOn);
39  }
40  }
41 }
42 
43 void PaintingArea::setLayerDimensions(int maxWidth, int maxHeight){
44  //set standart parameter
45  this->maxWidth = maxWidth;
46  this->maxHeight = maxHeight;
47  Canvas = new QImage(maxWidth,maxHeight, QImage::Format_ARGB32);
48 
49  // Roots the widget to the top left even if resized
50  setAttribute(Qt::WA_StaticContents);
51 
52 }
53 
54 int PaintingArea::addLayer(int width, int height, int widthOffset, int heightOffset, IntelliImage::ImageType type){
55  LayerObject newLayer;
56  updateTools();
57  newLayer.width = width;
58  newLayer.height = height;
59  newLayer.widthOffset = widthOffset;
60  newLayer.heightOffset = heightOffset;
62  newLayer.image = new IntelliRasterImage(width,height,renderSettings.isFastRenderering());
63  }else if(type==IntelliImage::ImageType::SHAPEDIMAGE) {
64  newLayer.image = new IntelliShapedImage(width, height, renderSettings.isFastRenderering());
65  }
66  newLayer.alpha = 255;
67  this->layerBundle.push_back(newLayer);
68  activeLayer = static_cast<int>(layerBundle.size()) - 1;
69  return activeLayer;
70 }
71 
72 
73 void PaintingArea::deleteLayer(int idx, bool isTool){
74  if(!isTool) {
75  updateTools();
76  }
77  if(idx<static_cast<int>(layerBundle.size())) {
78  this->layerBundle.erase(layerBundle.begin() + idx);
79  if(activeLayer>=idx) {
80  activeLayer--;
81  }
82  if(activeLayer < 0 && layerBundle.size()) {
83  activeLayer = 0;
84  }
85  }
86 }
87 
89  if(activeLayer>=0 && activeLayer < static_cast<int>(layerBundle.size())) {
90  this->layerBundle.erase(layerBundle.begin() + activeLayer);
91  activeLayer--;
92  }
93 }
94 
96  updateTools();
97  if(idx>=0&&idx<static_cast<int>(layerBundle.size())) {
98  this->activeLayer = idx;
99  }
100 }
101 
102 void PaintingArea::setLayerAlpha(int idx, int alpha){
103  if(idx>=0&&idx<static_cast<int>(layerBundle.size())) {
104  layerBundle[static_cast<size_t>(idx)].alpha = alpha;
105  }
106 }
108  if(idx>=0&&idx<static_cast<int>(layerBundle.size())) {
109  if(layerBundle[static_cast<size_t>(idx)].image->getTypeOfImage()==IntelliImage::ImageType::SHAPEDIMAGE) {
110  delete this->Tool;
111  this->Tool = new IntelliToolPolygon(this,&colorPicker,&Toolsettings, true);
112  isSettingPolygon = true;
113  this->DummyGui->setToolWidth(5);
114  }
115  }
116 }
117 
118 // Used to load the image and place it in the widget
119 bool PaintingArea::open(const QString &filePath){
120  if(this->activeLayer==-1) {
121  return false;
122  }
123  IntelliImage* active = layerBundle[static_cast<size_t>(activeLayer)].image;
124  bool open = active->loadImage(filePath);
125  active->calculateVisiblity();
126  update();
127  return open;
128 }
129 
130 // Save the current image
131 bool PaintingArea::save(const QString &filePath, const char*fileFormat){
132  if(layerBundle.size()==0) {
133  return false;
134  }
135  this->drawLayers(true);
136 
137  if(!strcmp(fileFormat,"PNG")) {
138  QImage visibleImage = Canvas->convertToFormat(QImage::Format_Indexed8);
139  fileFormat = "png";
140  if (visibleImage.save(filePath, fileFormat)) {
141  return true;
142  } else {
143  return false;
144  }
145  }
146 
147  if (Canvas->save(filePath, fileFormat)) {
148  return true;
149  } else {
150  return false;
151  }
152 }
153 
155  updateTools();
156  layerBundle[static_cast<size_t>(activeLayer)].widthOffset += x;
157  layerBundle[static_cast<size_t>(activeLayer)].heightOffset += y;
158 }
159 
161  updateTools();
162  if(idx==1) {
163  this->selectLayerUp();
164  }else if(idx==-1) {
165  this->selectLayerDown();
166  }
167  DummyGui->UpdateGui();
168 }
169 
171  updateTools();
172  if(a>=0 && a < static_cast<int>(layerBundle.size())) {
173  this->setLayerActive(a);
174  }
175 }
176 
178  QColor clr = QColorDialog::getColor(colorPicker.getFirstColor(), nullptr, "Main Color", QColorDialog::DontUseNativeDialog);
179  this->colorPicker.setFirstColor(clr);
180 }
181 
183  QColor clr = QColorDialog::getColor(colorPicker.getSecondColor(), nullptr, "Secondary Color", QColorDialog::DontUseNativeDialog);
184  this->colorPicker.setSecondColor(clr);
185 }
186 
188  this->colorPicker.swapColors();
189 }
190 
192  delete this->Tool;
193  Tool = new IntelliToolPen(this, &colorPicker, &Toolsettings);
194 }
195 
197  delete this->Tool;
198  Tool = new IntelliToolPlainTool(this, &colorPicker, &Toolsettings);
199 }
200 
202  delete this->Tool;
203  Tool = new IntelliToolLine(this, &colorPicker, &Toolsettings);
204 }
205 
207  delete this->Tool;
208  Tool = new IntelliToolRectangle(this, &colorPicker, &Toolsettings);
209 }
210 
212  delete this->Tool;
213  Tool = new IntelliToolCircle(this, &colorPicker, &Toolsettings);
214 }
216  delete this->Tool;
217  Tool = new IntelliToolPolygon(this, &colorPicker, &Toolsettings);
218 }
219 
221  delete this->Tool;
222  Tool = new IntelliToolFloodFill(this, &colorPicker, &Toolsettings);
223 }
224 
226  return this->layerBundle[static_cast<unsigned long long>(activeLayer)].width;
227 }
228 
230  return this->layerBundle[static_cast<unsigned long long>(activeLayer)].height;
231 }
232 
234  return this->maxWidth;
235 }
236 
238  return this->maxHeight;
239 }
240 
242  return this->layerBundle[static_cast<unsigned long long>(activeLayer)].image->getTypeOfImage();
243 }
244 
246  return this->layerBundle[static_cast<unsigned long long>(activeLayer)].image->getPolygonData();
247 }
248 
249 // If a mouse button is pressed check if it was the
250 // left button and if so store the current position
251 // Set that we are currently drawing
252 void PaintingArea::mousePressEvent(QMouseEvent*event){
253  if(this->activeLayer < 0) {
254  return;
255  }
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(this->activeLayer < 0) {
273  return;
274  }
275  if(Tool == nullptr)
276  return;
277  int x = event->x() - layerBundle[static_cast<unsigned long long>(activeLayer)].widthOffset;
278  int y = event->y() - layerBundle[static_cast<unsigned long long>(activeLayer)].heightOffset;
279  Tool->onMouseMoved(x, y);
280  update();
281 }
282 
283 // If the button is released we set variables to stop drawing
284 void PaintingArea::mouseReleaseEvent(QMouseEvent*event){
285  if(this->activeLayer < 0)
286  return;
287  if(Tool == nullptr)
288  return;
289  int x = event->x() - layerBundle[static_cast<unsigned long long>(activeLayer)].widthOffset;
290  int y = event->y() - layerBundle[static_cast<unsigned long long>(activeLayer)].heightOffset;
291  if(event->button() == Qt::LeftButton) {
292  Tool->onMouseLeftReleased(x, y);
293  }else if(event->button() == Qt::RightButton) {
294  Tool->onMouseRightReleased(x, y);
295  }
296  update();
297 }
298 
299 void PaintingArea::wheelEvent(QWheelEvent*event){
300  if(this->activeLayer < 0)
301  return;
302  if(this->Tool != nullptr) {
303  QPoint numDegrees = event->angleDelta() / 8;
304  if(!numDegrees.isNull()) {
305  QPoint numSteps = numDegrees / 15;
306  Tool->onWheelScrolled(numSteps.y() * -1);
307  }
308  }
309 }
310 
311 // QPainter provides functions to draw on the widget
312 // The QPaintEvent is sent to widgets that need to
313 // update themselves
314 void PaintingArea::paintEvent(QPaintEvent*event){
315  this->drawLayers();
316 
317  QPainter painter(this);
318  QRect dirtyRec = event->rect();
319  painter.drawImage(dirtyRec, *Canvas, dirtyRec);
320  update();
321 }
322 
323 //TODOJ Resize the image to slightly larger then the main window
324 // to cut down on the need to resize the image
325 void PaintingArea::resizeEvent(QResizeEvent*event){
326  //TODO wait till tool works
327  update();
328 }
329 
330 void PaintingArea::resizeLayer(QImage*image_res, const QSize &newSize){
331  //TODO implement
332 }
333 
334 void PaintingArea::selectLayerUp(){
335  updateTools();
336  if(activeLayer!=-1 && static_cast<unsigned long long>(activeLayer)<layerBundle.size() - 1) {
337  std::swap(layerBundle[static_cast<unsigned long long>(activeLayer)], layerBundle[static_cast<unsigned long long>(activeLayer + 1)]);
338  activeLayer++;
339  }
340 }
341 
342 void PaintingArea::selectLayerDown(){
343  updateTools();
344  if(activeLayer!=-1 && activeLayer>0) {
345  std::swap(layerBundle[static_cast<unsigned long long>(activeLayer)], layerBundle[static_cast<unsigned long long>(activeLayer - 1)]);
346  activeLayer--;
347  }
348 }
349 
350 void PaintingArea::drawLayers(bool forSaving){
351  if(forSaving) {
352  Canvas->fill(Qt::GlobalColor::transparent);
353  }else{
354  Canvas->fill(Qt::GlobalColor::black);
355  }
356  for(size_t i = 0; i<layerBundle.size(); i++) {
357  LayerObject layer = layerBundle[i];
358  QImage cpy = layer.image->getDisplayable(layer.alpha);
359  QColor clr_0;
360  QColor clr_1;
361  for(int y = 0; y<layer.height; y++) {
362  if(layer.heightOffset + y<0) continue;
363  if(layer.heightOffset + y>=maxHeight) break;
364  for(int x = 0; x<layer.width; x++) {
365  if(layer.widthOffset + x<0) continue;
366  if(layer.widthOffset + x>=maxWidth) break;
367  clr_0 = Canvas->pixelColor(layer.widthOffset + x, layer.heightOffset + y);
368  clr_1 = cpy.pixelColor(x,y);
369  float t = static_cast<float>(clr_1.alpha()) / 255.f;
370  int r = static_cast<int>(static_cast<float>(clr_1.red()) * (t) + static_cast<float>(clr_0.red()) * (1.f - t) + 0.5f);
371  int g = static_cast<int>(static_cast<float>(clr_1.green()) * (t) + static_cast<float>(clr_0.green()) * (1.f - t) + 0.5f);
372  int b = static_cast<int>(static_cast<float>(clr_1.blue()) * (t) + static_cast<float>(clr_0.blue() * (1.f - t)) + 0.5f);
373  int a = std::min(clr_0.alpha() + clr_1.alpha(), 255);
374  clr_0.setRed(r);
375  clr_0.setGreen(g);
376  clr_0.setBlue(b);
377  clr_0.setAlpha(a);
378 
379  Canvas->setPixelColor(layer.widthOffset + x, layer.heightOffset + y, clr_0);
380  }
381  }
382  }
383 }
384 
385 bool PaintingArea::createTempTopLayer(int idx){
386  if(idx>=0) {
387  LayerObject newLayer;
388  newLayer.alpha = 255;
389  newLayer.height = layerBundle[static_cast<unsigned long long>(idx)].height;
390  newLayer.width = layerBundle[static_cast<unsigned long long>(idx)].width;
391  newLayer.heightOffset = layerBundle[static_cast<unsigned long long>(idx)].heightOffset;
392  newLayer.widthOffset = layerBundle[static_cast<unsigned long long>(idx)].widthOffset;
393  newLayer.image = layerBundle[static_cast<unsigned long long>(idx)].image->getDeepCopy();
394  layerBundle.insert(layerBundle.begin() + idx + 1,newLayer);
395  return true;
396  }
397  return false;
398 }
399 
400 IntelliTool* PaintingArea::copyActiveTool(){
401  switch(Tool->getTooltype()) {
409  default: return nullptr;
410  }
411 }
412 
414  return activeLayer;
415 }
416 
418  if(activeLayer<0) {
419  return nullptr;
420  }
421  return layerBundle[static_cast<size_t>(activeLayer)].image;
422 }
423 
425  QImage returnImage;
426  if(activeLayer<0) {
427  returnImage = QImage(QSize(10,10),QImage::Format_ARGB32);
428  returnImage.fill(QColor(255,255,255,255));
429  }
430  else{
431  returnImage = layerBundle[static_cast<size_t>(activeLayer)].image->getImageData();
432  if(renderSettings.isFastRenderering()) {
433  returnImage = returnImage.convertToFormat(QImage::Format_ARGB32);
434  }
435  }
436  return returnImage;
437 }
438 
439 void PaintingArea::updateTools(){
440  if(Tool!=nullptr) {
441  if(Tool->getIsDrawing()) {
442  IntelliTool* temp = copyActiveTool();
443  delete this->Tool;
444  this->Tool = temp;
445  }
446  if(isSettingPolygon) {
447  delete this->Tool;
448  this->Tool = nullptr;
449  isSettingPolygon = false;
450  }
451  }
452 }
PaintingArea::getWidthOfActive
int getWidthOfActive()
The getWidthOfActive gets the horizontal dimensions of the active layer.
Definition: PaintingArea.cpp:225
IntelliTool::Tooltype::PEN
@ PEN
PaintingArea::createCircleTool
void createCircleTool()
Definition: PaintingArea.cpp:211
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::setRenderSettings
void setRenderSettings(bool isFastRenderingOn)
setRenderSettings updates all Images to the new Rendersetting.
Definition: PaintingArea.cpp:34
PaintingArea::getImageOfActiveLayer
IntelliImage * getImageOfActiveLayer()
Definition: PaintingArea.cpp:417
PaintingArea::mouseReleaseEvent
void mouseReleaseEvent(QMouseEvent *event) override
Definition: PaintingArea.cpp:284
PaintingArea::createRectangleTool
void createRectangleTool()
Definition: PaintingArea.cpp:206
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
PaintingArea::getMaxWidth
int getMaxWidth()
Definition: PaintingArea.cpp:233
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:131
PaintingArea::setLayerAlpha
void setLayerAlpha(int idx, int alpha)
The setAlphaOfLayer method sets the alpha value of a specific layer.
Definition: PaintingArea.cpp:102
IntelliTool::Tooltype::FLOODFILL
@ FLOODFILL
PaintingArea::setLayerActive
void setLayerActive(int idx)
The setLayerToActive method marks a specific layer as active.
Definition: PaintingArea.cpp:95
LayerObject::widthOffset
int widthOffset
Definition: PaintingArea.h:29
PaintingArea::getMaxHeight
int getMaxHeight()
Definition: PaintingArea.cpp:237
PaintingArea::deleteLayer
void deleteLayer(int idx, bool isTool=false)
The deleteLayer method removes a layer at a given idx.
Definition: PaintingArea.cpp:73
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::getHeightOfActive
int getHeightOfActive()
The getHeightOfActive gets the vertical dimensions of the active layer.
Definition: PaintingArea.cpp:229
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:196
PaintingArea::wheelEvent
void wheelEvent(QWheelEvent *event) override
Definition: PaintingArea.cpp:299
LayerObject
The LayerObject struct holds all the information needed to construct a layer.
Definition: PaintingArea.h:25
PaintingArea::createPenTool
void createPenTool()
Definition: PaintingArea.cpp:191
IntelliToolPlain.h
PaintingArea::mousePressEvent
void mousePressEvent(QMouseEvent *event) override
Definition: PaintingArea.cpp:252
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:201
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:182
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:177
IntelliTool::Tooltype::PLAIN
@ PLAIN
IntelliTool::Tooltype::POLYGON
@ POLYGON
IntelliTool::getTooltype
Tooltype getTooltype()
Definition: IntelliTool.cpp:96
PaintingArea::getTypeOfImageRealLayer
IntelliImage::ImageType getTypeOfImageRealLayer()
Definition: PaintingArea.cpp:241
LayerObject::width
int width
Definition: PaintingArea.h:27
IntelliToolRectangle.h
IntelliRenderSettings::isFastRenderering
bool isFastRenderering()
The getfastRenderer gets the value of the flag for the fastRenderer setting.
Definition: IntelliRenderSettings.cpp:12
PaintingArea::~PaintingArea
~PaintingArea() override
This deconstructor is used to clear up the memory and remove the currently active window.
Definition: PaintingArea.cpp:30
PaintingArea::mouseMoveEvent
void mouseMoveEvent(QMouseEvent *event) override
Definition: PaintingArea.cpp:271
PaintingArea::getNumberOfActiveLayer
int getNumberOfActiveLayer()
Definition: PaintingArea.cpp:413
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
@ SHAPEDIMAGE
PaintingArea::slotDeleteActiveLayer
void slotDeleteActiveLayer()
The slotDeleteActiveLayer method handles the deletion of the active layer.
Definition: PaintingArea.cpp:88
IntelliPhotoGui::setToolWidth
void setToolWidth(int value)
Definition: IntelliPhotoGui.cpp:790
PaintingArea::open
bool open(const QString &filePath)
The open method is used for loading a picture into the current layer.
Definition: PaintingArea.cpp:119
PaintingArea::createPolygonTool
void createPolygonTool()
Definition: PaintingArea.cpp:215
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:182
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:22
IntelliTool::getIsDrawing
bool getIsDrawing()
Definition: IntelliTool.cpp:100
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::getImageDataOfActiveLayer
QImage getImageDataOfActiveLayer()
getImageDataOfActiveLayer used to get the currents active imageData (if there isn't any active layer ...
Definition: PaintingArea.cpp:424
PaintingArea::createFloodFillTool
void createFloodFillTool()
Definition: PaintingArea.cpp:220
PaintingArea::slotActivateLayer
void slotActivateLayer(int a)
The slotActivateLayer method handles the event of selecting one layer as active.
Definition: PaintingArea.cpp:170
PaintingArea::paintEvent
void paintEvent(QPaintEvent *event) override
Definition: PaintingArea.cpp:314
IntelliRenderSettings::setFastRendering
void setFastRendering(bool Updatedsetting)
setFastRendering sets fastRendering to Updatedsetting.
Definition: IntelliRenderSettings.cpp:8
IntelliPhotoGui::UpdateGui
void UpdateGui()
Definition: IntelliPhotoGui.cpp:799
IntelliImage::ImageType::RASTERIMAGE
@ RASTERIMAGE
IntelliTool::Tooltype::RECTANGLE
@ 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:245
PaintingArea::Toolsettings
IntelliToolsettings Toolsettings
Definition: PaintingArea.h:181
PaintingArea::resizeEvent
void resizeEvent(QResizeEvent *event) override
Definition: PaintingArea.cpp:325
PaintingArea::setPolygon
void setPolygon(int idx)
setPolygon is used for setting polygondata, it only works on RASTER images
Definition: PaintingArea.cpp:107
IntelliTool::Tooltype::LINE
@ 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:187
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:154
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:43
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:48
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:54
IntelliImage::ImageType
ImageType
The Types, which an Image can be.
Definition: IntelliImage.h:26
IntelliTool::Tooltype::CIRCLE
@ CIRCLE
IntelliToolLine
The IntelliToolFloodFill class represents a tool to draw a line.
Definition: IntelliToolLine.h:10