summaryrefslogtreecommitdiff
path: root/src/mbgl/layer/raster_layer.hpp
blob: d473505d56825b2baac98b9dee401f3148bba157 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#pragma once

#include <mbgl/style/style_layer.hpp>
#include <mbgl/style/paint_property.hpp>

namespace mbgl {

class RasterPaintProperties {
public:
    PaintProperty<float> rasterOpacity { 1.0f };
    PaintProperty<float> rasterHueRotate { 0.0f };
    PaintProperty<float> rasterBrightnessMin { 0.0f };
    PaintProperty<float> rasterBrightnessMax { 1.0f };
    PaintProperty<float> rasterSaturation { 0.0f };
    PaintProperty<float> rasterContrast { 0.0f };
    PaintProperty<float> rasterFadeDuration { 0.0f };
};

class RasterLayer : public StyleLayer {
public:
    RasterLayer() : StyleLayer(Type::Raster) {}
    std::unique_ptr<StyleLayer> clone() const override;

    void parseLayout(const JSValue&) override {};
    void parsePaints(const JSValue&) override;

    void cascade(const StyleCascadeParameters&) override;
    bool recalculate(const StyleCalculationParameters&) override;

    std::unique_ptr<Bucket> createBucket(StyleBucketParameters&) const override;

    RasterPaintProperties paint;
};

template <>
inline bool StyleLayer::is<RasterLayer>() const {
    return type == Type::Raster;
}

} // namespace mbgl