summaryrefslogtreecommitdiff
path: root/src/mbgl/style/layers/raster_layer_properties.hpp
blob: d43ab78a9586896ef535d89068c0ed79752cf164 (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
// This file is generated. Edit scripts/generate-style-code.js, then run `make style-code`.

#pragma once

#include <mbgl/style/types.hpp>
#include <mbgl/style/layout_property.hpp>
#include <mbgl/style/paint_property.hpp>
#include <mbgl/style/properties.hpp>
#include <mbgl/programs/attributes.hpp>
#include <mbgl/programs/uniforms.hpp>

namespace mbgl {
namespace style {

struct RasterOpacity : PaintProperty<float> {
    static float defaultValue() { return 1; }
};

struct RasterHueRotate : PaintProperty<float> {
    static float defaultValue() { return 0; }
};

struct RasterBrightnessMin : PaintProperty<float> {
    static float defaultValue() { return 0; }
};

struct RasterBrightnessMax : PaintProperty<float> {
    static float defaultValue() { return 1; }
};

struct RasterSaturation : PaintProperty<float> {
    static float defaultValue() { return 0; }
};

struct RasterContrast : PaintProperty<float> {
    static float defaultValue() { return 0; }
};

struct RasterResampling : PaintProperty<RasterResamplingType> {
    static RasterResamplingType defaultValue() { return RasterResamplingType::Linear; }
};

struct RasterFadeDuration : PaintProperty<float> {
    static float defaultValue() { return 300; }
};

class RasterPaintProperties {
public:

    class PossiblyEvaluated {
    public:
        float rasterOpacity;
        float rasterHueRotate;
        float rasterBrightnessMin;
        float rasterBrightnessMax;
        float rasterSaturation;
        float rasterContrast;
        RasterResamplingType rasterResampling;
        float rasterFadeDuration;
    };

    class Unevaluated {
    public:
        style::Transitioning<PropertyValue<float>> rasterOpacity;
        style::Transitioning<PropertyValue<float>> rasterHueRotate;
        style::Transitioning<PropertyValue<float>> rasterBrightnessMin;
        style::Transitioning<PropertyValue<float>> rasterBrightnessMax;
        style::Transitioning<PropertyValue<float>> rasterSaturation;
        style::Transitioning<PropertyValue<float>> rasterContrast;
        style::Transitioning<PropertyValue<RasterResamplingType>> rasterResampling;
        style::Transitioning<PropertyValue<float>> rasterFadeDuration;

        bool hasTransition() const;
        PossiblyEvaluated evaluate(const PropertyEvaluationParameters&) const;
    };

    class Transitionable {
    public:
        style::Transitionable<PropertyValue<float>> rasterOpacity;
        style::Transitionable<PropertyValue<float>> rasterHueRotate;
        style::Transitionable<PropertyValue<float>> rasterBrightnessMin;
        style::Transitionable<PropertyValue<float>> rasterBrightnessMax;
        style::Transitionable<PropertyValue<float>> rasterSaturation;
        style::Transitionable<PropertyValue<float>> rasterContrast;
        style::Transitionable<PropertyValue<RasterResamplingType>> rasterResampling;
        style::Transitionable<PropertyValue<float>> rasterFadeDuration;

        Unevaluated transitioned(const TransitionParameters&, Unevaluated&& prior) const;
        Unevaluated untransitioned() const;

        bool hasDataDrivenPropertyDifference(const Transitionable& other) const;
    };
};


} // namespace style
} // namespace mbgl