Files
MapLibreParticleLab/include/mbgl/style/image.hpp
John Firebaugh 5dd98df50b [all] Rationalize style::Image
A style has a collection of images, just as it has collections of sources and layers.

* Name things appropriately
* Use std::unique_ptr
2017-04-24 15:52:28 -07:00

26 lines
561 B
C++

#pragma once
#include <mbgl/util/image.hpp>
namespace mbgl {
namespace style {
class Image {
public:
Image(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.size.width / pixelRatio; }
float getHeight() const { return image.size.height / pixelRatio; }
};
} // namespace style
} // namespace mbgl