MapLibre Native Core
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
image.hpp
Go to the documentation of this file.
1 #pragma once
2 
4 #include <mbgl/util/color.hpp>
5 
6 #include <string>
7 #include <vector>
8 #include <optional>
9 
10 namespace mbgl {
11 namespace style {
12 namespace expression {
13 
14 class Image {
15 public:
16  Image() = default;
17  Image(const char* imageID);
18  Image(std::string imageID);
19  explicit Image(std::string imageID, bool available);
20  bool operator==(const Image&) const;
22  const std::string& id() const;
23  bool isAvailable() const;
24  bool empty() const;
25 
26 private:
27  std::string imageID;
28  bool available;
29 };
30 
31 } // namespace expression
32 
33 namespace conversion {
34 
35 template <>
36 struct Converter<expression::Image> {
37 public:
38  std::optional<expression::Image> operator()(const Convertible& value, Error& error) const;
39 };
40 
41 template <>
42 struct ValueFactory<expression::Image> {
43  static Value make(const expression::Image& image) { return image.toValue(); }
44 };
45 
46 } // namespace conversion
47 
48 } // namespace style
49 } // namespace mbgl
const std::string & id() const
Image(std::string imageID, bool available)
bool operator==(const Image &) const
mbgl::Value toValue() const
Image(const char *imageID)
Image(std::string imageID)
std::unique_ptr< Expression > error(std::string)
std::unique_ptr< Expression > image(const char *value)
std::unique_ptr< Expression > string(std::unique_ptr< Expression >, std::unique_ptr< Expression > def=nullptr)
Definition: actor.hpp:15
mapbox::base::Value Value
Definition: feature.hpp:11
std::optional< expression::Image > operator()(const Convertible &value, Error &error) const
static Value make(const expression::Image &image)
Definition: image.hpp:43