Geometrize  1.0
An application for geometrizing images into geometric primitives
Functions
geometrize::script::bindings Namespace Reference

Functions

std::shared_ptr< chaiscript::Module > createDefaultBindings ()
 createDefaultBindings Creates the default Chaiscript to C++ bindings. More...
 
std::shared_ptr< chaiscript::Module > createQWidgetBindings ()
 createQWidgetBindings Creates the Chaiscript to C++ bindings for the Qt QWidget class. More...
 
std::shared_ptr< chaiscript::Module > createLaunchWindowBindings ()
 createLaunchWindowBindings Creates the Chaiscript to C++ bindings for the Geometrize launch window. More...
 
std::shared_ptr< chaiscript::Module > createImageTaskWindowBindings ()
 createImageTaskWindowBindings Creates the Chaiscript to C++ binding for the Geometrize image task window. More...
 
std::shared_ptr< chaiscript::Module > createImageBindings ()
 createImageBindings Creates the Chaiscript to C++ bindings for image manipulation. More...
 
std::shared_ptr< chaiscript::Module > createSynchronousImageTaskBindings ()
 createSynchronousImageTaskBindings Creates the Chaiscript to C++ bindings for synchronous Geometrize image tasks (used by the Twitter bot). More...
 
std::shared_ptr< chaiscript::Module > createImageTaskBindings ()
 createImageTaskBindings Creates the Chaiscript to C++ bindings for Geometrize image tasks. More...
 
std::shared_ptr< chaiscript::Module > createImageExportBindings ()
 createImageExportBindings Creates the Chaiscript to C++ bindings for saving images. More...
 
std::shared_ptr< chaiscript::Module > createAnimatedGifExportBindings ()
 createGifExportBindings Creates the ChaiScript to C++ bindings for saving animated GIFs. More...
 
std::shared_ptr< chaiscript::Module > createGeometrizeLibraryBindings ()
 createGeometrizeLibraryBindings Creates the Chaiscript to C++ bindings for all of the functionality in the Geometrize library. More...
 
std::shared_ptr< chaiscript::Module > createTabletEventBindings ()
 createTabletEventBindings Creates the Chaiscript to C++ bindings for tablet events (e.g. Wacom pen input data). More...
 
std::shared_ptr< chaiscript::Module > createMathBindings ()
 createMathBindings Creates the Chaiscript to C++ bindings for common math functions. More...
 
std::shared_ptr< chaiscript::Module > createUserInterfacePuppeteerBindings ()
 createUserInterfacePuppeteerBindings Creates ChaiScript to C++ bindings for driving the user interface (primarily for testing purposes). More...
 
std::shared_ptr< chaiscript::Module > createFunctionalTestHelperBindings ()
 createFunctionalTestHelperBindings Creates ChaiScript to C++ bindings for helper functions needed for the functional/self-tests (e.g. reporting test results). More...
 
geometrize::dialog::ImageTaskWindowcreateImageTaskWindow ()
 
geometrize::dialog::LaunchWindowcreateLaunchWindow ()
 
geometrize::task::ImageTaskcreateImageTask (geometrize::Bitmap &bitmap)
 
std::vector< geometrize::dialog::LaunchWindow * > getLaunchWindows ()
 
std::vector< geometrize::dialog::ImageTaskWindow * > getImageTaskWindows ()
 
std::string getApplicationDirectoryPath ()
 
void printToConsole (const std::string &str)
 
void printToAllScriptConsoleWidgets (const std::string &str)
 
void messageBox (const std::string &str)
 
void debugBreak ()
 
void processApplicationEvents ()
 
bool fileExists (const std::string &filePath)
 
bool directoryExists (const std::string &dirPath)
 
bool directoriesExist (const std::vector< std::string > &dirPaths)
 
bool directoryContainsFile (const std::string &dirPath, const std::string &fileName)
 
bool createDirectory (const std::string &dirPath)
 
std::string readFileAsString (const std::string &filePath)
 
std::vector< std::string > getFilePathsForDirectory (const std::string &dirPath)
 
std::vector< std::string > getScriptSearchPaths ()
 
std::vector< std::string > getTemplateSearchPaths ()
 
std::string getFirstFileWithExtension (const std::string &dirPath, const std::string &extension)
 
std::string getFirstFileWithExtensions (const std::string &dirPath, const std::vector< std::string > &extensions)
 
std::vector< std::string > getFilesWithExtensions (const std::string &, const std::vector< std::string > &)
 
std::vector< std::string > getFilesWithExtension (const std::string &dirPath, const std::string &extension)
 
std::vector< std::string > getSupportedImageFileExtensions ()
 
std::vector< std::string > getScriptsForPath (const std::string &dirPath)
 
std::vector< std::string > getScriptsForPaths (const std::vector< std::string > &dirPaths)
 
std::string getDirectoryForFilePath (const std::string &filePath)
 
std::string getFileNameForFilePath (const std::string &filePath)
 
void openTask (const std::string &url, const bool addToRecents)
 
bool openInDefaultApplication (const std::string &path)
 
bool revealInDefaultApplication (const std::string &path)
 
void clearGlobalClipboard ()
 
std::string getGlobalClipboardText ()
 
void setGlobalClipboardText (const std::string &text)
 
bool stringBeginsWith (const std::string &str, const std::string &prefix)
 
bool stringEndsWith (const std::string &str, const std::string &suffix)
 
std::string getApplicationDirectoryLocation ()
 
std::string getAppDataLocation ()
 
std::string getHomeDirectoryLocation ()
 
std::string getDesktopDirectoryLocation ()
 
bool writeStringToFile (const std::string &str, const std::string &path)
 
std::string percentEncode (const std::string &str)
 
int randomIntInRange (const int lower, const int upper)
 
float randomFloatInRange (const float lower, const float upper)
 
int clampInt (const int value, const int lower, const int upper)
 
float clampFloat (const float value, const float lower, const float upper)
 
std::vector< std::string > split (const std::string &s, const char delimiter)
 
std::string getOperatingSystemProductType ()
 
int getCursorX ()
 
int getCursorY ()
 
void setCursorPos (const int x, const int y)
 
void setTranslatorsForLocale (const std::string &locale)
 
std::vector< std::string > getSupportedLocaleCodes ()
 
void setLocaleAndUserInterfaceLanguage (const std::string &locale)
 
bool exportGIF (const std::vector< geometrize::ShapeResult > &data, const std::uint32_t inputWidth, const std::uint32_t inputHeight, const std::uint32_t outputWidth, const std::uint32_t outputHeight, const std::size_t frameSkip, const std::string &filePath)
 
bool saveWidgetScreenshot (const std::string &path, QWidget *widget)
 
std::string customTabletEventDataToString (const geometrize::scene::TabletEventData &data)
 
std::vector< std::string > getAllNamedWidgets ()
 
std::vector< std::string > getAllNamedGeometrizeWidgets ()
 
QWidget * getWidgetByName (const std::string &widgetName)
 
std::vector< std::string > getAllNamedCommandHandlers ()
 
CommandHandlergetCommandHandlerByName (const std::string &name)
 
void sendCommandString (const std::string &target, const std::string &command)
 
void sendCommandObject (const std::string &target, Command &command)
 
void broadcastCommandString (const std::string &command)
 
void broadcastCommandObject (Command &command)
 
std::string getFormattedTimestamp (const std::string &formatString)
 
std::string getFilenameTimestamp ()
 
std::string getUuidString ()
 
void setWidgetSize (QWidget *widget, int width, int height)
 
void setWidgetPosition (QWidget *widget, int x, int y)
 
void arrangeWidgetsInGrid (const std::vector< QWidget * > &widgets, int centerX, int centerY, int xDim, int yDim, int resizeX, int resizeY)
 
void arrangeImageTaskWidgetsInGrid (int centerX, int centerY, int xDim, int yDim, int resizeX, int resizeY)
 
void arrangeWidgetsInGridOnMonitor (const std::vector< QWidget * > &widgets, int monitorId, int resizeX, int resizeY)
 
void arrangeImageTaskWidgetsInGridOnMonitor (int monitorId, int resizeX, int resizeY)
 
void arrangeWidgetsInGridOnPrimaryMonitor (const std::vector< QWidget * > &widgets, int resizeX, int resizeY)
 
void arrangeImageTaskWidgetsInGridOnPrimaryMonitor (int resizeX, int resizeY)
 
void fitWidgetsInGridOnMonitor (const std::vector< QWidget * > &widgets, int screenIdx)
 
void fitImageTaskWidgetsInGridOnMonitor (int screenIdx)
 
void fitWidgetsInGridOnPrimaryMonitor (const std::vector< QWidget * > &widgets)
 
void fitImageTaskWidgetsInGridOnPrimaryMonitor ()
 
template<typename T , typename U , typename V >
randomInRange (U lower, V upper)
 
template<typename T >
randomInVector (const std::vector< T > &v)
 
template<typename T , typename U , typename V >
clamp (T value, U lower, V upper)
 
template<typename T >
bool vectorContains (const std::vector< T > &v, const T &t)
 

Function Documentation

◆ arrangeImageTaskWidgetsInGrid()

void geometrize::script::bindings::arrangeImageTaskWidgetsInGrid ( int  centerX,
int  centerY,
int  xDim,
int  yDim,
int  resizeX,
int  resizeY 
)
429 {
430  geometrize::util::arrangeImageTaskWidgetsInGrid(centerX, centerY, xDim, yDim, resizeX, resizeY);
431 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ arrangeImageTaskWidgetsInGridOnMonitor()

void geometrize::script::bindings::arrangeImageTaskWidgetsInGridOnMonitor ( int  monitorId,
int  resizeX,
int  resizeY 
)
439 {
441 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ arrangeImageTaskWidgetsInGridOnPrimaryMonitor()

void geometrize::script::bindings::arrangeImageTaskWidgetsInGridOnPrimaryMonitor ( int  resizeX,
int  resizeY 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ arrangeWidgetsInGrid()

void geometrize::script::bindings::arrangeWidgetsInGrid ( const std::vector< QWidget * > &  widgets,
int  centerX,
int  centerY,
int  xDim,
int  yDim,
int  resizeX,
int  resizeY 
)
424 {
425  geometrize::util::arrangeWidgetsInGrid(widgets, centerX, centerY, xDim, yDim, resizeX, resizeY);
426 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ arrangeWidgetsInGridOnMonitor()

void geometrize::script::bindings::arrangeWidgetsInGridOnMonitor ( const std::vector< QWidget * > &  widgets,
int  monitorId,
int  resizeX,
int  resizeY 
)
434 {
435  geometrize::util::arrangeWidgetsInGridOnMonitor(widgets, monitorId, resizeX, resizeY);
436 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ arrangeWidgetsInGridOnPrimaryMonitor()

void geometrize::script::bindings::arrangeWidgetsInGridOnPrimaryMonitor ( const std::vector< QWidget * > &  widgets,
int  resizeX,
int  resizeY 
)
444 {
446 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ broadcastCommandObject()

void geometrize::script::bindings::broadcastCommandObject ( Command command)
394 {
396 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ broadcastCommandString()

void geometrize::script::bindings::broadcastCommandString ( const std::string &  command)
389 {
391 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ clamp()

template<typename T , typename U , typename V >
T geometrize::script::bindings::clamp ( value,
lower,
upper 
)
165 {
166  assert(lower <= upper);
167  if (value < lower) {
168  value = lower;
169  }
170  if (value > upper) {
171  value = upper;
172  }
173  return value;
174 }
Here is the caller graph for this function:

◆ clampFloat()

float geometrize::script::bindings::clampFloat ( const float  value,
const float  lower,
const float  upper 
)
281 {
282  return clamp<float, float, float>(value, lower, upper);
283 }
Here is the caller graph for this function:

◆ clampInt()

int geometrize::script::bindings::clampInt ( const int  value,
const int  lower,
const int  upper 
)
276 {
277  return clamp<int, int, int>(value, lower, upper);
278 }
Here is the caller graph for this function:

◆ clearGlobalClipboard()

void geometrize::script::bindings::clearGlobalClipboard ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createAnimatedGifExportBindings()

std::shared_ptr< chaiscript::Module > geometrize::script::bindings::createAnimatedGifExportBindings ( )

createGifExportBindings Creates the ChaiScript to C++ bindings for saving animated GIFs.

Returns
A shared pointer to a module encapsulating the bindings.
416 {
417  using namespace geometrize::script::bindings;
418 
419  auto module = createModule();
420 
422 
423  return module;
424 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createDefaultBindings()

std::shared_ptr< chaiscript::Module > geometrize::script::bindings::createDefaultBindings ( )

createDefaultBindings Creates the default Chaiscript to C++ bindings.

Returns
A shared pointer to a module encapsulating the bindings.
83 {
84  auto module = createModule();
85 
87 
92 
101 
104 
106 
115 
117 
119 
122 
126 
129 
134 
136 
138 
139  ADD_FREE_FUN_TEMPLATE(randomInRange, float COMMA float COMMA float);
140  ADD_FREE_FUN_TEMPLATE(clamp, float COMMA float COMMA float);
141 
142  // Some specialized helper templates if in doubt
145 
148 
149  ADD_FREE_FUN_TEMPLATE(randomInVector, std::pair<int COMMA int>);
150  ADD_FREE_FUN_TEMPLATE(randomInVector, std::pair<float COMMA float>);
151 
152  ADD_FREE_FUN_TEMPLATE(vectorContains, std::pair<int COMMA int>);
153  ADD_FREE_FUN_TEMPLATE(vectorContains, std::pair<float COMMA float>);
154 
156 
158 
162 
166 
167  ADD_TYPE(Command);
168  ADD_MEMBER(Command, getCommand);
169  ADD_MEMBER(Command, setStringArg);
170 
171  ADD_TYPE(CommandHandler);
172  ADD_MEMBER(CommandHandler, handleCommand);
173  ADD_MEMBER(CommandHandler, getCommandHandlerName);
174  ADD_MEMBER(CommandHandler, setCommandHandlerName);
175 
178 
181 
184 
187 
189 
190  return module;
191 }
Here is the caller graph for this function:

◆ createDirectory()

bool geometrize::script::bindings::createDirectory ( const std::string &  dirPath)
111 {
112  return geometrize::util::createDirectory(dirPath);
113 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createFunctionalTestHelperBindings()

std::shared_ptr< chaiscript::Module > geometrize::script::bindings::createFunctionalTestHelperBindings ( )

createFunctionalTestHelperBindings Creates ChaiScript to C++ bindings for helper functions needed for the functional/self-tests (e.g. reporting test results).

Returns
A shared pointer encapsulating the bindings.
661 {
662  auto module = createModule();
663 
665 
666  return module;
667 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createGeometrizeLibraryBindings()

std::shared_ptr< chaiscript::Module > geometrize::script::bindings::createGeometrizeLibraryBindings ( )

createGeometrizeLibraryBindings Creates the Chaiscript to C++ bindings for all of the functionality in the Geometrize library.

Returns
A shared pointer to a module enscapsulating the bindings.
427 {
428  auto module = createModule();
429 
430  ADD_TYPE(Bitmap);
431  ADD_CONSTRUCTOR(Bitmap, Bitmap(std::uint32_t COMMA std::uint32_t COMMA geometrize::rgba));
432  ADD_CONSTRUCTOR(Bitmap, Bitmap(std::uint32_t COMMA std::uint32_t COMMA const std::vector<std::uint8_t>& data));
433  ADD_CONSTRUCTOR(Bitmap, Bitmap(const geometrize::Bitmap&));
434  ADD_MEMBER(Bitmap, getWidth);
435  ADD_MEMBER(Bitmap, getHeight);
436  ADD_MEMBER(Bitmap, copyData);
437  ADD_MEMBER(Bitmap, getDataRef);
438  ADD_MEMBER(Bitmap, getPixel);
439  ADD_MEMBER(Bitmap, setPixel);
440  ADD_MEMBER(Bitmap, fill);
441 
442  ADD_TYPE(rgba);
443  ADD_MEMBER(rgba, r);
444  ADD_MEMBER(rgba, g);
445  ADD_MEMBER(rgba, b);
446  ADD_MEMBER(rgba, a);
447 
448  using namespace geometrize::exporter;
449 
450  ADD_FREE_FUN(exportBitmapData);
452  ADD_FREE_FUN(exportShapeArray);
453  ADD_FREE_FUN(exportShapeJson);
454  ADD_FREE_FUN(exportSVG);
455 
456  ADD_TYPE(ImageRunner);
457  ADD_CONSTRUCTOR(ImageRunner, ImageRunner(const geometrize::Bitmap&));
458  ADD_CONSTRUCTOR(ImageRunner, ImageRunner(const geometrize::Bitmap& COMMA const geometrize::Bitmap&));
459  ADD_MEMBER(ImageRunner, step);
460  //ADD_MEMBER(ImageRunner, getCurrent);
461  //ADD_MEMBER(ImageRunner, getTarget);
462  ADD_MEMBER(ImageRunner, getModel);
463 
464  ADD_TYPE(Shape);
465  ADD_MEMBER(Shape, getType);
466  ADD_MEMBER(Shape, clone);
467 
468  ADD_BASE_CLASS(Shape, Circle);
469  ADD_TYPE(Circle);
470  ADD_CONSTRUCTOR(Circle, Circle(float COMMA float COMMA float));
471  ADD_MEMBER(Circle, m_x);
472  ADD_MEMBER(Circle, m_y);
473  ADD_MEMBER(Circle, m_r);
474 
475  ADD_BASE_CLASS(Shape, Ellipse);
476  ADD_TYPE(Ellipse);
477  ADD_CONSTRUCTOR(Ellipse, Ellipse(float COMMA float COMMA float COMMA float));
478  ADD_MEMBER(Ellipse, m_x);
479  ADD_MEMBER(Ellipse, m_y);
480  ADD_MEMBER(Ellipse, m_rx);
481  ADD_MEMBER(Ellipse, m_ry);
482 
483  ADD_BASE_CLASS(Shape, Line);
484  ADD_TYPE(Line);
485  ADD_CONSTRUCTOR(Line, Line(float COMMA float COMMA float COMMA float));
486  ADD_MEMBER(Line, m_x1);
487  ADD_MEMBER(Line, m_y1);
488  ADD_MEMBER(Line, m_x2);
489  ADD_MEMBER(Line, m_y2);
490 
491  ADD_BASE_CLASS(Shape, Polyline);
492  ADD_TYPE(Polyline);
493  ADD_CONSTRUCTOR(Polyline, Polyline(const std::vector<std::pair<float, float>>));
494 
495  // Make the polyline points vector accessible from scripts
496  chaiscript::bootstrap::standard_library::pair_type<std::pair<float, float>>("FloatPair", *module);
497  chaiscript::bootstrap::standard_library::vector_type<std::vector<std::pair<float, float>>>("IntPairVector", *module);
498  module->add(chaiscript::vector_conversion<std::vector<std::pair<float, float>>>());
499  ADD_MEMBER(Polyline, m_points);
500 
501  ADD_BASE_CLASS(Shape, QuadraticBezier);
502  ADD_TYPE(QuadraticBezier);
503  ADD_CONSTRUCTOR(QuadraticBezier, QuadraticBezier(float COMMA float COMMA float COMMA float COMMA float COMMA float));
504  ADD_MEMBER(QuadraticBezier, m_cx);
505  ADD_MEMBER(QuadraticBezier, m_cy);
506  ADD_MEMBER(QuadraticBezier, m_x1);
507  ADD_MEMBER(QuadraticBezier, m_y1);
508  ADD_MEMBER(QuadraticBezier, m_x2);
509  ADD_MEMBER(QuadraticBezier, m_y2);
510 
511  ADD_BASE_CLASS(Shape, Rectangle);
512  ADD_TYPE(Rectangle);
513  ADD_CONSTRUCTOR(Rectangle, Rectangle(float COMMA float COMMA float COMMA float));
514  ADD_MEMBER(Rectangle, m_x1);
515  ADD_MEMBER(Rectangle, m_y1);
516  ADD_MEMBER(Rectangle, m_x2);
517  ADD_MEMBER(Rectangle, m_y2);
518 
519  ADD_BASE_CLASS(Shape, RotatedEllipse);
520  ADD_TYPE(RotatedEllipse);
521  ADD_CONSTRUCTOR(RotatedEllipse, RotatedEllipse(float COMMA float COMMA float COMMA float COMMA float));
522  ADD_MEMBER(RotatedEllipse, m_x);
523  ADD_MEMBER(RotatedEllipse, m_y);
524  ADD_MEMBER(RotatedEllipse, m_rx);
525  ADD_MEMBER(RotatedEllipse, m_ry);
526  ADD_MEMBER(RotatedEllipse, m_angle);
527 
528  ADD_BASE_CLASS(Shape, RotatedRectangle);
529  ADD_TYPE(RotatedRectangle);
530  ADD_CONSTRUCTOR(RotatedRectangle, RotatedRectangle(float COMMA float COMMA float COMMA float COMMA float));
531  ADD_MEMBER(RotatedRectangle, m_x1);
532  ADD_MEMBER(RotatedRectangle, m_y1);
533  ADD_MEMBER(RotatedRectangle, m_x2);
534  ADD_MEMBER(RotatedRectangle, m_y2);
535  ADD_MEMBER(RotatedRectangle, m_angle);
536 
537  ADD_BASE_CLASS(Shape, Triangle);
538  ADD_TYPE(Triangle);
539  ADD_CONSTRUCTOR(Triangle, Triangle(float COMMA float COMMA float COMMA float COMMA float COMMA float));
540  ADD_MEMBER(Triangle, m_x1);
541  ADD_MEMBER(Triangle, m_y1);
542  ADD_MEMBER(Triangle, m_x2);
543  ADD_MEMBER(Triangle, m_y2);
544  ADD_MEMBER(Triangle, m_x3);
545  ADD_MEMBER(Triangle, m_y3);
546 
547  chaiscript::utility::add_class<geometrize::ShapeTypes>(*module,
548  "ShapeTypes",
549  {
550  { RECTANGLE, "RECTANGLE" },
551  { ROTATED_RECTANGLE, "ROTATED_RECTANGLE" },
552  { TRIANGLE, "TRIANGLE" },
553  { ELLIPSE, "ELLIPSE" },
554  { ROTATED_ELLIPSE, "ROTATED_ELLIPSE" },
555  { CIRCLE, "CIRCLE" },
556  { LINE, "LINE" },
557  { QUADRATIC_BEZIER, "QUADRATIC_BEZIER" },
558  { POLYLINE, "POLYLINE" }
559  });
560 
561  using namespace geometrize::core;
562 
563  ADD_FREE_FUN(defaultEnergyFunction);
564 
565  ADD_TYPE(Scanline);
566  ADD_MEMBER(Scanline, y);
567  ADD_MEMBER(Scanline, x1);
568  ADD_MEMBER(Scanline, x2);
569 
570  chaiscript::bootstrap::standard_library::vector_type<std::vector<Scanline>>("ScanlineVector", *module);
571 
572  using namespace geometrize::commonutil;
573 
574  ADD_FREE_FUN(seedRandomGenerator);
575  ADD_FREE_FUN(getAverageImageColor);
576 
577  ADD_FREE_FUN(shapesOverlap);
578  ADD_FREE_FUN(shapeContains);
579 
580  ADD_FREE_FUN(shapeToPixels);
581 
582  ADD_FREE_FUN(scanlinesContainTransparentPixels);
583 
584  ADD_TYPE(Model);
585  ADD_CONSTRUCTOR(Model, Model(const geometrize::Bitmap&));
586  ADD_CONSTRUCTOR(Model, Model(const geometrize::Bitmap& COMMA const geometrize::Bitmap&));
587 
588  ADD_MEMBER(Model, reset);
589  ADD_MEMBER(Model, getWidth);
590  ADD_MEMBER(Model, getHeight);
591  ADD_MEMBER(Model, step);
592  //ADD_MEMBER(Model, drawShape);
593  //ADD_MEMBER(Model, getCurrent);
594  //ADD_MEMBER(Model, getTarget);
595  ADD_MEMBER(Model, setSeed);
596 
597  return module;
598 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createImageBindings()

std::shared_ptr< chaiscript::Module > geometrize::script::bindings::createImageBindings ( )

createImageBindings Creates the Chaiscript to C++ bindings for image manipulation.

Returns
A shared pointer to a module encapsulating the bindings.
289 {
290  using namespace geometrize::image;
291 
292  auto module = createModule();
293 
294  ADD_TYPE(QImage);
295 
296  ADD_MEMBER(QImage, sizeInBytes);
297  ADD_MEMBER(QImage, colorCount);
298  ADD_MEMBER(QImage, depth);
299  ADD_MEMBER(QImage, isNull);
300  ADD_MEMBER(QImage, width);
301  ADD_MEMBER(QImage, height);
302 
303  chaiscript::utility::add_class<Qt::TransformationMode>(*module,
304  "TransformationMode",
305  {
306  { Qt::FastTransformation, "QtFastTransformation" },
307  { Qt::SmoothTransformation, "QtSmoothTransformation" }
308  });
309  ADD_MEMBER(QImage, scaledToWidth);
310  ADD_MEMBER(QImage, scaledToHeight);
311 
316 
317  return module;
318 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createImageExportBindings()

std::shared_ptr< chaiscript::Module > geometrize::script::bindings::createImageExportBindings ( )

createImageExportBindings Creates the Chaiscript to C++ bindings for saving images.

Returns
A shared pointer to a module encapsulating the bindings.
403 {
404  using namespace geometrize::exporter;
405 
406  auto module = createModule();
407 
411 
412  return module;
413 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createImageTask()

geometrize::task::ImageTask * geometrize::script::bindings::createImageTask ( geometrize::Bitmap &  bitmap)
46 {
47  return new task::ImageTask(bitmap);
48 }
Here is the caller graph for this function:

◆ createImageTaskBindings()

std::shared_ptr< chaiscript::Module > geometrize::script::bindings::createImageTaskBindings ( )

createImageTaskBindings Creates the Chaiscript to C++ bindings for Geometrize image tasks.

Returns
A shared pointer to a module encapsulating the bindings.
344 {
345  using namespace geometrize::task;
346  using namespace geometrize::preferences;
347 
348  auto module = createModule();
349 
351 
353 
354  ADD_MEMBER(ImageTask, stepModel);
355  ADD_MEMBER(ImageTask, drawBackgroundRectangle);
356  ADD_MEMBER(ImageTask, getTarget);
357  ADD_MEMBER(ImageTask, getCurrent);
358  ADD_MEMBER(ImageTask, getTargetMutable);
359  ADD_MEMBER(ImageTask, getCurrentMutable);
360  ADD_MEMBER(ImageTask, getPreferences);
361  ADD_MEMBER(ImageTask, setPreferences);
362  ADD_MEMBER(ImageTask, getDisplayName);
363  ADD_MEMBER(ImageTask, getWidth);
364  ADD_MEMBER(ImageTask, getHeight);
365  ADD_MEMBER(ImageTask, getTaskId);
366  ADD_MEMBER(ImageTask, isStepping);
367 
369 
371 
375 
376  ADD_MEMBER(ImageTaskPreferences, enableShapeTypes);
377  ADD_MEMBER(ImageTaskPreferences, disableShapeTypes);
378  ADD_MEMBER(ImageTaskPreferences, setShapeTypes);
379  ADD_MEMBER(ImageTaskPreferences, setShapeAlpha);
380  ADD_MEMBER(ImageTaskPreferences, setCandidateShapeCount);
381  ADD_MEMBER(ImageTaskPreferences, setMaxShapeMutations);
383  ADD_MEMBER(ImageTaskPreferences, setMaxThreads);
384 
385  module->add(chaiscript::fun(
386  static_cast<void(ImageTaskPreferences::*)(double, double, double, double)>
387  (&ImageTaskPreferences::setShapeBounds)), "setShapeBounds");
388 
389  ADD_MEMBER(ImageTaskPreferences, setShapeBoundsXMinPercent);
390  ADD_MEMBER(ImageTaskPreferences, setShapeBoundsYMinPercent);
391  ADD_MEMBER(ImageTaskPreferences, setShapeBoundsXMaxPercent);
392  ADD_MEMBER(ImageTaskPreferences, setShapeBoundsYMaxPercent);
393  ADD_MEMBER(ImageTaskPreferences, setShapeBoundsEnabled);
394 
395  ADD_MEMBER(ImageTaskPreferences, isScriptModeEnabled);
396  ADD_MEMBER(ImageTaskPreferences, setScriptModeEnabled);
397  ADD_MEMBER(ImageTaskPreferences, setScript);
398 
399  return module;
400 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createImageTaskWindow()

geometrize::dialog::ImageTaskWindow * geometrize::script::bindings::createImageTaskWindow ( )
36 {
37  return new dialog::ImageTaskWindow();
38 }
Here is the caller graph for this function:

◆ createImageTaskWindowBindings()

std::shared_ptr< chaiscript::Module > geometrize::script::bindings::createImageTaskWindowBindings ( )

createImageTaskWindowBindings Creates the Chaiscript to C++ binding for the Geometrize image task window.

Returns
A shared pointer to a module encapsulating the bindings.
252 {
253  using namespace geometrize::dialog;
254  using namespace geometrize::common::ui;
255 
256  auto module = createModule();
257 
259 
260  ADD_BASE_CLASS(QMainWindow, ImageTaskWindow);
263  ADD_BASE_CLASS(CommandHandler, ImageTaskWindow);
264 
266 
273 
274  chaiscript::bootstrap::standard_library::vector_type<std::vector<ImageTaskWindow*>>("ImageTaskWindowVector", *module);
276 
279  ADD_MEMBER(ImageTaskWindow, getImageTask);
280  ADD_MEMBER(ImageTaskWindow, setImageTask);
281 
282  module->add(chaiscript::fun(static_cast<void(ImageTaskWindow::*)(int, int)>(&ImageTaskWindow::resize)), "resize");
283  module->add(chaiscript::fun(static_cast<void(ImageTaskWindow::*)(int, int)>(&ImageTaskWindow::move)), "move");
284 
285  return module;
286 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createLaunchWindow()

geometrize::dialog::LaunchWindow * geometrize::script::bindings::createLaunchWindow ( )
41 {
42  return new dialog::LaunchWindow();
43 }
Here is the caller graph for this function:

◆ createLaunchWindowBindings()

std::shared_ptr< chaiscript::Module > geometrize::script::bindings::createLaunchWindowBindings ( )

createLaunchWindowBindings Creates the Chaiscript to C++ bindings for the Geometrize launch window.

Returns
A shared pointer to a module encapsulating the bindings.
221 {
222  using namespace geometrize::dialog;
223  using namespace geometrize::common::ui;
224 
225  auto module = createModule();
226 
228 
229  ADD_BASE_CLASS(QMainWindow, LaunchWindow);
230  ADD_BASE_CLASS(QWidget, LaunchWindow);
231  ADD_BASE_CLASS(QObject, LaunchWindow);
232  ADD_BASE_CLASS(CommandHandler, LaunchWindow);
233 
235 
237 
238  chaiscript::bootstrap::standard_library::vector_type<std::vector<LaunchWindow*>>("LaunchWindowVector", *module);
240 
241  ADD_MEMBER(LaunchWindow, show);
242  ADD_MEMBER(LaunchWindow, hide);
243  ADD_MEMBER(LaunchWindow, updateGeometry);
244 
245  module->add(chaiscript::fun(static_cast<void(LaunchWindow::*)(int, int)>(&LaunchWindow::resize)), "resize");
246  module->add(chaiscript::fun(static_cast<void(LaunchWindow::*)(int, int)>(&LaunchWindow::move)), "move");
247 
248  return module;
249 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createMathBindings()

std::shared_ptr< chaiscript::Module > geometrize::script::bindings::createMathBindings ( )

createMathBindings Creates the Chaiscript to C++ bindings for common math functions.

Returns
A shared pointer to a module encapsulating the bindings.
645 {
647 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createQWidgetBindings()

std::shared_ptr< chaiscript::Module > geometrize::script::bindings::createQWidgetBindings ( )

createQWidgetBindings Creates the Chaiscript to C++ bindings for the Qt QWidget class.

Returns
A shared pointer to a module encapsulating the bindings.
194 {
195  auto module = createModule();
196 
197  ADD_TYPE(QWidget);
198 
199  ADD_BASE_CLASS(QObject, QWidget);
200 
201  ADD_MEMBER(QWidget, show);
202  ADD_MEMBER(QWidget, hide);
203  ADD_MEMBER(QWidget, updateGeometry);
204 
207 
213 
214  module->add(chaiscript::fun(static_cast<void(QWidget::*)(int, int)>(&QWidget::resize)), "resize");
215  module->add(chaiscript::fun(static_cast<void(QWidget::*)(int, int)>(&QWidget::move)), "move");
216 
217  return module;
218 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createSynchronousImageTaskBindings()

std::shared_ptr< chaiscript::Module > geometrize::script::bindings::createSynchronousImageTaskBindings ( )

createSynchronousImageTaskBindings Creates the Chaiscript to C++ bindings for synchronous Geometrize image tasks (used by the Twitter bot).

Returns
A shared pointer to a module encapsulating the bindings.
321 {
322  using namespace geometrize::task;
323  using namespace geometrize::preferences;
324 
325  auto module = createModule();
326 
327  // Note we use synchronous-stepping image tasks for simplicity in some scripts e.g. the Twitter bot
329 
331 
332  ADD_MEMBER(SynchronousImageTask, stepModel);
333  ADD_MEMBER(SynchronousImageTask, drawBackgroundRectangle);
334  ADD_MEMBER(SynchronousImageTask, getTarget);
335  ADD_MEMBER(SynchronousImageTask, getCurrent);
336  ADD_MEMBER(SynchronousImageTask, getPreferences);
337  ADD_MEMBER(SynchronousImageTask, setPreferences);
338  ADD_MEMBER(SynchronousImageTask, getShapes);
339 
340  return module;
341 }
Here is the caller graph for this function:

◆ createTabletEventBindings()

std::shared_ptr< chaiscript::Module > geometrize::script::bindings::createTabletEventBindings ( )

createTabletEventBindings Creates the Chaiscript to C++ bindings for tablet events (e.g. Wacom pen input data).

Returns
A shared pointer to a module encapsulating the bindings.
601 {
602  using namespace geometrize::scene;
603 
604  auto module = createModule();
605 
606  chaiscript::utility::add_class<TabletEventType>(*module,
607  "TabletEventType",
608  {
609  { TabletEventType::Move, "Move" },
610  { TabletEventType::Press, "Press" },
611  { TabletEventType::Release, "Release" },
612  { TabletEventType::EnterProximity, "EnterProximity" },
613  { TabletEventType::LeaveProximity, "LeaveProximity" },
614  { TabletEventType::Unknown, "Unknown" }
615  });
616 
617  chaiscript::utility::add_class<TabletEventPointerType>(*module,
618  "TabletEventPointerType",
619  {
620  { TabletEventPointerType::UnknownPointer, "UnknownPointer" },
621  { TabletEventPointerType::Pen, "Pen" },
622  { TabletEventPointerType::Cursor, "Cursor" },
623  { TabletEventPointerType::Eraser, "Eraser" }
624  });
625 
627  ADD_MEMBER(TabletEventData, eventType);
628  ADD_MEMBER(TabletEventData, pointerType);
629  ADD_MEMBER(TabletEventData, xViewPos);
630  ADD_MEMBER(TabletEventData, yViewPos);
631  ADD_MEMBER(TabletEventData, xScenePos);
632  ADD_MEMBER(TabletEventData, yScenePos);
633  ADD_MEMBER(TabletEventData, pressure);
634  ADD_MEMBER(TabletEventData, tangentialPressure);
635  ADD_MEMBER(TabletEventData, rotation);
636  ADD_MEMBER(TabletEventData, xTilt);
637  ADD_MEMBER(TabletEventData, yTilt);
638 
640 
641  return module;
642 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createUserInterfacePuppeteerBindings()

std::shared_ptr< chaiscript::Module > geometrize::script::bindings::createUserInterfacePuppeteerBindings ( )

createUserInterfacePuppeteerBindings Creates ChaiScript to C++ bindings for driving the user interface (primarily for testing purposes).

Returns
A shared pointer encapsulating the bindings.
650 {
651  auto module = createModule();
652 
656 
657  return module;
658 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ customTabletEventDataToString()

std::string geometrize::script::bindings::customTabletEventDataToString ( const geometrize::scene::TabletEventData data)
349 {
350  return geometrize::scene::tabletEventDataToString(data).toStdString();
351 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ debugBreak()

void geometrize::script::bindings::debugBreak ( )
81 {
83 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ directoriesExist()

bool geometrize::script::bindings::directoriesExist ( const std::vector< std::string > &  dirPaths)
101 {
102  return geometrize::util::directoriesExist(dirPaths);
103 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ directoryContainsFile()

bool geometrize::script::bindings::directoryContainsFile ( const std::string &  dirPath,
const std::string &  fileName 
)
106 {
107  return geometrize::util::directoryContainsFile(dirPath, fileName);
108 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ directoryExists()

bool geometrize::script::bindings::directoryExists ( const std::string &  dirPath)
96 {
97  return geometrize::util::directoryExists(dirPath);
98 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ exportGIF()

bool geometrize::script::bindings::exportGIF ( const std::vector< geometrize::ShapeResult > &  data,
const std::uint32_t  inputWidth,
const std::uint32_t  inputHeight,
const std::uint32_t  outputWidth,
const std::uint32_t  outputHeight,
const std::size_t  frameSkip,
const std::string &  filePath 
)
337 {
338  return geometrize::exporter::exportGIF(data, inputWidth, inputHeight, outputWidth, outputHeight, [frameSkip](std::size_t frameIndex) {
339  return frameSkip == 0U ? false : (frameIndex % frameSkip == 0);
340  }, filePath);
341 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fileExists()

bool geometrize::script::bindings::fileExists ( const std::string &  filePath)
91 {
92  return geometrize::util::fileExists(filePath);
93 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fitImageTaskWidgetsInGridOnMonitor()

void geometrize::script::bindings::fitImageTaskWidgetsInGridOnMonitor ( int  screenIdx)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fitImageTaskWidgetsInGridOnPrimaryMonitor()

void geometrize::script::bindings::fitImageTaskWidgetsInGridOnPrimaryMonitor ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fitWidgetsInGridOnMonitor()

void geometrize::script::bindings::fitWidgetsInGridOnMonitor ( const std::vector< QWidget * > &  widgets,
int  screenIdx 
)
454 {
456 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fitWidgetsInGridOnPrimaryMonitor()

void geometrize::script::bindings::fitWidgetsInGridOnPrimaryMonitor ( const std::vector< QWidget * > &  widgets)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAllNamedCommandHandlers()

std::vector< std::string > geometrize::script::bindings::getAllNamedCommandHandlers ( )
369 {
371 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAllNamedGeometrizeWidgets()

std::vector< std::string > geometrize::script::bindings::getAllNamedGeometrizeWidgets ( )
359 {
361 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAllNamedWidgets()

std::vector< std::string > geometrize::script::bindings::getAllNamedWidgets ( )
354 {
356 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAppDataLocation()

std::string geometrize::script::bindings::getAppDataLocation ( )
241 {
243 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getApplicationDirectoryLocation()

std::string geometrize::script::bindings::getApplicationDirectoryLocation ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getApplicationDirectoryPath()

std::string geometrize::script::bindings::getApplicationDirectoryPath ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCommandHandlerByName()

CommandHandler * geometrize::script::bindings::getCommandHandlerByName ( const std::string &  name)
374 {
376 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCursorX()

int geometrize::script::bindings::getCursorX ( )
296 {
298 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCursorY()

int geometrize::script::bindings::getCursorY ( )
301 {
303 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getDesktopDirectoryLocation()

std::string geometrize::script::bindings::getDesktopDirectoryLocation ( )
251 {
253 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getDirectoryForFilePath()

std::string geometrize::script::bindings::getDirectoryForFilePath ( const std::string &  filePath)
177 {
179 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFileNameForFilePath()

std::string geometrize::script::bindings::getFileNameForFilePath ( const std::string &  filePath)
182 {
184 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFilenameTimestamp()

std::string geometrize::script::bindings::getFilenameTimestamp ( )
404 {
406 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFilePathsForDirectory()

std::vector< std::string > geometrize::script::bindings::getFilePathsForDirectory ( const std::string &  dirPath)
121 {
123 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFilesWithExtension()

std::vector< std::string > geometrize::script::bindings::getFilesWithExtension ( const std::string &  dirPath,
const std::string &  extension 
)
157 {
158  return getFilesWithExtensions(dirPath, { extension });
159 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFilesWithExtensions()

std::vector< std::string > geometrize::script::bindings::getFilesWithExtensions ( const std::string &  ,
const std::vector< std::string > &   
)
146 {
147  std::vector<std::string> files;
148 
149  //for(const std::string& extension : extensions) {
150  // TODO
151  //}
152 
153  return files;
154 }
Here is the caller graph for this function:

◆ getFirstFileWithExtension()

std::string geometrize::script::bindings::getFirstFileWithExtension ( const std::string &  dirPath,
const std::string &  extension 
)
136 {
137  return geometrize::util::getFirstFileWithExtension(dirPath, extension);
138 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFirstFileWithExtensions()

std::string geometrize::script::bindings::getFirstFileWithExtensions ( const std::string &  dirPath,
const std::vector< std::string > &  extensions 
)
141 {
142  return geometrize::util::getFirstFileWithExtensions(dirPath, extensions);
143 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFormattedTimestamp()

std::string geometrize::script::bindings::getFormattedTimestamp ( const std::string &  formatString)
399 {
400  return geometrize::util::getFormattedTimestamp(formatString);
401 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getGlobalClipboardText()

std::string geometrize::script::bindings::getGlobalClipboardText ( )
216 {
218 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getHomeDirectoryLocation()

std::string geometrize::script::bindings::getHomeDirectoryLocation ( )
246 {
248 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getImageTaskWindows()

std::vector< geometrize::dialog::ImageTaskWindow * > geometrize::script::bindings::getImageTaskWindows ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getLaunchWindows()

std::vector< geometrize::dialog::LaunchWindow * > geometrize::script::bindings::getLaunchWindows ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getOperatingSystemProductType()

std::string geometrize::script::bindings::getOperatingSystemProductType ( )
291 {
293 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getScriptSearchPaths()

std::vector< std::string > geometrize::script::bindings::getScriptSearchPaths ( )
126 {
128 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getScriptsForPath()

std::vector< std::string > geometrize::script::bindings::getScriptsForPath ( const std::string &  dirPath)
167 {
168  return geometrize::util::getScriptsForPath(dirPath);
169 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getScriptsForPaths()

std::vector< std::string > geometrize::script::bindings::getScriptsForPaths ( const std::vector< std::string > &  dirPaths)
172 {
173  return geometrize::util::getScriptsForPaths(dirPaths);
174 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSupportedImageFileExtensions()

std::vector< std::string > geometrize::script::bindings::getSupportedImageFileExtensions ( )
162 {
164 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSupportedLocaleCodes()

std::vector< std::string > geometrize::script::bindings::getSupportedLocaleCodes ( )
316 {
317  QStringList codes = geometrize::getSupportedLocaleCodes();
318  std::vector<std::string> v;
319  for(const QString& s : codes) {
320  v.emplace_back(s.toStdString());
321  }
322  return v;
323 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTemplateSearchPaths()

std::vector< std::string > geometrize::script::bindings::getTemplateSearchPaths ( )
131 {
133 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getUuidString()

std::string geometrize::script::bindings::getUuidString ( )
409 {
411 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getWidgetByName()

QWidget * geometrize::script::bindings::getWidgetByName ( const std::string &  widgetName)
364 {
365  return geometrize::util::getWidgetByName(widgetName);
366 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ messageBox()

void geometrize::script::bindings::messageBox ( const std::string &  str)
76 {
78 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ openInDefaultApplication()

bool geometrize::script::bindings::openInDefaultApplication ( const std::string &  path)
201 {
203 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ openTask()

void geometrize::script::bindings::openTask ( const std::string &  url,
const bool  addToRecents 
)
187 {
188  // Horrible workaround because QUrl doesn't handle Qt resource file prefixes well
189  // See: https://forum.qt.io/topic/1494/universal-solution-for-resource-prefix
190  // Note this breaks QUrl validation too (QUrl isValid chokes when given this modified url)
191  QString qUrl{QString::fromStdString(url)};
192  const QString strToReplace{":/"};
193  if(qUrl.startsWith(strToReplace)) {
194  qUrl.replace(0, strToReplace.size(), "qrc:///");
195  }
196 
197  geometrize::util::openTasks(QStringList(QString::fromStdString(url)), addToRecents);
198 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ percentEncode()

std::string geometrize::script::bindings::percentEncode ( const std::string &  str)
261 {
263 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ printToAllScriptConsoleWidgets()

void geometrize::script::bindings::printToAllScriptConsoleWidgets ( const std::string &  str)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ printToConsole()

void geometrize::script::bindings::printToConsole ( const std::string &  str)
66 {
68 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ processApplicationEvents()

void geometrize::script::bindings::processApplicationEvents ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ randomFloatInRange()

float geometrize::script::bindings::randomFloatInRange ( const float  lower,
const float  upper 
)
271 {
272  return randomInRange<float, float, float>(lower, upper);
273 }
Here is the caller graph for this function:

◆ randomInRange()

template<typename T , typename U , typename V >
T geometrize::script::bindings::randomInRange ( lower,
upper 
)
149 {
150  return static_cast<T>(geometrize::util::randomInRange(static_cast<int>(lower), static_cast<int>(upper)));
151 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ randomIntInRange()

int geometrize::script::bindings::randomIntInRange ( const int  lower,
const int  upper 
)
266 {
267  return randomInRange<int, int, int>(lower, upper);
268 }
Here is the caller graph for this function:

◆ randomInVector()

template<typename T >
T geometrize::script::bindings::randomInVector ( const std::vector< T > &  v)
158 {
159  assert(!v.empty());
160  return v[randomInRange<int, std::size_t, std::size_t>(0, v.size() - 1)];
161 }
Here is the caller graph for this function:

◆ readFileAsString()

std::string geometrize::script::bindings::readFileAsString ( const std::string &  filePath)
116 {
117  return geometrize::util::readFileAsString(filePath);
118 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ revealInDefaultApplication()

bool geometrize::script::bindings::revealInDefaultApplication ( const std::string &  path)
206 {
208 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ saveWidgetScreenshot()

bool geometrize::script::bindings::saveWidgetScreenshot ( const std::string &  path,
QWidget *  widget 
)
344 {
345  return geometrize::util::saveWidgetScreenshot(path, widget);
346 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sendCommandObject()

void geometrize::script::bindings::sendCommandObject ( const std::string &  target,
Command command 
)
384 {
385  geometrize::util::sendCommand(target, command);
386 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sendCommandString()

void geometrize::script::bindings::sendCommandString ( const std::string &  target,
const std::string &  command 
)
379 {
380  geometrize::util::sendCommand(target, command);
381 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setCursorPos()

void geometrize::script::bindings::setCursorPos ( const int  x,
const int  y 
)
306 {
308 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setGlobalClipboardText()

void geometrize::script::bindings::setGlobalClipboardText ( const std::string &  text)
221 {
223 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setLocaleAndUserInterfaceLanguage()

void geometrize::script::bindings::setLocaleAndUserInterfaceLanguage ( const std::string &  locale)
326 {
327  geometrize::setLocaleAndUserInterfaceLanguage(QString::fromStdString(locale));
328 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setTranslatorsForLocale()

void geometrize::script::bindings::setTranslatorsForLocale ( const std::string &  locale)
311 {
312  geometrize::setTranslatorsForLocale(QString::fromStdString(locale));
313 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setWidgetPosition()

void geometrize::script::bindings::setWidgetPosition ( QWidget *  widget,
int  x,
int  y 
)
419 {
421 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setWidgetSize()

void geometrize::script::bindings::setWidgetSize ( QWidget *  widget,
int  width,
int  height 
)
414 {
415  geometrize::util::setWidgetSize(widget, width, height);
416 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ split()

std::vector< std::string > geometrize::script::bindings::split ( const std::string &  s,
const char  delimiter 
)
286 {
287  return geometrize::util::split(s, delimiter);
288 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ stringBeginsWith()

bool geometrize::script::bindings::stringBeginsWith ( const std::string &  str,
const std::string &  prefix 
)
226 {
227  return geometrize::util::stringBeginsWith(str, prefix);
228 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ stringEndsWith()

bool geometrize::script::bindings::stringEndsWith ( const std::string &  str,
const std::string &  suffix 
)
231 {
232  return geometrize::util::stringEndsWith(str, suffix);
233 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vectorContains()

template<typename T >
bool geometrize::script::bindings::vectorContains ( const std::vector< T > &  v,
const T &  t 
)
182 {
183  return (std::find(v.begin(), v.end(), t) != v.end());
184 }
Here is the caller graph for this function:

◆ writeStringToFile()

bool geometrize::script::bindings::writeStringToFile ( const std::string &  str,
const std::string &  path 
)
256 {
257  return geometrize::util::writeStringToFile(str, path);
258 }
Here is the call graph for this function:
Here is the caller graph for this function:
ADD_TYPE
#define ADD_TYPE(Class)
Definition: bindingshelpers.h:12
geometrize::util::arrangeImageTaskWidgetsInGrid
void arrangeImageTaskWidgetsInGrid(int centerX, int centerY, int xDim, int yDim, int resizeX, int resizeY)
arrangeImageTaskWidgetsInGrid Arranges all the open image task widgets into a grid shape
Definition: util.cpp:540
geometrize::image
Definition: imageloader.cpp:20
geometrize::util::printToConsole
void printToConsole(const std::string &str)
printToConsole A convenience function for printing a string to the command-line console.
Definition: util.cpp:87
geometrize::util::getFileNameForFilePath
std::string getFileNameForFilePath(const std::string &filePath)
getFileNameForFilePath Gets the filename from the given local file path.
Definition: util.cpp:273
geometrize::util::fitWidgetsInGridOnPrimaryMonitor
void fitWidgetsInGridOnPrimaryMonitor(const std::vector< QWidget * > &widgets)
fitWidgetsInGridOnPrimaryMonitor Fits the given widgets into a grid on the primary monitor
Definition: util.cpp:592
geometrize::util::debugBreak
void debugBreak()
debugBreak Forces the debugger to break/halt the application when this is called.
Definition: util.cpp:75
geometrize::util::getHomeDirectoryLocation
std::string getHomeDirectoryLocation()
getHomeDirectoryLocation Returns a path to where the user's home directory is.
Definition: util.cpp:324
geometrize::script::bindings::getFilesWithExtensions
std::vector< std::string > getFilesWithExtensions(const std::string &, const std::vector< std::string > &)
Definition: bindingswrapper.cpp:145
geometrize::dialog::LaunchWindow
The LaunchWindow class models the UI for a launchpad for opening new task templates and recent tasks.
Definition: launchwindow.h:22
geometrize::util::getCursorY
int getCursorY()
getCursorY Gets the y-coordinate of the cursor in global screen coordinates.
Definition: util.cpp:379
geometrize::util::getFirstFileWithExtensions
std::string getFirstFileWithExtensions(const std::string &dirPath, const std::vector< std::string > &extensions)
getFirstFileWithExtensions Gets the absolute file path to the first file with one of the given extens...
Definition: util.cpp:224
geometrize::image::loadImage
QImage loadImage(const std::string &filePath)
loadImage Loads an image from the image at the file path. Converts to RGBA8888 format.
Definition: imageloader.cpp:64
geometrize::scene::TabletEventData
The TabletEventData class represents data produced from a Wacom pen/tablet event (in the context of a...
Definition: customtabletevent.h:56
geometrize::script::sleep
void sleep(const std::size_t ms)
sleep Causes the calling thread to sleep for the given length of time.
Definition: scriptutil.cpp:43
geometrize::dialog::LaunchWindow::getTopLevelLaunchWindows
static std::vector< LaunchWindow * > getTopLevelLaunchWindows()
getTopLevelLaunchWindows Gets all of the existing top level launch windows.
Definition: launchwindow.cpp:296
geometrize::searchpaths::getTemplateSearchPaths
std::vector< std::string > getTemplateSearchPaths()
getTemplateSearchpaths Gets the directory paths that the program will search for project file templat...
Definition: searchpaths.cpp:26
geometrize::image::convertImageToRgba8888
QImage convertImageToRgba8888(const QImage &image)
convertImageToRgba8888 Returns a copy of the image in the RGBA8888 format.
Definition: imageloader.cpp:82
ADD_MEMBER
#define ADD_MEMBER(Class, Name)
Definition: bindingshelpers.h:10
geometrize::util::directoryContainsFile
bool directoryContainsFile(const std::string &dirPath, const std::string &fileName)
directoryContainsFile Checks if the directory contains the given file, returns true if it does.
Definition: util.cpp:135
geometrize::searchpaths::getScriptSearchPaths
std::vector< std::string > getScriptSearchPaths()
getScriptSearchPaths Gets the directory paths that the program will search for scripts....
Definition: searchpaths.cpp:21
geometrize::preferences
Definition: globalpreferences.cpp:21
geometrize::util::getScriptsForPath
std::vector< std::string > getScriptsForPath(const std::string &dirPath)
getScriptsForPath Gets the absolute file paths to the script files (*.chai) for the given directory,...
Definition: util.cpp:236
geometrize::util::getScriptsForPaths
std::vector< std::string > getScriptsForPaths(const std::vector< std::string > &dirPaths)
getScriptsForPaths Gets the absolute file paths to the script files (*.chai) for the given directorie...
Definition: util.cpp:252
geometrize::exporter::exportGIF
bool exportGIF(const std::vector< geometrize::ShapeResult > &data, std::uint32_t inputWidth, std::uint32_t inputHeight, std::uint32_t outputWidth, std::uint32_t outputHeight, const std::function< bool(std::size_t)> &frameSkipPredicate, const std::string &filePath)
exportGIF Exports shape data to a GIF image.
Definition: gifexporter.cpp:80
geometrize::script::bindings::sendCommandString
void sendCommandString(const std::string &target, const std::string &command)
Definition: bindingswrapper.cpp:378
geometrize::util::getWidgetByName
QWidget * getWidgetByName(const std::string &widgetName)
getWidgetByName Returns the first found instance of the existing widget with the given name
Definition: util.cpp:423
geometrize::script::bindings::broadcastCommandObject
void broadcastCommandObject(Command &command)
Definition: bindingswrapper.cpp:393
geometrize::dialog::ImageTaskWindow::getExistingImageTaskWindows
static std::vector< ImageTaskWindow * > getExistingImageTaskWindows()
getExistingImageTaskWindows Gets all of the existing image task windows.
Definition: imagetaskwindow.cpp:881
geometrize::util::clearGlobalClipboard
void clearGlobalClipboard()
clearGlobalClipboard Clears the global system clipboard contents.
Definition: util.cpp:289
geometrize::util::getFormattedTimestamp
std::string getFormattedTimestamp(const std::string &formatString)
getFormattedTimestamp Gets a formatted timestamp for the current local time
Definition: util.cpp:496
geometrize::util::getAllNamedWidgets
std::vector< std::string > getAllNamedWidgets()
getAllWidgetNames Returns a vector containing the names of all the existing widgets in the applicatio...
Definition: util.cpp:399
geometrize::util::fitWidgetsInGridOnMonitor
void fitWidgetsInGridOnMonitor(const std::vector< QWidget * > &widgets, int screenIdx)
fitWidgetsInGridOnMonitor Fits the given widgets into a grid on the given monitor
Definition: util.cpp:572
geometrize::util::arrangeImageTaskWidgetsInGridOnPrimaryMonitor
void arrangeImageTaskWidgetsInGridOnPrimaryMonitor(int resizeX, int resizeY)
arrangeImageTaskWidgetsInGridOnPrimaryMonitor Arranges all the open image task widgets into a grid on...
Definition: util.cpp:567
geometrize::util::readFileAsString
std::string readFileAsString(const std::string &filePath)
readFileAsString Reads a file, returning a string containing the contents.
Definition: util.cpp:155
geometrize::util::revealInDefaultApplication
bool revealInDefaultApplication(const std::string &path)
revealInDefaultApplication Reveals the given path in the parent folder (or path with the filename tri...
Definition: util.cpp:283
geometrize::common::ui
Definition: uiactions.cpp:28
geometrize::util::processApplicationEvents
void processApplicationEvents()
processApplicationEvents Processes all pending application events for the calling thread.
Definition: util.cpp:110
geometrize::util::getGlobalClipboardText
std::string getGlobalClipboardText()
getGlobalClipboardText Gets the global system clipboard text.
Definition: util.cpp:294
ADD_FREE_FUN_TEMPLATE
#define ADD_FREE_FUN_TEMPLATE(Name, Params)
Definition: bindingshelpers.h:9
geometrize::util::getFilenameTimestamp
std::string getFilenameTimestamp()
getFilenameTimestamp Gets a filename timestamp string for the current local time
Definition: util.cpp:501
geometrize::util::getDirectoryForFilePath
std::string getDirectoryForFilePath(const std::string &filePath)
getDirectoryForFilePath Gets the directory path from the given local file path.
Definition: util.cpp:262
geometrize::script::bindings::getImageTaskWindows
std::vector< geometrize::dialog::ImageTaskWindow * > getImageTaskWindows()
Definition: bindingswrapper.cpp:55
geometrize::script::bindings::exportGIF
bool exportGIF(const std::vector< geometrize::ShapeResult > &data, const std::uint32_t inputWidth, const std::uint32_t inputHeight, const std::uint32_t outputWidth, const std::uint32_t outputHeight, const std::size_t frameSkip, const std::string &filePath)
Definition: bindingswrapper.cpp:330
geometrize::script::bindings::createImageTask
geometrize::task::ImageTask * createImageTask(geometrize::Bitmap &bitmap)
Definition: bindingswrapper.cpp:45
geometrize::util::directoriesExist
bool directoriesExist(const std::vector< std::string > &dirPaths)
directoriesExist Checks if the given directories exist, returns true if all do.
Definition: util.cpp:130
geometrize::format::getReadableImageFileExtensions
std::vector< std::string > getReadableImageFileExtensions(const bool includeDotPrefix)
getReadableImageFileExtensions Gets the lower-case image file extensions that have read support.
Definition: formatsupport.cpp:11
geometrize::util::getFilesWithExtension
std::vector< std::string > getFilesWithExtension(const std::string &dirPath, const std::string &extension)
getFilesWithExtension Gets the absolute file paths to the files with the given extension in the given...
Definition: util.cpp:203
geometrize::util::printToAllScriptConsoleWidgets
void printToAllScriptConsoleWidgets(const std::string &str)
printToAllScriptConsoleWidgets A convenience function for printing a string to all the GUI console wi...
Definition: util.cpp:92
geometrize::preferences::ImageTaskPreferences
The ImageTaskPreferences class models the preferences associated with an image task.
Definition: imagetaskpreferences.h:29
geometrize::util::setCursorPos
void setCursorPos(const int x, const int y)
setCursorPos Sets the cursor position in global screen coordinates.
Definition: util.cpp:384
geometrize::util::getApplicationDirectoryLocation
std::string getApplicationDirectoryLocation()
getApplicationDirectory Get directory that the application is in.
Definition: util.cpp:314
geometrize::exporter
Definition: gifexporter.cpp:78
geometrize::util::getOperatingSystemProductType
std::string getOperatingSystemProductType()
getOperatingSystemProductType Returns the product name of the operating system this application is ru...
Definition: util.cpp:389
geometrize::script::bindings
Definition: bindingscreator.cpp:80
geometrize::script::bindings::getSupportedImageFileExtensions
std::vector< std::string > getSupportedImageFileExtensions()
Definition: bindingswrapper.cpp:161
geometrize::util::getCursorX
int getCursorX()
getCursorX Gets the x-coordinate of the cursor in global screen coordinates.
Definition: util.cpp:374
COMMA
#define COMMA
Definition: bindingshelpers.h:5
geometrize::util::writeStringToFile
bool writeStringToFile(const std::string &str, const std::string &path)
writeStringToFile Writes the string to the file path, attempting to overwrite any existing file at th...
Definition: util.cpp:334
geometrize::util::getAllNamedGeometrizeWidgets
std::vector< std::string > getAllNamedGeometrizeWidgets()
getAllWidgetNames Returns a vector containing the names of all the widgets in the application with "g...
Definition: util.cpp:411
geometrize::script::bindings::createImageTaskWindow
geometrize::dialog::ImageTaskWindow * createImageTaskWindow()
Definition: bindingswrapper.cpp:35
geometrize::image::createBitmap
Bitmap createBitmap(const QImage &image)
createBitmap Creates a bitmap data object from the given image.
Definition: imageloader.cpp:22
geometrize::util::arrangeImageTaskWidgetsInGridOnMonitor
void arrangeImageTaskWidgetsInGridOnMonitor(int screenIdx, int resizeX, int resizeY)
arrangeImageTaskWidgetsInGridOnMonitor Arranges all the open image task widgets into a grid on the gi...
Definition: util.cpp:557
geometrize::script::bindings::randomIntInRange
int randomIntInRange(const int lower, const int upper)
Definition: bindingswrapper.cpp:265
geometrize::util::sendCommand
void sendCommand(const std::string &target, const std::string &command)
sendCommand Sends a command to the given command handler
Definition: util.cpp:456
geometrize::scene::tabletEventDataToString
QString tabletEventDataToString(const TabletEventData &data)
tabletEventDataToString Helper function to convert a structure of tablet event data to a string
Definition: customtabletevent.cpp:44
geometrize::task
Definition: imagetaskexportwidget.h:19
geometrize::util::createDirectory
bool createDirectory(const std::string &dirPath)
createDirectory Creates the directory at the given path, recursively creating subdirectories if neede...
Definition: util.cpp:150
geometrize::util::getDesktopDirectoryLocation
std::string getDesktopDirectoryLocation()
getDesktopDirectoryLocation Returns a path to where the user's desktop is.
Definition: util.cpp:329
geometrize::scene::TabletEventPointerType::UnknownPointer
@ UnknownPointer
geometrize::script::bindings::getLaunchWindows
std::vector< geometrize::dialog::LaunchWindow * > getLaunchWindows()
Definition: bindingswrapper.cpp:50
geometrize::util::getFirstFileWithExtension
std::string getFirstFileWithExtension(const std::string &dirPath, const std::string &extension)
getFirstFileWithExtension Gets the absolute file path to the first file with the given extension in t...
Definition: util.cpp:214
geometrize::setTranslatorsForLocale
void setTranslatorsForLocale(const QString &locale)
installTranslatorsForLocale Installs translators for the application.
Definition: localization.cpp:76
geometrize::util::saveWidgetScreenshot
bool saveWidgetScreenshot(const std::string &path, QWidget *widget)
saveWidgetScreenshot Takes a screenshot of the given widget and saves it as a .png image to the given...
Definition: util.cpp:394
geometrize::util::messageBox
void messageBox(const std::string &str)
messageBox A convenience function for displaying a message box containing a message.
Definition: util.cpp:103
geometrize::util::randomInRange
int randomInRange(const int lower, const int upper)
randomInRange Returns a random integer in the range [lower, upper], inclusive. Note that this uses th...
Definition: util.cpp:361
geometrize::util::arrangeWidgetsInGrid
void arrangeWidgetsInGrid(const std::vector< QWidget * > &widgets, int centerX, int centerY, int xDim, int yDim, int resizeX, int resizeY)
arrangeWidgetsInGrid Arranges the given widgets into a grid shape
Definition: util.cpp:521
geometrize::script::bindings::createLaunchWindow
geometrize::dialog::LaunchWindow * createLaunchWindow()
Definition: bindingswrapper.cpp:40
geometrize::util::getFilePathsForDirectory
std::vector< std::string > getFilePathsForDirectory(const std::string &dirPath)
getFilePathsForDirectory Gets the absolute file paths to the files in the given directory.
Definition: util.cpp:166
geometrize::util::percentEncode
std::string percentEncode(const std::string &str)
percentEncode Returns a percent-encoded copy of the input string.
Definition: util.cpp:354
geometrize::scene::TabletEventType::Move
@ Move
geometrize::util::setWidgetPosition
void setWidgetPosition(QWidget *widget, int x, int y)
setWidgetPosition Sets the widget to the given position.
Definition: util.cpp:516
geometrize::util::stringBeginsWith
bool stringBeginsWith(const std::string &str, const std::string &prefix)
stringBeginsWith Checks if a string begins with the given prefix.
Definition: util.cpp:304
geometrize::script::bindings::randomFloatInRange
float randomFloatInRange(const float lower, const float upper)
Definition: bindingswrapper.cpp:270
geometrize::util::setGlobalClipboardText
void setGlobalClipboardText(const std::string &text)
setClipboardText Sets the global system clipboard text.
Definition: util.cpp:299
geometrize::util::directoryExists
bool directoryExists(const std::string &dirPath)
directoryExists Checks if a directory exists, returns true if it does.
Definition: util.cpp:125
geometrize::getSupportedLocaleCodes
QStringList getSupportedLocaleCodes()
getSupportedLocaleCodes Iterates over the embedded .qm files and extracts the ISO language codes from...
Definition: localization.cpp:212
geometrize::util::broadcastCommand
void broadcastCommand(const std::string &command)
broadcastCommand Sends a command to all command handlers
Definition: util.cpp:480
geometrize::script::bindings::customTabletEventDataToString
std::string customTabletEventDataToString(const geometrize::scene::TabletEventData &data)
Definition: bindingswrapper.cpp:348
geometrize::dialog
Definition: aboutdialog.cpp:14
geometrize::util::getCommandHandlerByName
geometrize::script::CommandHandler * getCommandHandlerByName(const std::string &name)
getCommandHandlerByName Returns the first found instance of the existing command handler with the giv...
Definition: util.cpp:444
ADD_BASE_CLASS
#define ADD_BASE_CLASS(Base, Derived)
Definition: bindingshelpers.h:13
geometrize::exporter::exportImage
bool exportImage(const QImage &image, const std::string &filePath)
exportImage Exports the image data to an image format that Qt supports (depending on the file extensi...
Definition: imageexporter.cpp:30
geometrize::util::arrangeWidgetsInGridOnMonitor
void arrangeWidgetsInGridOnMonitor(const std::vector< QWidget * > &widgets, int screenIdx, int resizeX, int resizeY)
arrangeWidgetsInGridOnMonitor Arranges the given widgets into a grid on the given monitor
Definition: util.cpp:545
geometrize::script::bindings::broadcastCommandString
void broadcastCommandString(const std::string &command)
Definition: bindingswrapper.cpp:388
chaiscript::extras::math::bootstrap
ModulePtr bootstrap(ModulePtr m=std::make_shared< Module >())
Definition: chaiscriptmathextras.h:550
geometrize::task::ImageTask
The ImageTask class transforms a source image into a collection of shapes approximating the source im...
Definition: imagetask.h:53
geometrize::util::clamp
T clamp(T value, T lower, T upper)
clamp Clamps a value within a range.
Definition: util.h:266
geometrize::util::getUuidString
std::string getUuidString()
getUuidString Gets a Universally Unique Identifier (UUID) as a string
Definition: util.cpp:506
geometrize::script::bindings::clampInt
int clampInt(const int value, const int lower, const int upper)
Definition: bindingswrapper.cpp:275
geometrize::script::bindings::openTask
void openTask(const std::string &url, const bool addToRecents)
Definition: bindingswrapper.cpp:186
geometrize::setLocaleAndUserInterfaceLanguage
void setLocaleAndUserInterfaceLanguage(const QString &isoCode)
setLocaleAndUserInterfaceLanguage Sets the application locale and user interface language to the give...
Definition: localization.cpp:226
geometrize::exporter::exportRasterizedSvg
bool exportRasterizedSvg(const std::vector< geometrize::ShapeResult > &shapes, const std::uint32_t inputWidth, const std::uint32_t inputHeight, const std::uint32_t outputWidth, const std::uint32_t outputHeight, const std::string &filePath)
exportRasterizedSvg Exports the shape data as an image by rasterizing an SVG rendered from the shape ...
Definition: imageexporter.cpp:74
geometrize::util::openInDefaultApplication
bool openInDefaultApplication(const std::string &path)
openInDefaultApplication Opens the given path in the default application.
Definition: util.cpp:278
geometrize::util::fileExists
bool fileExists(const std::string &filePath)
fileExists Checks if a file exists, returns true if it does.
Definition: util.cpp:120
geometrize::util::getAppDataLocation
std::string getAppDataLocation()
getAppDataLocation Returns a directory location where persistent application data can be stored.
Definition: util.cpp:319
geometrize::script::bindings::sendCommandObject
void sendCommandObject(const std::string &target, Command &command)
Definition: bindingswrapper.cpp:383
ADD_FREE_FUN
#define ADD_FREE_FUN(Name)
Definition: bindingshelpers.h:8
geometrize::util::getAllNamedCommandHandlers
std::vector< std::string > getAllNamedCommandHandlers()
getAllNamedCommandHandlers Gets all of the existing objects in the application that implement the Com...
Definition: util.cpp:434
geometrize::util::arrangeWidgetsInGridOnPrimaryMonitor
void arrangeWidgetsInGridOnPrimaryMonitor(const std::vector< QWidget * > &widgets, int resizeX, int resizeY)
arrangeWidgetsInGridOnPrimaryMonitor Arranges the given widgets into a grid on the primary monitor
Definition: util.cpp:562
geometrize::image::convertImageToBitmapWithDownscaling
geometrize::Bitmap convertImageToBitmapWithDownscaling(const QImage &image)
imageToBitmapWithDownscaling Creates a bitmap data object from the given image, downscaling in the pr...
Definition: imageloader.cpp:32
geometrize::exporter::exportBitmap
bool exportBitmap(const geometrize::Bitmap &bitmap, const std::string &filePath)
exportBitmap Exports the Geometrize bitmap data to an image format that Qt supports (depending on the...
Definition: imageexporter.cpp:24
geometrize::util::fitImageTaskWidgetsInGridOnPrimaryMonitor
void fitImageTaskWidgetsInGridOnPrimaryMonitor()
fitImageTaskWidgetsInGridOnPrimaryMonitor Fits all of the open image task widgets into a grid on the ...
Definition: util.cpp:597
ADD_CONSTRUCTOR
#define ADD_CONSTRUCTOR(Class, Signature)
Definition: bindingshelpers.h:14
geometrize::util::setWidgetSize
void setWidgetSize(QWidget *widget, int width, int height)
setWidgetSize Sets the size of the given widget in pixels.
Definition: util.cpp:511
geometrize::script::bindings::vectorContains
bool vectorContains(const std::vector< T > &v, const T &t)
Definition: bindingswrapper.h:181
geometrize::script::bindings::clampFloat
float clampFloat(const float value, const float lower, const float upper)
Definition: bindingswrapper.cpp:280
geometrize::dialog::ImageTaskWindow
The ImageTaskWindow class encapsulates the UI for manipiulating, running and viewing an image task th...
Definition: imagetaskwindow.h:31
geometrize::util::openTasks
void openTasks(const QStringList &urls, const bool addToRecents)
Definition: taskutil.cpp:58
geometrize::scene
Definition: areaofinfluenceshapeitem.cpp:10
geometrize::util::split
std::vector< std::string > split(const std::string &s, const char delimiter)
split Splits a given string into a vector of tokens using the given delimiter.
Definition: util.cpp:367
geometrize::util::fitImageTaskWidgetsInGridOnMonitor
void fitImageTaskWidgetsInGridOnMonitor(int screenIdx)
fitImageTaskWidgetsInGridOnMonitor Fits all of the open image task widgets into a grid on the given m...
Definition: util.cpp:587
geometrize::script::bindings::randomInVector
T randomInVector(const std::vector< T > &v)
Definition: bindingswrapper.h:157
geometrize::util::stringEndsWith
bool stringEndsWith(const std::string &str, const std::string &suffix)
stringEndsWith Checks if a string ends with the given suffix.
Definition: util.cpp:309
geometrize::searchpaths::getApplicationDirectoryPath
std::string getApplicationDirectoryPath()
getApplicationDirectoryPath Gets the directory that contains the application executable.
Definition: searchpaths.cpp:16
geometrize::task::SynchronousImageTask
The SynchronousImageTask class transforms a source image into a collection of shapes approximating th...
Definition: synchronousimagetask.h:28