|
libosmscout 0.1
|
Looks a pattern image up in the pattern image directories of a render parameter and classifies the outcome, so that every map backend can report a pattern fill it cannot serve in the same way. More...
#include <PatternLookup.h>
Public Types | |
| enum class | Status : uint8_t { Found , NotFound , NoSourceConfigured } |
| Outcome of searching the configured pattern image directories for a pattern. More... | |
Public Member Functions | |
| PatternLookup ()=delete | |
Static Public Member Functions | |
| static std::string | Describe (const std::list< std::string > &patternPaths, const std::string &patternName, const std::string &extension, Status status) |
| Report for a lookup that did not resolve the pattern: names the pattern and either says that no pattern image source is configured or lists the directories that were searched. | |
| static Status | Resolve (const std::list< std::string > &patternPaths, const std::string &patternName, const std::string &extension, std::string &filename) |
| Search the given directories for an image of the pattern. | |
Looks a pattern image up in the pattern image directories of a render parameter and classifies the outcome, so that every map backend can report a pattern fill it cannot serve in the same way.
The lookup only answers where an image is and what should be reported if there is none; loading the image stays with the backend, because every backend keeps its images in its own type.
|
strong |
Outcome of searching the configured pattern image directories for a pattern.
|
delete |
References Describe(), and Resolve().
|
static |
Report for a lookup that did not resolve the pattern: names the pattern and either says that no pattern image source is configured or lists the directories that were searched.
| patternPaths | directories the lookup searched |
| patternName | pattern name as the style sheet uses it, without an extension |
| extension | image file extension including the dot (for example ".png") |
| status | outcome of the lookup |
References Found, NoSourceConfigured, and NotFound.
Referenced by osmscout::MapPainterCairo::HasPattern(), osmscout::MapPainterQt::HasPattern(), and PatternLookup().
|
static |
Search the given directories for an image of the pattern.
The directories are searched in their given order, so the first directory that holds the image wins.
| patternPaths | directories to search, in the order to search them |
| patternName | pattern name as the style sheet uses it, without an extension |
| extension | image file extension including the dot (for example ".png") |
| filename | set to the file that holds the image, empty otherwise |
References Found, NoSourceConfigured, and NotFound.
Referenced by osmscout::MapPainterCairo::HasPattern(), osmscout::MapPainterQt::HasPattern(), and PatternLookup().