|static QStringList||colorProfileDirectories ()|
|static QSharedPointer< PerceptualColor::RgbColorSpace >||createFromFile (const QString &fileName)|
|static QSharedPointer< PerceptualColor::RgbColorSpace >||createSrgb ()|
Factory for color space objects.
These color space objects are needed in the constructors of various classes of this library.
Creating color space objects can be slow. But once created, they can be used simultaneously on various widgets. Thanks to the QSharedPointer, you can easily create a color space object, pass it to the widget constructors you like, and then forget about it – it will be deleted automatically when the last widget that used it has been deleted. And passing the shared pointer to widget constructors is fast! Usage example:
Member Function Documentation
List of directories where color profiles are typically stored on the current system.
Often, but not always, operating systems have an API to get access to this directories with color profiles or to get the actual color profile of a specific device (screen, printer…). On Linux, this is typically provided by colord. Also on Windows, there are specific API calls (   ) Some other operating systems have similar APIs.
The best solution is to rely on the operating system’s API. However, if you can’t use this API for some reasons, this function provides a last-resort alternative. Not all operating systems have standardised directories for colour profiles. This function provide a list of typical storage locations of ICC profile files and works satisfactorily for at least Linux, BSD, MacOS and Windows.
- A preference-ordered list of typical storage locations of color profiles on the current system. The list might be empty if no color profile directories are found on the system. The returned directories use '/' as file separator regardless of the operating system, just as
QFileexpects. To find color profiles, parse these directories recursively, including subdirectories. Note that ICC colour profiles traditionally have a file name ending in
.icmon Windows systems and a name ending in
.iccon all other operating systems, but today on every operating system you might find actually both file name endings.
- This function takes into account environment variables, home directories and so on. Potential colour profile directories that do not actually exist on the current system are not returned. Since these values could change, another call of this function could return a different result.
Try to create a color space object for a given ICC file.
- This function may fail to create the color space object when it cannot open the given file, or when the file cannot be interpreted.
- This function is called from the main thread.
fileName The file name. See
QFiledocumentation for what are valid file names. The file is only used during the execution of this function and it is closed again at the end of this function. The created object does not need the file anymore, because all necessary information has already been loaded into memory. Accepted are most RGB-based ICC profiles up to version 4.
- A shared pointer to a newly created color space object on success. A shared pointer to
The documentation for this class was generated from the following files: