IntelliPhoto  0.6
IntelliPhotoGui.cpp
Go to the documentation of this file.
1 // ---------- IntelliPhotoGui.cpp ----------
2 
3 #include "IntelliPhotoGui.h"
4 #include "Layer/PaintingArea.h"
5 
6 #include <QEvent>
7 #include <QCloseEvent>
8 #include <QDebug>
9 #include <string>
10 
11 // IntelliPhotoGui constructor
13  // create Gui elements and lay them out
14  createGui();
15  // Create actions
16  createActions();
17  // create Menus
18  createMenus();
19  // set style of the gui
20  setIntelliStyle();
21  // Size the app
22  resize(600,600);
23  setDefaultValues();
24 }
25 
26 // User tried to close the app
27 void IntelliPhotoGui::closeEvent(QCloseEvent*event){
28  // If they try to close maybeSave() returns true
29  // if no changes have been made and the app closes
30  if (maybeSave()) {
31  event->accept();
32  } else {
33  // If there have been changes ignore the event
34  event->ignore();
35  }
36 }
37 
38 // Check if the current image has been changed and then
39 // open a dialog to open a file
40 void IntelliPhotoGui::slotOpen(){
41  // Check if changes have been made since last save
42  // maybeSave() returns true if no changes have been made
43  if (maybeSave()) {
44 
45  // Get the file to open from a dialog
46  // tr sets the window title to Open File
47  // QDir opens the current dirctory
48  QString fileName = QFileDialog::getOpenFileName(this,
49  tr("Open File"), QDir::currentPath(), nullptr, nullptr, QFileDialog::DontUseNativeDialog);
50 
51  // If we have a file name load the image and place
52  // it in the paintingArea
53  if (!fileName.isEmpty()) {
54  bool rightFileType = true;
55  if(fileName.size()>=4) {
56  QString endung(".idf");
57  int length = fileName.size();
58  for(int i = 0; i<4; i++) {
59  if(endung[i]!=fileName[length - 4 + i]) {
60  rightFileType = false;
61  break;
62  }
63  }
64  }
65 
66  if(rightFileType) {
67  IntelliDatamanager::loadProject(paintingArea,fileName);
68  UpdateGui();
69 
70  }
71  else{
72  paintingArea->open(fileName);
73  }
74  }
75  }
76 }
77 
78 // Called when the user clicks Save As in the menu
79 void IntelliPhotoGui::slotSave(){
80  // A QAction represents the action of the user clicking
81  QAction*action = qobject_cast<QAction*>(sender());
82 
83  // Stores the array of bytes of the users data
84  QByteArray fileFormat = action->data().toByteArray();
85 
86  // Pass it to be saved
87  saveFile(fileFormat);
88 }
89 
90 // Opens a dialog that allows the user to create a New RASTER Layer
91 void IntelliPhotoGui::slotCreateNewRasterLayer(){
92  // Stores button value
93  bool ok1, ok2;
94 
95  // "New Layer" is the title of the window
96  // the next tr is the text to display
97  // Define the standard Value, min, max, step and ok button
98  int width = IntelliInputDialog::getInt("New Raster Layer", "Width:", 200, 1, paintingArea->getMaxWidth(), 1, &ok1);
99 
100  int height = IntelliInputDialog::getInt("New Raster Layer", "Height:", 200, 1, paintingArea->getMaxHeight(), 1, &ok2);
101 
102  // Create New Layer
103  if (ok1&&ok2) {
104  paintingArea->addLayer(width,height,0,0,255,ImageType::RASTERIMAGE);
105  UpdateGui();
106  }
107 }
108 
109 // Opens a dialog that allows the user to create a New SHAPED Layer
110 void IntelliPhotoGui::slotCreateNewShapedLayer(){
111  // Stores button value
112  bool ok1, ok2;
113 
114  // "New Layer" is the title of the window
115  // the next tr is the text to display
116  // Define the standard Value, min, max, step and ok button
117  int width = IntelliInputDialog::getInt("New Shaped Layer", "Width:", 200, 1, paintingArea->getMaxWidth(), 1, &ok1);
118 
119  int height = IntelliInputDialog::getInt("New Shaped Layer", "Height:", 200, 1, paintingArea->getMaxHeight(), 1, &ok2);
120 
121  // Create New Layer
122  if (ok1&&ok2) {
123  paintingArea->addLayer(width, height, 0, 0,255, ImageType::SHAPEDIMAGE);
124  UpdateGui();
125  }
126 }
127 
128 // Opens a dialog that allows the user to change Dimension
129 void IntelliPhotoGui::slotChangeDim(){
130  // Stores button value
131  bool ok1, ok2;
132 
133  // "change Dimension" is the title of the window
134  // the next tr is the text to display
135  // Define the standard Value, min, step and ok button
136  int width = IntelliInputDialog::getInt("New Canvas Size", "Width:", 600, 1, 50000, 1, &ok1);
137 
138  int height = IntelliInputDialog::getInt("New Canvas Size", "Height:", 600, 1, 50000, 1, &ok2);
139 
140 
141  // Change dimension
142  if (ok1&&ok2) {
143  paintingArea->setLayerDimensions(width,height);
144  UpdateGui();
145  }
146 }
147 
148 // Opens a dialog that allows the user to delete a Layer
149 void IntelliPhotoGui::slotDeleteLayer(){
150 
151  bool ok1;
152  // "delete Layer" is the title of the window
153  // the next tr is the text to display
154  // Define the standard Value, min, max, step and ok button
155  int layerNumber = IntelliInputDialog::getInt("Delete Layer", "Number:", paintingArea->getNumberOfActiveLayer() + 1, 1, static_cast<int>(paintingArea->layerBundle.size()), 1, &ok1);
156 
157  // Create New Layer
158  if(ok1) {
159  paintingArea->deleteLayer(layerNumber - 1);
160  UpdateGui();
161  }
162 }
163 
164 void IntelliPhotoGui::slotSetActiveAlpha(){
165 
166  bool ok1, ok2;
167  // "Layer to set on" is the title of the window
168  // the next tr is the text to display
169  // Define the standard Value, min, max, step and ok button
170 
171  int layer = IntelliInputDialog::getInt("Layer to set on", "Layer:", paintingArea->getNumberOfActiveLayer() + 1, 1, static_cast<int>(paintingArea->layerBundle.size()), 1, &ok1);
172 
173  // "New Alpha" is the title of the window
174  int alpha = IntelliInputDialog::getInt("Layer to set on", "Alpha:", 255, 0, 255, 1, &ok2);
175 
176  if (ok1&&ok2)
177  {
178  paintingArea->setLayerAlpha(layer - 1,alpha);
179  UpdateGui();
180  }
181 }
182 
183 void IntelliPhotoGui::slotSetPolygon(){
184  // Stores button value
185  bool ok1;
186 
187  // "Layer to set on" is the title of the window
188  // the next tr is the text to display
189  // Define the standard Value, min, max, step and ok button
190  int layer = IntelliInputDialog::getInt("Layer to set on", "Layer:", paintingArea->getNumberOfActiveLayer() + 1, 1, static_cast<int>(paintingArea->layerBundle.size()), 1, &ok1);
191 
192  if (ok1)
193  {
194  paintingArea->setPolygon(layer - 1);
195  UpdateGui();
196  }
197 }
198 
199 void IntelliPhotoGui::slotPositionMoveUp(){
200  paintingArea->movePositionActive(0,-20);
201  update();
202 }
203 
204 void IntelliPhotoGui::slotPositionMoveDown(){
205  paintingArea->movePositionActive(0,20);
206  update();
207 }
208 
209 void IntelliPhotoGui::slotPositionMoveLeft(){
210  paintingArea->movePositionActive(-20,0);
211  update();
212 }
213 
214 void IntelliPhotoGui::slotPositionMoveRight(){
215  paintingArea->movePositionActive(20,0);
216  update();
217 }
218 
219 void IntelliPhotoGui::slotMoveLayerUp(){
220  paintingArea->moveActiveLayer(1);
221  update();
222 }
223 
224 void IntelliPhotoGui::slotMoveLayerDown(){
225  paintingArea->moveActiveLayer(-1);
226  update();
227 }
228 
229 void IntelliPhotoGui::slotSetActiveLayer(){
230  bool ok1;
231  // "Layer to set on" is the title of the window
232  // the next tr is the text to display
233  // Define the standard Value, min, max, step and ok button
234  int layer = IntelliInputDialog::getInt("Layer to set on", "Layer:", 1, 1, static_cast<int>(paintingArea->layerBundle.size()), 1, &ok1);
235 
236  if(ok1) {
237  paintingArea->setLayerActive(layer - 1);
238  UpdateGui();
239  }
240 }
241 
242 void IntelliPhotoGui::slotUpdateRenderSettingsOn(){
243  paintingArea->setRenderSettings(true);
244  UpdateGui();
245 }
246 
247 void IntelliPhotoGui::slotUpdateRenderSettingsOff(){
248  paintingArea->setRenderSettings(false);
249  UpdateGui();
250 }
251 
252 void IntelliPhotoGui::slotSetFirstColor(){
253  paintingArea->colorPickerSetFirstColor();
254  UpdateGui();
255 }
256 
257 void IntelliPhotoGui::slotSetSecondColor(){
258  paintingArea->colorPickerSetSecondColor();
259  UpdateGui();
260 }
261 
262 void IntelliPhotoGui::slotSwapColor(){
263  paintingArea->colorPickerSwapColors();
264  UpdateGui();
265 }
266 
267 void IntelliPhotoGui::slotCreatePenTool(){
268  PenButton->setChecked(true);
269  paintingArea->createPenTool();
270 }
271 
272 void IntelliPhotoGui::slotCreatePlainTool(){
273  PlainButton->setChecked(true);
274  paintingArea->createPlainTool();
275 }
276 
277 void IntelliPhotoGui::slotCreateLineTool(){
278  LineButton->setChecked(true);
279  paintingArea->createLineTool();
280 }
281 
282 void IntelliPhotoGui::slotCreateRectangleTool(){
283  RectangleButton->setChecked(true);
284  paintingArea->createRectangleTool();
285 }
286 
287 void IntelliPhotoGui::slotCreateCircleTool(){
288  CircleButton->setChecked(true);
289  paintingArea->createCircleTool();
290 }
291 
292 void IntelliPhotoGui::slotCreatePolygonTool(){
293  PolygonButton->setChecked(true);
294  paintingArea->createPolygonTool();
295 }
296 
297 void IntelliPhotoGui::slotCreateFloodFillTool(){
298  FloodFillButton->setChecked(true);
299  paintingArea->createFloodFillTool();
300 }
301 
302 // Open an about dialog
303 void IntelliPhotoGui::slotAboutDialog(){
304  // Window title and text to display
305  QMessageBox::about(this, tr("About Painting"),
306  tr("<p><b>IntelliPhoto - </b>A Pretty basic editor.</p> <br>Developed by Team 7."));
307 }
308 
309 void IntelliPhotoGui::slotEnterPressed(){
310  QString string = EditLineWidth->text();
311  if(string.toInt() > 50) {
312  EditLineWidth->setText("50");
313  }
314  paintingArea->Toolsettings.setLineWidth(string.toInt());
315  string = EditLineInnerAlpha->text();
316  if(string.toInt() > 255) {
317  EditLineInnerAlpha->setText("255");
318  }
319  paintingArea->Toolsettings.setInnerAlpha(string.toInt());
320 }
321 
322 void IntelliPhotoGui::slotResetTools(){
323  CircleButton->setChecked(false);
324  FloodFillButton->setChecked(false);
325  LineButton->setChecked(false);
326  PenButton->setChecked(false);
327  PlainButton->setChecked(false);
328  PolygonButton->setChecked(false);
329  RectangleButton->setChecked(false);
330 }
331 
332 void IntelliPhotoGui::slotSetWidth(){
333  bool ok1;
334  int temp = IntelliInputDialog::getInt("Toolsettings", "Width:", 5, 1, 50, 1, &ok1);
335  if(ok1) {
336  paintingArea->Toolsettings.setLineWidth(temp);
337  EditLineWidth->setText(QString("%1").arg(temp));
338  }
339 }
340 
341 void IntelliPhotoGui::slotSetInnerAlpha(){
342  bool ok1;
343  int temp = IntelliInputDialog::getInt("Toolsettings", "Alpha:", 5, 1, 50, 1, &ok1);
344  if(ok1) {
345  paintingArea->Toolsettings.setInnerAlpha(temp);
346  EditLineInnerAlpha->setText(QString("%1").arg(temp));
347  }
348 }
349 
350 void IntelliPhotoGui::slotGoBack(){
351  paintingArea->historyGoBack();
352 }
353 
354 void IntelliPhotoGui::slotGoForward(){
355  paintingArea->historyGoForward();
356 }
357 
358 // Define menu actions that call functions
359 void IntelliPhotoGui::createActions(){
360  // Get a list of the supported file formats
361  // QImageWriter is used to write images to files
362  foreach (QByteArray format, QImageWriter::supportedImageFormats()) {
363  QString text = tr("%1...").arg(QString(format).toUpper());
364 
365  // Create an action for each file format
366  QAction*action = new QAction(text, this);
367 
368  // Set an action for each file format
369  action->setData(format);
370 
371  // When clicked call IntelliPhotoGui::save()
372  connect(action, SIGNAL(triggered()), this, SLOT(slotSave()));
373 
374  // Attach each file format option menu item to Save As
375  actionSaveAs.append(action);
376  }
377 
378  //set exporter to actions
379  QAction*pngSaveAction = new QAction("PNG-8", this);
380  pngSaveAction->setData("PNG");
381  // When clicked call IntelliPhotoGui::save()
382  connect(pngSaveAction, SIGNAL(triggered()), this, SLOT(slotSave()));
383  // Attach each PNG in save Menu
384  actionSaveAs.append(pngSaveAction);
385  pngSaveAction->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_S));
386 
387  QAction*projectSaveAction = new QAction("Projekt", this);
388  projectSaveAction->setData("idf");
389  // When clicked call IntelliPhotoGui::save()
390  connect(projectSaveAction, SIGNAL(triggered()), this, SLOT(slotSave()));
391  // Attach each PNG in save Menu
392  actionSaveAs.append(projectSaveAction);
393  projectSaveAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_S));
394 
395  // Create exit action and tie to IntelliPhotoGui::close()
396  actionExit = new QAction(tr("&Exit"), this);
397  actionExit->setShortcuts(QKeySequence::Quit);
398  connect(actionExit, SIGNAL(triggered()), this, SLOT(close()));
399 
400  actionOpen = new QAction(tr("&Open"), this);
401  actionOpen->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_O));
402  connect(actionOpen, SIGNAL(triggered()), this, SLOT(slotOpen()));
403 
404  // Create New RASTER Layer action and tie to IntelliPhotoGui::newLayer()
405  actionCreateNewRasterLayer = new QAction(tr("&Raster Image"), this);
406  actionCreateNewRasterLayer->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_N));
407  connect(actionCreateNewRasterLayer, SIGNAL(triggered()), this, SLOT(slotCreateNewRasterLayer()));
408 
409 
410  // Create New SHAPED Layer action and tie to IntelliPhotoGui::newLayer()
411  actionCreateNewShapedLayer = new QAction(tr("&Shaped Image"), this);
412  actionCreateNewShapedLayer->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_N + Qt::ALT));
413  connect(actionCreateNewShapedLayer, SIGNAL(triggered()), this, SLOT(slotCreateNewShapedLayer()));
414 
415  // Delete New Layer action and tie to IntelliPhotoGui::deleteLayer()
416  actionDeleteLayer = new QAction(tr("&Delete Layer..."), this);
417  actionDeleteLayer->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_D));
418  connect(actionDeleteLayer, SIGNAL(triggered()), this, SLOT(slotDeleteLayer()));
419 
420  actionChangeDim = new QAction(tr("&Change Dimension"), this);
421  actionChangeDim->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_X));
422  connect(actionChangeDim, SIGNAL(triggered()), this, SLOT(slotChangeDim()));
423  connect(dimCanvas, SIGNAL(clicked()), this, SLOT(slotChangeDim()));
424 
425  actionSetActiveLayer = new QAction(tr("&set Active"), this);
426  actionSetActiveLayer->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_A));
427  connect(actionSetActiveLayer, SIGNAL(triggered()), this, SLOT(slotSetActiveLayer()));
428 
429  actionSetActiveAlpha = new QAction(tr("&set Alpha"), this);
430  actionSetActiveAlpha->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_A));
431  connect(actionSetActiveAlpha, SIGNAL(triggered()), this, SLOT(slotSetActiveAlpha()));
432 
433  actionSetPolygon = new QAction(tr("&set new Polygondata"), this);
434  actionSetPolygon->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_P));
435  connect(actionSetPolygon, SIGNAL(triggered()), this, SLOT(slotSetPolygon()));
436 
437  actionMovePositionUp = new QAction(tr("&move Up"), this);
438  actionMovePositionUp->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Up));
439  connect(actionMovePositionUp, SIGNAL(triggered()), this, SLOT(slotPositionMoveUp()));
440 
441  actionMovePositionDown = new QAction(tr("&move Down"), this);
442  actionMovePositionDown->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Down));
443  connect(actionMovePositionDown, SIGNAL(triggered()), this, SLOT(slotPositionMoveDown()));
444 
445  actionMovePositionLeft = new QAction(tr("&move Left"), this);
446  actionMovePositionLeft->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Left));
447  connect(actionMovePositionLeft, SIGNAL(triggered()), this, SLOT(slotPositionMoveLeft()));
448 
449  actionMovePositionRight = new QAction(tr("&move Right"), this);
450  actionMovePositionRight->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Right));
451  connect(actionMovePositionRight, SIGNAL(triggered()), this, SLOT(slotPositionMoveRight()));
452 
453  actionMoveLayerUp = new QAction(tr("&move Layer Up"), this);
454  actionMoveLayerUp->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_Up));
455  connect(actionMoveLayerUp, SIGNAL(triggered()), this, SLOT(slotMoveLayerUp()));
456 
457  actionMoveLayerDown = new QAction(tr("&move Layer Down"), this);
458  actionMoveLayerDown->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_Down));
459  connect(actionMoveLayerDown, SIGNAL(triggered()), this, SLOT(slotMoveLayerDown()));
460 
461  //Create Update RenderSettings Actions here
462  actionUpdateRenderSettingsOn = new QAction(tr("&On"), this);
463  actionUpdateRenderSettingsOn->setShortcut(QKeySequence(Qt::ALT + Qt::SHIFT + +Qt::Key_A));
464  connect(actionUpdateRenderSettingsOn, SIGNAL(triggered()),this, SLOT(slotUpdateRenderSettingsOn()));
465 
466  actionUpdateRenderSettingsOff = new QAction(tr("&Off"), this);
467  actionUpdateRenderSettingsOff->setShortcut(QKeySequence(Qt::ALT + Qt::SHIFT + +Qt::Key_D));
468  connect(actionUpdateRenderSettingsOff, SIGNAL(triggered()),this, SLOT(slotUpdateRenderSettingsOff()));
469 
470  //Create Color Actions here
471  actionColorPickerFirstColor = new QAction(tr("&Main"), this);
472  actionColorPickerFirstColor->setShortcut(QKeySequence(Qt::ALT + Qt::Key_N));
473  connect(actionColorPickerFirstColor, SIGNAL(triggered()), this, SLOT(slotSetFirstColor()));
474  connect(FirstColorButton, SIGNAL(clicked()), this, SLOT(slotSetFirstColor()));
475 
476  actionColorPickerSecondColor = new QAction(tr("&Secondary"), this);
477  actionColorPickerSecondColor->setShortcut(QKeySequence(Qt::ALT + Qt::Key_M));
478  connect(actionColorPickerSecondColor, SIGNAL(triggered()), this, SLOT(slotSetSecondColor()));
479  connect(SecondColorButton, SIGNAL(clicked()), this, SLOT(slotSetSecondColor()));
480 
481  actionColorSwap = new QAction(tr("&Switch"), this);
482  actionColorSwap->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_S));
483  connect(actionColorSwap, SIGNAL(triggered()), this, SLOT(slotSwapColor()));
484  connect(SwitchColorButton, SIGNAL(clicked()), this, SLOT(slotSwapColor()));
485 
486  //Create Tool actions down here
487  actionCreatePlainTool = new QAction(tr("&Plain"), this);
488  actionCreatePlainTool->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_P));
489  connect(actionCreatePlainTool, SIGNAL(triggered()), this, SLOT(slotResetTools()));
490  connect(actionCreatePlainTool, SIGNAL(triggered()), this, SLOT(slotCreatePlainTool()));
491 
492 
493  actionCreatePenTool = new QAction(tr("&Pen"),this);
494  actionCreatePenTool->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_S));
495  connect(actionCreatePenTool, SIGNAL(triggered()), this, SLOT(slotResetTools()));
496  connect(actionCreatePenTool, SIGNAL(triggered()), this, SLOT(slotCreatePenTool()));
497 
498  actionCreateLineTool = new QAction(tr("&Line"), this);
499  actionCreateLineTool->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_L));
500  connect(actionCreateLineTool, SIGNAL(triggered()), this, SLOT(slotResetTools()));
501  connect(actionCreateLineTool, SIGNAL(triggered()), this, SLOT(slotCreateLineTool()));
502 
503  actionCreateCircleTool = new QAction(tr("&Circle"), this);
504  actionCreateCircleTool->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_C));
505  connect(actionCreateCircleTool, SIGNAL(triggered()), this, SLOT(slotResetTools()));
506  connect(actionCreateCircleTool, SIGNAL(triggered()), this, SLOT(slotCreateCircleTool()));
507 
508  actionCreateRectangleTool = new QAction(tr("&Rectangle"), this);
509  actionCreateRectangleTool->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_R));
510  connect(actionCreateRectangleTool, SIGNAL(triggered()), this, SLOT(slotResetTools()));
511  connect(actionCreateRectangleTool, SIGNAL(triggered()), this, SLOT(slotCreateRectangleTool()));
512 
513  actionCreatePolygonTool = new QAction(tr("&Polygon"), this);
514  actionCreatePolygonTool->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_V));
515  connect(actionCreatePolygonTool, SIGNAL(triggered()), this, SLOT(slotResetTools()));
516  connect(actionCreatePolygonTool, SIGNAL(triggered()), this, SLOT(slotCreatePolygonTool()));
517 
518  actionCreateFloodFillTool = new QAction(tr("&FloodFill"), this);
519  actionCreateFloodFillTool->setShortcut(QKeySequence(Qt::CTRL + Qt::ALT + Qt::SHIFT + Qt::Key_F));
520  connect(actionCreateFloodFillTool, SIGNAL(triggered()), this, SLOT(slotResetTools()));
521  connect(actionCreateFloodFillTool, SIGNAL(triggered()), this, SLOT(slotCreateFloodFillTool()));
522 
523  // Create about action and tie to IntelliPhotoGui::about()
524  actionAboutDialog = new QAction(tr("&About"), this);
525  actionAboutDialog->setShortcut(Qt::Key_F2);
526  connect(actionAboutDialog, SIGNAL(triggered()), this, SLOT(slotAboutDialog()));
527 
528  // Create about Qt action and tie to IntelliPhotoGui::aboutQt()
529  actionAboutQtDialog = new QAction(tr("About &Qt"), this);
530  actionAboutQtDialog->setShortcut(Qt::Key_F3);
531  connect(actionAboutQtDialog, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
532 
533  connect(EditLineWidth, SIGNAL(returnPressed()), this, SLOT(slotEnterPressed()));
534  connect(EditLineInnerAlpha, SIGNAL(returnPressed()), this, SLOT(slotEnterPressed()));
535 
536  connect(CircleButton,SIGNAL(pressed()), this, SLOT(slotResetTools()));
537  connect(CircleButton, SIGNAL(clicked()), this, SLOT(slotCreateCircleTool()));
538 
539  connect(FloodFillButton,SIGNAL(pressed()), this, SLOT(slotResetTools()));
540  connect(FloodFillButton, SIGNAL(clicked()), this, SLOT(slotCreateFloodFillTool()));
541 
542  connect(LineButton,SIGNAL(pressed()), this, SLOT(slotResetTools()));
543  connect(LineButton, SIGNAL(clicked()), this, SLOT(slotCreateLineTool()));
544 
545  connect(PenButton,SIGNAL(pressed()), this, SLOT(slotResetTools()));
546  connect(PenButton, SIGNAL(clicked()), this, SLOT(slotCreatePenTool()));
547 
548  connect(PlainButton,SIGNAL(pressed()), this, SLOT(slotResetTools()));
549  connect(PlainButton, SIGNAL(clicked()), this, SLOT(slotCreatePlainTool()));
550 
551  connect(PolygonButton,SIGNAL(pressed()), this, SLOT(slotResetTools()));
552  connect(PolygonButton, SIGNAL(clicked()), this, SLOT(slotCreatePolygonTool()));
553 
554  connect(RectangleButton,SIGNAL(pressed()), this, SLOT(slotResetTools()));
555  connect(RectangleButton, SIGNAL(clicked()), this, SLOT(slotCreateRectangleTool()));
556 
557  actionSetWidth = new QAction(tr("&Set Width"),this);
558  actionSetWidth->setShortcut(QKeySequence(Qt::ALT + Qt::Key_W));
559  connect(actionSetWidth, SIGNAL(triggered()), this, SLOT(slotSetWidth()));
560 
561  actionSetInnerAlpha = new QAction(tr("&Set Inner Alpha"),this);
562  actionSetInnerAlpha->setShortcut(QKeySequence(Qt::ALT + Qt::Key_A));
563  connect(actionSetInnerAlpha, SIGNAL(triggered()), this, SLOT(slotSetInnerAlpha()));
564 
565  actionGoBack = new QAction(tr("&Go back"),this);
566  actionGoBack->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Z));
567  connect(actionGoBack, SIGNAL(triggered()), this, SLOT(slotGoBack()));
568 
569  actionGoForward = new QAction(tr("&Go forward"),this);
570  actionGoForward->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_Y));
571  connect(actionGoForward, SIGNAL(triggered()), this, SLOT(slotGoForward()));
572 }
573 
574 // Create the menubar
575 void IntelliPhotoGui::createMenus(){
576  // Create Save As option and the list of file types
577  saveAsMenu = new QMenu(tr("&Save As"), this);
578  foreach (QAction * action, actionSaveAs)
579  saveAsMenu->addAction(action);
580 
581  // Attach all actions to File
582  fileMenu = new QMenu(tr("&File"), this);
583  fileMenu->addAction(actionOpen);
584  fileMenu->addMenu(saveAsMenu);
585  fileMenu->addSeparator();
586  fileMenu->addAction(actionExit);
587 
588  //Attach all actions to Render Settings
589  renderMenu = new QMenu(tr("&Fast Renderer"), this);
590  renderMenu->addAction(actionUpdateRenderSettingsOn);
591  renderMenu->addAction(actionUpdateRenderSettingsOff);
592 
593  //Attach all Layer Creations to Menu
594  layerCreationMenu = new QMenu(tr("&Create new Layer"), this);
595  layerCreationMenu->addAction(actionCreateNewRasterLayer);
596  layerCreationMenu->addAction(actionCreateNewShapedLayer);
597 
598  // Attach all actions to Layer
599  layerMenu = new QMenu(tr("&Layer"), this);
600  layerMenu->addMenu(layerCreationMenu);
601  layerMenu->addSeparator();
602  layerMenu->addAction(actionSetActiveAlpha);
603  layerMenu->addAction(actionSetActiveLayer);
604  layerMenu->addAction(actionSetPolygon);
605  layerMenu->addSeparator();
606  layerMenu->addAction(actionMovePositionUp);
607  layerMenu->addAction(actionMovePositionDown);
608  layerMenu->addAction(actionMovePositionLeft);
609  layerMenu->addAction(actionMovePositionRight);
610  layerMenu->addAction(actionMoveLayerUp);
611  layerMenu->addAction(actionMoveLayerDown);
612  layerMenu->addSeparator();
613  layerMenu->addAction(actionDeleteLayer);
614 
615  //Attach all Color Options
616  colorMenu = new QMenu(tr("&Color"), this);
617  colorMenu->addAction(actionColorPickerFirstColor);
618  colorMenu->addAction(actionColorPickerSecondColor);
619  colorMenu->addAction(actionColorSwap);
620 
621  //Attach all Tool Creation Actions
622  toolCreationMenu = new QMenu(tr("&Drawingtools"), this);
623  toolCreationMenu->addAction(actionCreateCircleTool);
624  toolCreationMenu->addAction(actionCreateFloodFillTool);
625  toolCreationMenu->addAction(actionCreateLineTool);
626  toolCreationMenu->addAction(actionCreatePenTool);
627  toolCreationMenu->addAction(actionCreatePlainTool);
628  toolCreationMenu->addAction(actionCreatePolygonTool);
629  toolCreationMenu->addAction(actionCreateRectangleTool);
630 
631  //Attach all Tool Setting Actions
632  toolSettingsMenu = new QMenu(tr("&Toolsettings"), this);
633  toolSettingsMenu->addAction(actionSetWidth);
634  toolSettingsMenu->addAction(actionSetInnerAlpha);
635 
636  //Attach all Tool Options
637  toolMenu = new QMenu(tr("&Tools"), this);
638  toolMenu->addMenu(toolCreationMenu);
639  toolMenu->addMenu(toolSettingsMenu);
640  toolMenu->addSeparator();
641  toolMenu->addMenu(colorMenu);
642 
643  // Attach all actions to Options
644  optionMenu = new QMenu(tr("&Options"), this);
645  optionMenu->addAction(actionGoBack);
646  optionMenu->addAction(actionGoForward);
647  optionMenu->addMenu(layerMenu);
648  optionMenu->addMenu(toolMenu);
649  optionMenu->addSeparator();
650  optionMenu->addMenu(renderMenu);
651  optionMenu->addAction(actionChangeDim);
652 
653  // Attach all actions to Help
654  helpMenu = new QMenu(tr("&Help"), this);
655  helpMenu->addAction(actionAboutDialog);
656  helpMenu->addAction(actionAboutQtDialog);
657 
658  // Add menu items to the menubar
659  menuBar()->addMenu(fileMenu);
660  menuBar()->addMenu(optionMenu);
661  menuBar()->addMenu(helpMenu);
662 }
663 
664 void IntelliPhotoGui::createGui(){
665  // create a central widget to work on
666  centralGuiWidget = new QWidget(this);
667  setCentralWidget(centralGuiWidget);
668 
669  // create the grid for the layout
670  mainLayout = new QGridLayout(centralGuiWidget);
671  centralGuiWidget->setLayout(mainLayout);
672 
673  // create Gui elements
674  // get and set max width and height
675  paintingArea = new PaintingArea(1280, 720);
676  paintingArea->guiReference = this;
677 
678  preview = QPixmap(":/Icons/Buttons/icons/circle-tool.svg");
679  CircleButton = new QPushButton();
680  CircleButton->setFixedSize(Buttonsize);
681  CircleButton->setIcon(preview);
682  CircleButton->setIconSize(Buttonsize);
683  CircleButton->setCheckable(true);
684 
685  preview = QPixmap(":/Icons/Buttons/icons/flood-fill-tool.svg");
686  FloodFillButton = new QPushButton();
687  FloodFillButton->setFixedSize(Buttonsize);
688  FloodFillButton->setIcon(preview);
689  FloodFillButton->setIconSize(Buttonsize);
690  FloodFillButton->setCheckable(true);
691 
692  preview = QPixmap(":/Icons/Buttons/icons/line-tool.svg");
693  LineButton = new QPushButton();
694  LineButton->setFixedSize(Buttonsize);
695  LineButton->setIcon(preview);
696  LineButton->setIconSize(Buttonsize);
697  LineButton->setCheckable(true);
698 
699  preview = QPixmap(":/Icons/Buttons/icons/pen-tool.svg");
700  PenButton = new QPushButton();
701  PenButton->setFixedSize(Buttonsize);
702  PenButton->setIcon(preview);
703  PenButton->setIconSize(Buttonsize);
704  PenButton->setCheckable(true);
705 
706  preview = QPixmap(":/Icons/Buttons/icons/plain-tool.svg");
707  PlainButton = new QPushButton();
708  PlainButton->setFixedSize(Buttonsize);
709  PlainButton->setIcon(preview);
710  PlainButton->setIconSize(Buttonsize);
711  PlainButton->setCheckable(true);
712 
713  preview = QPixmap(":/Icons/Buttons/icons/polygon-tool.svg");
714  PolygonButton = new QPushButton();
715  PolygonButton->setFixedSize(Buttonsize);
716  PolygonButton->setIcon(preview);
717  PolygonButton->setIconSize(Buttonsize);
718  PolygonButton->setCheckable(true);
719 
720  preview = QPixmap(":/Icons/Buttons/icons/rectangle-tool.svg");
721  RectangleButton = new QPushButton();
722  RectangleButton->setFixedSize(Buttonsize);
723  RectangleButton->setIcon(preview);
724  RectangleButton->setIconSize(Buttonsize);
725  RectangleButton->setCheckable(true);
726 
727  WidthLine = new QLabel();
728  WidthLine->setText("Width");
729  WidthLine->setFixedSize(Buttonsize.width() * 2,(Buttonsize.height() * 2) / 3);
730 
731  EditLineWidth = new QLineEdit();
732  EditLineWidth->setFixedSize(Buttonsize.width() * 2,(Buttonsize.height() * 2) / 3);
733  EditLineWidth->setText("5");
734  ValidatorLineWidth = new QIntValidator();
735  ValidatorLineWidth->setTop(99);
736  ValidatorLineWidth->setBottom(1);
737  EditLineWidth->setValidator(ValidatorLineWidth);
738 
739  innerAlphaLine = new QLabel();
740  innerAlphaLine->setText("Inner Alpha");
741  innerAlphaLine->setFixedSize(Buttonsize.width() * 2,(Buttonsize.height() * 2) / 3);
742 
743  EditLineInnerAlpha = new QLineEdit();
744  EditLineInnerAlpha->setFixedSize(Buttonsize.width() * 2,(Buttonsize.height() * 2) / 3);
745  EditLineInnerAlpha->setText("255");
746  ValidatorInnerAlpha = new QIntValidator();
747  ValidatorInnerAlpha->setTop(999);
748  ValidatorInnerAlpha->setBottom(0);
749  EditLineInnerAlpha->setValidator(ValidatorInnerAlpha);
750 
751  FirstColorButton = new QPushButton();
752  FirstColorButton->setFixedSize(Buttonsize);
753 
754  SecondColorButton = new QPushButton();
755  SecondColorButton->setFixedSize(Buttonsize);
756 
757  preview = QPixmap(":/Icons/Buttons/icons/Wechselpfeile.png");
758  SwitchColorButton = new QPushButton();
759  SwitchColorButton->setFixedSize(Buttonsize.width() * 2,Buttonsize.height());
760  SwitchColorButton->setIcon(preview);
761  SwitchColorButton->setIconSize(QSize(Buttonsize.width() * 2,Buttonsize.height()));
762 
763  ActiveLayerLine = new QLabel();
764  QString string = QString("Active Layer: %1").arg(paintingArea->getNumberOfActiveLayer() + 1);
765  ActiveLayerLine->setText(string);
766  ActiveLayerLine->setFixedSize(Buttonsize.width() * 2 + 10,(Buttonsize.height() * 2) / 3);
767 
768  IntelliImage* activePicture = paintingArea->getImageOfActiveLayer();
769  if(activePicture) {
770  preview = preview.fromImage(activePicture->getImageData());
771  }else{
772  QImage tmp(1,1,QImage::Format_ARGB32);
773  tmp.fill(Qt::transparent);
774  preview = preview.fromImage(tmp);
775  }
776 
777  ActiveLayerImageLabel = new QLabel();
778  ActiveLayerImageLabel->setFixedSize(Buttonsize * 2);
779  ActiveLayerImageLabel->setPixmap(preview.scaled(Buttonsize * 2));
780 
781  dimActive = new QPushButton();
782  dimActive->setFixedSize(Buttonsize.width() * 2,Buttonsize.height() / 2);
783  dimActive->setText("0x0");
784 
785  dimCanvas = new QPushButton();
786  dimCanvas->setFixedSize(Buttonsize.width() * 2,Buttonsize.height() / 2);
787  QString String = QString("%1x%2").arg(paintingArea->Canvas->width()).arg(paintingArea->Canvas->height());
788  dimCanvas->setText(String);
789 
790  ScrollArea = new QScrollArea(this);
791  ScrollArea->setBackgroundRole(QPalette::Dark);
792  ScrollArea->setWidget(paintingArea);
793  ScrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
794  ScrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
795 
796  // set gui elements
797  mainLayout->addWidget(ScrollArea,1,1,20,1);
798  mainLayout->addWidget(CircleButton,1,2,1,1);
799  mainLayout->addWidget(FloodFillButton,1,3,1,1);
800  mainLayout->addWidget(LineButton,2,2,1,1);
801  mainLayout->addWidget(PenButton,2,3,1,1);
802  mainLayout->addWidget(PlainButton,3,2,1,1);
803  mainLayout->addWidget(PolygonButton,3,3,1,1);
804  mainLayout->addWidget(RectangleButton,4,2,1,1);
805  mainLayout->addWidget(WidthLine,5,2,1,2);
806  mainLayout->addWidget(EditLineWidth,6,2,1,2);
807  mainLayout->addWidget(innerAlphaLine,7,2,1,2);
808  mainLayout->addWidget(EditLineInnerAlpha,8,2,1,2);
809  mainLayout->addWidget(FirstColorButton,9,2,1,1);
810  mainLayout->addWidget(SecondColorButton,9,3,1,1);
811  mainLayout->addWidget(SwitchColorButton,10,2,1,2);
812  mainLayout->addWidget(ActiveLayerLine,11,2,1,2);
813  mainLayout->addWidget(ActiveLayerImageLabel,12,2,1,2);
814  mainLayout->addWidget(dimActive,13,2,1,2);
815  mainLayout->addWidget(dimCanvas,14,2,1,2);
816  mainLayout->setHorizontalSpacing(0);
817 
818 }
819 
820 void IntelliPhotoGui::setIntelliStyle(){
821  // Set the title
822  setWindowTitle("IntelliPhoto Prototype");
823  // Set style sheet
824  this->setStyleSheet("color: white;" "background-color: rgb(64, 64, 64);" "selection-color: rgb(200, 10, 10);" "selection-background-color: rgb(64, 64, 64);");
825 
826  QString string = QString("background-color: %1").arg(paintingArea->colorPicker.getFirstColor().name());
827  FirstColorButton->setStyleSheet(string);
828  string = QString("background-color: %1").arg(paintingArea->colorPicker.getSecondColor().name());
829  SecondColorButton->setStyleSheet(string);
830 }
831 
832 bool IntelliPhotoGui::maybeSave(){
833  // Check for changes since last save
834 #ifdef QT_NO_DEBUG
835  QMessageBox::StandardButton ret;
836 
837  // Painting is the title of the window
838  // Add text and the buttons
839  ret = QMessageBox::warning(this, tr("Painting"),
840  tr("The image has been modified.\n"
841  "Do you want to save your changes?"),
842  QMessageBox::Save | QMessageBox::Discard
843  | QMessageBox::Cancel);
844 
845  // If save button clicked call for file to be saved
846  if (ret == QMessageBox::Save) {
847  return saveFile("png");
848 
849  // If cancel do nothing
850  } else if (ret == QMessageBox::Cancel) {
851  return false;
852  }
853 #endif
854  return true;
855 }
856 
857 bool IntelliPhotoGui::saveFile(const QByteArray &fileFormat){
858  // Define path, name and default file type
859  QString initialPath = QDir::currentPath() + "/untitled." + fileFormat;
860 
861  // Get selected file from dialog
862  // Add the proper file formats and extensions
863  QString fileName = QFileDialog::getSaveFileName(this, tr("Save As"),
864  initialPath,
865  tr("%1 Files (*.%2);;All Files (*)")
866  .arg(QString::fromLatin1(fileFormat.toUpper()))
867  .arg(QString::fromLatin1(fileFormat)), nullptr, QFileDialog::DontUseNativeDialog);
868 
869  // If no file do nothing
870  if (fileName.isEmpty()) {
871  return false;
872  } else {
873  // Call for the file to be saved
874  if(fileFormat == "idf") {
875  return IntelliDatamanager::saveProject(paintingArea, fileName);
876 
877  }
878  return paintingArea->save(fileName, fileFormat.constData());
879  }
880 }
881 
882 void IntelliPhotoGui::setDefaultValues(){
883  slotEnterPressed();
884 }
885 
887  if(value < 1) {
888  value = 1;
889  }else if(value > 50) {
890  value = 50;
891  }
892  EditLineWidth->setText(QString("%1").arg(value));
893 }
894 
896  QString string = QString("Active Layer: %1").arg(paintingArea->getNumberOfActiveLayer() + 1);
897  ActiveLayerLine->setText(string);
898 
899  IntelliImage* activePicture = paintingArea->getImageOfActiveLayer();
900  if(activePicture) {
901  preview = preview.fromImage(activePicture->getImageData());
902  }else{
903  QImage tmp(1,1,QImage::Format_ARGB32);
904  tmp.fill(Qt::transparent);
905  preview = preview.fromImage(tmp);
906  }
907 
908 
909  ActiveLayerImageLabel->setPixmap(preview.scaled(Buttonsize * 2));
910 
911  string = QString("background-color: %1").arg(paintingArea->colorPicker.getFirstColor().name());
912  FirstColorButton->setStyleSheet(string);
913  string = QString("background-color: %1").arg(paintingArea->colorPicker.getSecondColor().name());
914  SecondColorButton->setStyleSheet(string);
915 
916  string = QString("%1x%2").arg(paintingArea->Canvas->width()).arg(paintingArea->Canvas->height());
917  dimCanvas->setText(string);
918 
919  if(paintingArea->layerBundle.size() != 0) {
920  string = QString("%1x%2").arg(paintingArea->layerBundle[static_cast<size_t>
921  (paintingArea->getNumberOfActiveLayer())].width).arg(paintingArea->layerBundle[static_cast<size_t>
922  (paintingArea->getNumberOfActiveLayer())].height);
923  dimActive->setText(string);
924  }
925  else{
926  dimActive->setText("0x0");
927  }
928 }
PaintingArea::createCircleTool
void createCircleTool()
Definition: PaintingArea.cpp:264
IntelliColorPicker::getFirstColor
QColor getFirstColor() const
A function to read the primary selected color.
Definition: IntelliColorPicker.cpp:15
ImageType::RASTERIMAGE
@ RASTERIMAGE
PaintingArea::setRenderSettings
void setRenderSettings(bool isFastRenderingOn)
setRenderSettings updates all Images to the new Rendersetting.
Definition: PaintingArea.cpp:51
PaintingArea::getImageOfActiveLayer
IntelliImage * getImageOfActiveLayer()
Definition: PaintingArea.cpp:465
PaintingArea::createRectangleTool
void createRectangleTool()
Definition: PaintingArea.cpp:259
PaintingArea::getMaxWidth
int getMaxWidth()
Definition: PaintingArea.cpp:286
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:182
PaintingArea::setLayerAlpha
void setLayerAlpha(int idx, int alpha)
The setAlphaOfLayer method sets the alpha value of a specific layer.
Definition: PaintingArea.cpp:144
IntelliDatamanager::loadProject
bool loadProject(PaintingArea *Canvas, QString filePath="unnamed.idf")
Definition: IntelliDatamanager.cpp:50
PaintingArea::setLayerActive
void setLayerActive(int idx)
The setLayerToActive method marks a specific layer as active.
Definition: PaintingArea.cpp:137
PaintingArea::getMaxHeight
int getMaxHeight()
Definition: PaintingArea.cpp:290
PaintingArea::deleteLayer
void deleteLayer(int idx, bool isTool=false)
The deleteLayer method removes a layer at a given idx.
Definition: PaintingArea.cpp:114
PaintingArea::createPlainTool
void createPlainTool()
Definition: PaintingArea.cpp:249
IntelliPhotoGui::IntelliPhotoGui
IntelliPhotoGui()
The IntelliPhotoGui method is the constructor and is used to create a new instance of the main progra...
Definition: IntelliPhotoGui.cpp:12
PaintingArea
The PaintingArea class manages the methods and stores information about the current painting area,...
Definition: PaintingArea.h:57
PaintingArea::createPenTool
void createPenTool()
Definition: PaintingArea.cpp:244
IntelliColorPicker::getSecondColor
QColor getSecondColor() const
A function to read the secondary selected color.
Definition: IntelliColorPicker.cpp:19
PaintingArea::historyGoBack
void historyGoBack()
Definition: PaintingArea.cpp:518
PaintingArea::createLineTool
void createLineTool()
Definition: PaintingArea.cpp:254
PaintingArea::colorPickerSetSecondColor
void colorPickerSetSecondColor()
The colorPickerSetSecondColor calls the QTColorPicker to determine the secondary drawing color.
Definition: PaintingArea.cpp:235
PaintingArea::colorPickerSetFirstColor
void colorPickerSetFirstColor()
The colorPickerSetFirstColor calls the QTColorPicker to determine the primary drawing color.
Definition: PaintingArea.cpp:230
IntelliInputDialog::getInt
static int getInt(QString Title=nullptr, QString Label=nullptr, int value=5, int minValue=-2147483647, int maxValue=2147483647, int step=1, bool *ok=nullptr)
Definition: IntelliInputDialog.cpp:16
IntelliPhotoGui.h
PaintingArea::getNumberOfActiveLayer
int getNumberOfActiveLayer()
Definition: PaintingArea.cpp:461
IntelliPhotoGui::closeEvent
void closeEvent(QCloseEvent *event) override
The closeEvent function handles closing events.
Definition: IntelliPhotoGui.cpp:27
IntelliImage::getImageData
virtual QImage getImageData()
getImageData returns the data of the current image (Note: It will allways return a ARGB32bit QImage!...
Definition: IntelliImage.cpp:135
ImageType::SHAPEDIMAGE
@ SHAPEDIMAGE
IntelliPhotoGui::setToolWidth
void setToolWidth(int value)
Definition: IntelliPhotoGui.cpp:886
PaintingArea::open
bool open(const QString &filePath)
The open method is used for loading a picture into the current layer.
Definition: PaintingArea.cpp:163
PaintingArea::createPolygonTool
void createPolygonTool()
Definition: PaintingArea.cpp:268
PaintingArea::moveActiveLayer
void moveActiveLayer(int idx)
The moveActiveLayer moves the active layer to a specific position in the layer stack.
Definition: PaintingArea.cpp:212
PaintingArea::colorPicker
IntelliColorPicker colorPicker
Definition: PaintingArea.h:223
PaintingArea.h
PaintingArea::setLayerDimensions
void setLayerDimensions(int maxWidth, int maxHeight)
Definition: PaintingArea.cpp:72
PaintingArea::createFloodFillTool
void createFloodFillTool()
Definition: PaintingArea.cpp:273
IntelliToolsettings::setInnerAlpha
void setInnerAlpha(int innerAlpha)
Definition: IntelliToolsettings.cpp:32
IntelliDatamanager::saveProject
bool saveProject(PaintingArea *Canvas, QString filePath="unnamed.idf")
Definition: IntelliDatamanager.cpp:4
IntelliPhotoGui::UpdateGui
void UpdateGui()
Definition: IntelliPhotoGui.cpp:895
PaintingArea::Toolsettings
IntelliToolsettings Toolsettings
Definition: PaintingArea.h:222
PaintingArea::setPolygon
void setPolygon(int idx)
setPolygon is used for setting polygondata, it only works on RASTER images
Definition: PaintingArea.cpp:151
IntelliToolsettings::setLineWidth
void setLineWidth(int LineWidth)
Definition: IntelliToolsettings.cpp:18
PaintingArea::colorPickerSwapColors
void colorPickerSwapColors()
The colorPickerSwitchColor swaps the primary color with the secondary drawing color.
Definition: PaintingArea.cpp:240
PaintingArea::movePositionActive
void movePositionActive(int x, int y)
The movePositionActive method moves the active layer to certain position.
Definition: PaintingArea.cpp:205
IntelliImage
An abstract class which manages the basic IntelliImage operations.
Definition: IntelliImage.h:30
PaintingArea::addLayer
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.
Definition: PaintingArea.cpp:94
PaintingArea::historyGoForward
void historyGoForward()
Definition: PaintingArea.cpp:527