summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLRasterStyleLayer.h
diff options
context:
space:
mode:
Diffstat (limited to 'platform/darwin/src/MGLRasterStyleLayer.h')
-rw-r--r--platform/darwin/src/MGLRasterStyleLayer.h78
1 files changed, 78 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLRasterStyleLayer.h b/platform/darwin/src/MGLRasterStyleLayer.h
index ff055d24f6..a74d4f7f26 100644
--- a/platform/darwin/src/MGLRasterStyleLayer.h
+++ b/platform/darwin/src/MGLRasterStyleLayer.h
@@ -7,6 +7,27 @@
NS_ASSUME_NONNULL_BEGIN
/**
+ The resampling/interpolation method to use for overscaling, also known as
+ texture magnification filter
+
+ Values of this type are used in the `MGLRasterStyleLayer.rasterResamplingMode`
+ property.
+ */
+typedef NS_ENUM(NSUInteger, MGLRasterResamplingMode) {
+ /**
+ (Bi)linear filtering interpolates point values using the weighted average
+ of the four closest original source points creating a smooth but blurry
+ look when overscaled
+ */
+ MGLRasterResamplingModeLinear,
+ /**
+ Nearest neighbor filtering interpolates point values using the nearest
+ original source point creating a sharp but pointated look when overscaled
+ */
+ MGLRasterResamplingModeNearest,
+};
+
+/**
An `MGLRasterStyleLayer` is a style layer that renders georeferenced raster
imagery on the map, especially raster tiles.
@@ -233,6 +254,40 @@ MGL_EXPORT
@property (nonatomic) MGLTransition rasterOpacityTransition;
/**
+ The resampling/interpolation method to use for overscaling, also known as
+ texture magnification filter
+
+ The default value of this property is an expression that evaluates to `linear`.
+ Set this property to `nil` to reset it to the default value.
+
+ This attribute corresponds to the <a
+ href="https://www.mapbox.com/mapbox-gl-style-spec/#paint-raster-resampling"><code>raster-resampling</code></a>
+ layout property in the Mapbox Style Specification.
+
+ You can set this property to an expression containing any of the following:
+
+ * Constant `MGLRasterResamplingMode` values
+ * Any of the following constant string values:
+ * `linear`: (Bi)linear filtering interpolates pixel values using the weighted
+ average of the four closest original source pixels creating a smooth but blurry
+ look when overscaled
+ * `nearest`: Nearest neighbor filtering interpolates pixel values using the
+ nearest original source pixel creating a sharp but pixelated look when
+ overscaled
+ * Predefined functions, including mathematical and string operators
+ * Conditional expressions
+ * Variable assignments and references to assigned variables
+ * Step functions applied to the `$zoomLevel` variable
+
+ This property does not support applying interpolation functions to the
+ `$zoomLevel` variable or applying interpolation or step functions to feature
+ attributes.
+ */
+@property (nonatomic, null_resettable) NSExpression *rasterResamplingMode;
+
+@property (nonatomic, null_resettable) NSExpression *rasterResampling __attribute__((unavailable("Use rasterResamplingMode instead.")));
+
+/**
Increase or reduce the saturation of the image.
The default value of this property is an expression that evaluates to the float
@@ -260,4 +315,27 @@ MGL_EXPORT
@end
+/**
+ Methods for wrapping an enumeration value for a style layer attribute in an
+ `MGLRasterStyleLayer` object and unwrapping its raw value.
+ */
+@interface NSValue (MGLRasterStyleLayerAdditions)
+
+#pragma mark Working with Raster Style Layer Attribute Values
+
+/**
+ Creates a new value object containing the given `MGLRasterResamplingMode` enumeration.
+
+ @param rasterResamplingMode The value for the new object.
+ @return A new value object that contains the enumeration value.
+ */
++ (instancetype)valueWithMGLRasterResamplingMode:(MGLRasterResamplingMode)rasterResamplingMode;
+
+/**
+ The `MGLRasterResamplingMode` enumeration representation of the value.
+ */
+@property (readonly) MGLRasterResamplingMode MGLRasterResamplingModeValue;
+
+@end
+
NS_ASSUME_NONNULL_END