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

Functions

std::vector< std::string > getReadableImageFileExtensions (bool includeDotPrefix)
 getReadableImageFileExtensions Gets the lower-case image file extensions that have read support. More...
 
std::vector< std::string > getSupportedTemplateManifestFileExtensions ()
 getSupportedTemplateManifestFileExtensions Gets the supported template manifest file extensions for serialization and de-serialization. More...
 
QList< QUrl > getUrls (const QMimeData *const data)
 getUrls Gets a list of URLs from a Qt MimeData item. More...
 

Function Documentation

std::vector< std::string > geometrize::format::getReadableImageFileExtensions ( bool  includeDotPrefix)

getReadableImageFileExtensions Gets the lower-case image file extensions that have read support.

Parameters
includeDotPrefixWhether to include the dot prefix on file extensions e.g. "jpg" or ".jpg".
Returns
The list of supported image file extensions.
12 {
13  std::vector<std::string> extensions;
14 
15  const QList<QByteArray> supportedImageFormats{QImageReader::supportedImageFormats()};
16  for(int i = 0; i < supportedImageFormats.count(); i++) {
17  QString format;
18  if(includeDotPrefix) {
19  format += ".";
20  }
21  format += QString(supportedImageFormats.at(i)).toLower();
22  extensions.push_back(format.toStdString());
23  }
24 
25  return extensions;
26 }

Here is the caller graph for this function:

std::vector< std::string > geometrize::format::getSupportedTemplateManifestFileExtensions ( )

getSupportedTemplateManifestFileExtensions Gets the supported template manifest file extensions for serialization and de-serialization.

Returns
The list of supported template manifest file extensions.
29 {
30  const static std::vector<std::string> extensions{"json", "xml"}; // TODO case sensitivity?
31 
32  return extensions;
33 }

Here is the caller graph for this function:

QList< QUrl > geometrize::format::getUrls ( const QMimeData *const  data)

getUrls Gets a list of URLs from a Qt MimeData item.

Parameters
dataThe Mime data.
Returns
List of URLs.
36 {
37  return data->urls();
38 }

Here is the caller graph for this function: