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)
24 lines
591 B
C++
24 lines
591 B
C++
#include <mbgl/sprite/sprite_image.hpp>
|
|
|
|
#include <mbgl/util/exception.hpp>
|
|
|
|
#include <cmath>
|
|
|
|
namespace mbgl {
|
|
|
|
SpriteImage::SpriteImage(PremultipliedImage&& image_,
|
|
const float pixelRatio_,
|
|
bool sdf_)
|
|
: image(std::move(image_)),
|
|
pixelRatio(pixelRatio_),
|
|
sdf(sdf_) {
|
|
|
|
if (image.size() == 0) {
|
|
throw util::SpriteImageException("Sprite image dimensions may not be zero");
|
|
} else if (pixelRatio <= 0) {
|
|
throw util::SpriteImageException("Sprite pixelRatio may not be <= 0");
|
|
}
|
|
}
|
|
|
|
} // namespace mbgl
|