the SpriteImage constructor signature changes from
SpriteImage(
uint16_t width, uint16_t height, float pixelRatio,
std::string&& data, bool sdf = false);
to
SpriteImage(PremultipliedImage&&, float pixelRatio, bool sdf = false)
33 lines
721 B
C++
33 lines
721 B
C++
#ifndef MBGL_SPRITE_IMAGE
|
|
#define MBGL_SPRITE_IMAGE
|
|
|
|
#include <mbgl/util/noncopyable.hpp>
|
|
#include <mbgl/util/geo.hpp>
|
|
#include <mbgl/util/image.hpp>
|
|
|
|
#include <string>
|
|
#include <memory>
|
|
#include <cstdint>
|
|
|
|
namespace mbgl {
|
|
|
|
class SpriteImage : private util::noncopyable {
|
|
public:
|
|
SpriteImage(PremultipliedImage&&, float pixelRatio, bool sdf = false);
|
|
|
|
PremultipliedImage image;
|
|
|
|
// Pixel ratio of the sprite image.
|
|
const float pixelRatio;
|
|
|
|
// Whether this image should be interpreted as a signed distance field icon.
|
|
const bool sdf;
|
|
|
|
float getWidth() const { return image.width / pixelRatio; }
|
|
float getHeight() const { return image.height / pixelRatio; }
|
|
};
|
|
|
|
} // namespace mbgl
|
|
|
|
#endif
|