Geometrize  1.0
An application for geometrizing images into geometric primitives
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
Classes | Functions
geometrize::task Namespace Reference

Classes

class  ImageTask
 The ImageTask class transforms a source image into a collection of shapes approximating the source image. More...
 
class  ImageTaskWorker
 The ImageTaskWorker class transforms a source image into a collection of shapes. It is made to be run on its own thread to avoid blocking the UI. More...
 
class  ShapeCollection
 The ShapeCollection class is a wrapper for the vector of shapes that have been added to the image task so far. More...
 
class  SynchronousImageTask
 The SynchronousImageTask class transforms a source image into a collection of shapes approximating the source image. A wrapper around the asynchronous ImageTask class, this blocks when stepping the model. This is a convenience class for use in scripts and console programs where we would rather block/wait when geometrizing something. More...
 

Functions

ImageTaskcreateImageTaskAndWindow (const std::string &displayName, const std::string &taskUrl)
 createImageTaskAndWindow Creates an image task, and immediately creates a graphical window for manipulating the task. More...
 
ImageTaskcreateImageTaskAndWindow (const std::string &displayName, const QImage &image)
 createImageTaskAndWindow Creates an image task, and immediately creates a graphical window for manipulating the task. More...
 

Function Documentation

ImageTask * geometrize::task::createImageTaskAndWindow ( const std::string &  displayName,
const std::string &  taskUrl 
)

createImageTaskAndWindow Creates an image task, and immediately creates a graphical window for manipulating the task.

Parameters
displayNameThe display name of the image task.
taskUrlThe URL of the task data source.
Returns
The created image task object.
51 {
52  geometrize::Bitmap bitmap{image::convertImageToBitmapWithDownscaling(replaceAlphaInImage(geometrize::image::loadImage(taskUrl)))};
53  ImageTask* task{new ImageTask(displayName, bitmap)};
54  dialog::ImageTaskWindow* imageTaskWindow{new dialog::ImageTaskWindow()};
55  imageTaskWindow->setImageTask(task);
56  imageTaskWindow->show();
57  return task;
58 }
geometrize::Bitmap convertImageToBitmapWithDownscaling(const QImage &image)
imageToBitmapWithDownscaling Creates a bitmap data object from the given image, downscaling in the pr...
Definition: imageloader.cpp:30
QImage loadImage(const std::string &filePath)
loadImage Loads an image from the image at the file path. Converts to RGBA8888 format.
Definition: imageloader.cpp:62

Here is the call graph for this function:

Here is the caller graph for this function:

ImageTask * geometrize::task::createImageTaskAndWindow ( const std::string &  displayName,
const QImage &  image 
)

createImageTaskAndWindow Creates an image task, and immediately creates a graphical window for manipulating the task.

Parameters
displayNameThe display name of the image task.
imageThe image that the task will work on.
Returns
The created image task object.
61 {
62  geometrize::Bitmap bitmap{image::convertImageToBitmapWithDownscaling(replaceAlphaInImage(image))};
63  ImageTask* task{new ImageTask(displayName, bitmap)};
64  dialog::ImageTaskWindow* imageTaskWindow{new dialog::ImageTaskWindow()};
65  imageTaskWindow->setImageTask(task);
66  imageTaskWindow->show();
67  return task;
68 }
geometrize::Bitmap convertImageToBitmapWithDownscaling(const QImage &image)
imageToBitmapWithDownscaling Creates a bitmap data object from the given image, downscaling in the pr...
Definition: imageloader.cpp:30

Here is the call graph for this function: