1 #include <mbgl/style/image_impl.hpp> 2 #include <mbgl/util/exception.hpp> 3 4 namespace mbgl { 5 namespace style { 6 Impl(std::string id_,PremultipliedImage && image_,const float pixelRatio_,bool sdf_)7Image::Impl::Impl(std::string id_, 8 PremultipliedImage&& image_, 9 const float pixelRatio_, 10 bool sdf_) 11 : id(std::move(id_)), 12 image(std::move(image_)), 13 pixelRatio(pixelRatio_), 14 sdf(sdf_) { 15 16 if (!image.valid()) { 17 throw util::SpriteImageException("Sprite image dimensions may not be zero"); 18 } else if (pixelRatio <= 0) { 19 throw util::SpriteImageException("Sprite pixelRatio may not be <= 0"); 20 } 21 } 22 23 } // namespace style 24 } // namespace mbgl 25