summaryrefslogtreecommitdiff
path: root/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/RasterLayer.java
blob: a6872cef0f37b8417fe21d07c96bed55c4082dc6 (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
98
99
100
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make style-code-android`.
package com.mapbox.mapboxsdk.style.layers;

import com.mapbox.mapboxsdk.exceptions.ConversionException;

import android.support.annotation.ColorInt;
import android.support.annotation.NonNull;

import static com.mapbox.mapboxsdk.utils.ColorUtils.*;

/**
 * Raster Layer
 */
public class RasterLayer extends Layer {

    public RasterLayer(long nativePtr) {
        super(nativePtr);
    }

    public RasterLayer(String layerId, String sourceId) {
        initialize(layerId, sourceId);
    }

    protected native void initialize(String layerId, String sourceId);

    public void setSourceLayer(String sourceLayer) {
        checkValidity();
        nativeSetSourceLayer(sourceLayer);
    }

    public RasterLayer withSourceLayer(String sourceLayer) {
        setSourceLayer(sourceLayer);
        return this;
    }


    public RasterLayer withProperties(@NonNull Property<?>... properties) {
        setProperties(properties);
        return this;
    }

    // Property getters

    @SuppressWarnings("unchecked")
    public PropertyValue<Float> getRasterOpacity() {
        checkValidity();
        return (PropertyValue<Float>) new PropertyValue(nativeGetRasterOpacity());
    }
 
    @SuppressWarnings("unchecked")
    public PropertyValue<Float> getRasterHueRotate() {
        checkValidity();
        return (PropertyValue<Float>) new PropertyValue(nativeGetRasterHueRotate());
    }
 
    @SuppressWarnings("unchecked")
    public PropertyValue<Float> getRasterBrightnessMin() {
        checkValidity();
        return (PropertyValue<Float>) new PropertyValue(nativeGetRasterBrightnessMin());
    }
 
    @SuppressWarnings("unchecked")
    public PropertyValue<Float> getRasterBrightnessMax() {
        checkValidity();
        return (PropertyValue<Float>) new PropertyValue(nativeGetRasterBrightnessMax());
    }
 
    @SuppressWarnings("unchecked")
    public PropertyValue<Float> getRasterSaturation() {
        checkValidity();
        return (PropertyValue<Float>) new PropertyValue(nativeGetRasterSaturation());
    }
 
    @SuppressWarnings("unchecked")
    public PropertyValue<Float> getRasterContrast() {
        checkValidity();
        return (PropertyValue<Float>) new PropertyValue(nativeGetRasterContrast());
    }
 
    @SuppressWarnings("unchecked")
    public PropertyValue<Float> getRasterFadeDuration() {
        checkValidity();
        return (PropertyValue<Float>) new PropertyValue(nativeGetRasterFadeDuration());
    }
 
    private native Object nativeGetRasterOpacity();

    private native Object nativeGetRasterHueRotate();

    private native Object nativeGetRasterBrightnessMin();

    private native Object nativeGetRasterBrightnessMax();

    private native Object nativeGetRasterSaturation();

    private native Object nativeGetRasterContrast();

    private native Object nativeGetRasterFadeDuration();

}