diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2017-05-15 14:09:06 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2017-05-16 12:26:35 -0700 |
commit | cc1ea759a681cadcfd06fd7bdda79ca6deb38c62 (patch) | |
tree | 97ece422b0516b11979c84b8136f95aeabb1aa91 /src/mbgl/sprite/sprite_parser.hpp | |
parent | c0f6e5ccefc67dbdaa6ab7c7ea75a2a2d0c3f2ae (diff) | |
download | qtlocation-mapboxgl-cc1ea759a681cadcfd06fd7bdda79ca6deb38c62.tar.gz |
[core, node, darwin, android, qt] Make image ID part of Image
More like Source and Layer.
Diffstat (limited to 'src/mbgl/sprite/sprite_parser.hpp')
-rw-r--r-- | src/mbgl/sprite/sprite_parser.hpp | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/src/mbgl/sprite/sprite_parser.hpp b/src/mbgl/sprite/sprite_parser.hpp index 175ec8a883..f602818d3b 100644 --- a/src/mbgl/sprite/sprite_parser.hpp +++ b/src/mbgl/sprite/sprite_parser.hpp @@ -1,13 +1,10 @@ #pragma once #include <mbgl/util/image.hpp> -#include <mbgl/util/noncopyable.hpp> -#include <mbgl/util/variant.hpp> -#include <mbgl/util/geo.hpp> #include <string> #include <memory> -#include <unordered_map> +#include <vector> namespace mbgl { @@ -16,17 +13,16 @@ class Image; } // namespace style // Extracts an individual image from a spritesheet from the given location. -std::unique_ptr<style::Image> createStyleImage(const PremultipliedImage&, - uint32_t srcX, - uint32_t srcY, - uint32_t srcWidth, - uint32_t srcHeight, - double ratio, - bool sdf); - -using Images = std::unordered_map<std::string, std::unique_ptr<style::Image>>; +std::unique_ptr<style::Image> createStyleImage(const std::string& id, + const PremultipliedImage&, + uint32_t srcX, + uint32_t srcY, + uint32_t srcWidth, + uint32_t srcHeight, + double ratio, + bool sdf); // Parses an image and an associated JSON file and returns the sprite objects. -Images parseSprite(const std::string& image, const std::string& json); +std::vector<std::unique_ptr<style::Image>> parseSprite(const std::string& image, const std::string& json); } // namespace mbgl |