diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2015-06-11 11:07:28 -0400 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2015-07-08 19:45:59 +0200 |
commit | 7f705da5644092d48b48aaacbe3dc232ff5149fc (patch) | |
tree | ea5612d580d0cafe4144175505c55c379d8e7e7e /src/mbgl/annotation/sprite_image.hpp | |
parent | 03c4ed75a2684b9866a00eebf0392c96cceb8d34 (diff) | |
download | qtlocation-mapboxgl-7f705da5644092d48b48aaacbe3dc232ff5149fc.tar.gz |
Sprite store API
Diffstat (limited to 'src/mbgl/annotation/sprite_image.hpp')
-rw-r--r-- | src/mbgl/annotation/sprite_image.hpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/mbgl/annotation/sprite_image.hpp b/src/mbgl/annotation/sprite_image.hpp new file mode 100644 index 0000000000..2d0ac920a8 --- /dev/null +++ b/src/mbgl/annotation/sprite_image.hpp @@ -0,0 +1,36 @@ +#ifndef MBGL_ANNOTATIONS_SPRITE_IMAGE +#define MBGL_ANNOTATIONS_SPRITE_IMAGE + +#include <mbgl/util/noncopyable.hpp> +#include <mbgl/util/geo.hpp> + +#include <string> +#include <memory> +#include <cstdint> + +namespace mbgl { + +class SpriteImage : private util::noncopyable { +public: + SpriteImage(uint16_t width, uint16_t height, float ratio, std::string&& data); + + // Logical dimensions of the sprite image. + const uint16_t width; + const uint16_t height; + + // Pixel ratio of the sprite image. + const float ratio; + + // Physical dimensions of the sprite image. + const uint16_t pixelWidth; + const uint16_t pixelHeight; + + // A string of an RGBA8 representation of the sprite. It must have exactly + // (width * ratio) * (height * ratio) * 4 (RGBA) bytes. The scan lines may + // not have gaps between them (i.e. stride == 0). + const std::string data; +}; + +} + +#endif |