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