20240422
This commit is contained in:
commit
e0afef912e
1285 files changed
+83219
No files matched your search
@@ -0,0 +1,36 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="RawPngRasterTile.cs" company="Mapbox">
|
||||
// Copyright (c) 2016 Mapbox. All rights reserved.
|
||||
// </copyright>
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
namespace Mapbox.Map
|
||||
{
|
||||
/// <summary>
|
||||
/// A raster tile containing an encoded RGBA PNG.
|
||||
/// <see href="https://www.mapbox.com/blog/terrain-rgb/"> Read about global elevation data. </see>
|
||||
/// </summary>
|
||||
/// <example>
|
||||
/// Print the real world height, in meters, for each pixel:
|
||||
/// <code>
|
||||
/// var texture = new Texture2D(0, 0);
|
||||
/// texture.LoadImage(tile.Data);
|
||||
/// for (int i = 0; i < texture.width; i++)
|
||||
/// {
|
||||
/// for (int j = 0; j < texture.height; j++)
|
||||
/// {
|
||||
/// var color = texture.GetPixel(i, j);
|
||||
/// var height = Conversions.GetAbsoluteHeightFromColor(color);
|
||||
/// Console.Write("Height: " + height);
|
||||
/// }
|
||||
/// }
|
||||
/// </code>
|
||||
/// </example>
|
||||
public sealed class RawPngRasterTile : RasterTile
|
||||
{
|
||||
internal override TileResource MakeTileResource(string tilesetId)
|
||||
{
|
||||
return TileResource.MakeRawPngRaster(Id, tilesetId);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user