Deploying to gh-pages from @ maplibre/maplibre-rs@021376acaf 🚀

This commit is contained in:
maxammann 2023-01-16 20:46:56 +00:00
parent bce1dee26c
commit 2f2a77c8f4
12 changed files with 49 additions and 75 deletions

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Provides utilities related to coordinates."><meta name="keywords" content="rust, rustlang, rust-lang, coords"><title>maplibre::coords - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="../../normalize.css"><link rel="stylesheet" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../../ayu.css" disabled><link rel="stylesheet" href="../../dark.css" disabled><link rel="stylesheet" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script defer src="../../main.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../../maplibre/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../maplibre/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">Module coords</a></h2><div class="sidebar-elems"><section><div class="block"><ul><li><a href="#structs">Structs</a></li><li><a href="#constants">Constants</a></li><li><a href="#functions">Functions</a></li></ul></div></section></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../maplibre/index.html"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Module <a href="../index.html">maplibre</a>::<wbr><a class="mod" href="#">coords</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/maplibre/coords.rs.html#1-768">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Provides utilities related to coordinates.</p>
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Provides utilities related to coordinates."><meta name="keywords" content="rust, rustlang, rust-lang, coords"><title>maplibre::coords - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="../../normalize.css"><link rel="stylesheet" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../../ayu.css" disabled><link rel="stylesheet" href="../../dark.css" disabled><link rel="stylesheet" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script defer src="../../main.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../../maplibre/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../maplibre/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">Module coords</a></h2><div class="sidebar-elems"><section><div class="block"><ul><li><a href="#structs">Structs</a></li><li><a href="#constants">Constants</a></li><li><a href="#functions">Functions</a></li></ul></div></section></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../maplibre/index.html"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Module <a href="../index.html">maplibre</a>::<wbr><a class="mod" href="#">coords</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/maplibre/coords.rs.html#1-782">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Provides utilities related to coordinates.</p>
</div></details><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.AlignedWorldTileCoords.html" title="maplibre::coords::AlignedWorldTileCoords struct">AlignedWorldTileCoords</a></div><div class="item-right docblock-short">An aligned world tile coordinate aligns a world coordinate at a 4x4 tile raster within the
world. The aligned coordinates is defined by the coordinates of the upper left tile in the 4x4
tile raster divided by 2 and rounding to the ceiling.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.InnerCoords.html" title="maplibre::coords::InnerCoords struct">InnerCoords</a></div><div class="item-right docblock-short">Within each tile there is a separate coordinate system. Usually this coordinate system is

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Utility for generating a tile pattern which can be used for masking."><meta name="keywords" content="rust, rustlang, rust-lang, tile_view_pattern"><title>maplibre::render::tile_view_pattern - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="../../../normalize.css"><link rel="stylesheet" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../../../ayu.css" disabled><link rel="stylesheet" href="../../../dark.css" disabled><link rel="stylesheet" href="../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../storage.js"></script><script defer src="../../../main.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../../../maplibre/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../../maplibre/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">Module tile_view_pattern</a></h2><div class="sidebar-elems"><section><div class="block"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#constants">Constants</a></li></ul></div></section></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../maplibre/index.html"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Module <a href="../../index.html">maplibre</a>::<wbr><a href="../index.html">render</a>::<wbr><a class="mod" href="#">tile_view_pattern</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/maplibre/render/tile_view_pattern.rs.html#1-264">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Utility for generating a tile pattern which can be used for masking.</p>
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Utility for generating a tile pattern which can be used for masking."><meta name="keywords" content="rust, rustlang, rust-lang, tile_view_pattern"><title>maplibre::render::tile_view_pattern - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="../../../normalize.css"><link rel="stylesheet" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../../../ayu.css" disabled><link rel="stylesheet" href="../../../dark.css" disabled><link rel="stylesheet" href="../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../storage.js"></script><script defer src="../../../main.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../../../maplibre/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../../maplibre/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">Module tile_view_pattern</a></h2><div class="sidebar-elems"><section><div class="block"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#constants">Constants</a></li></ul></div></section></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../maplibre/index.html"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Module <a href="../../index.html">maplibre</a>::<wbr><a href="../index.html">render</a>::<wbr><a class="mod" href="#">tile_view_pattern</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/maplibre/render/tile_view_pattern.rs.html#1-238">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Utility for generating a tile pattern which can be used for masking.</p>
</div></details><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.BackingBuffer.html" title="maplibre::render::tile_view_pattern::BackingBuffer struct">BackingBuffer</a><span title="Restricted Visibility">&nbsp;🔒</span> </div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.TileShape.html" title="maplibre::render::tile_view_pattern::TileShape struct">TileShape</a></div><div class="item-right docblock-short">Defines the exact location where a specific tile on the map is rendered. It defines the shape
of the tile with its location for the current zoom factor.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.TileViewPattern.html" title="maplibre::render::tile_view_pattern::TileViewPattern struct">TileViewPattern</a></div><div class="item-right docblock-short">The tile mask pattern assigns each tile a value which can be used for stencil testing.</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.ViewTile.html" title="maplibre::render::tile_view_pattern::ViewTile struct">ViewTile</a></div><div class="item-right docblock-short">Defines the <code>target</code> tile and its <code>source</code> from which data tile data comes.</div></div></div><h2 id="enums" class="small-section-header"><a href="#enums">Enums</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="enum" href="enum.SourceShapes.html" title="maplibre::render::tile_view_pattern::SourceShapes enum">SourceShapes</a></div><div class="item-right docblock-short">This defines the source tile shaped from which the content for the <code>target</code> is taken.
For example if the target is <code>(0, 0, 1)</code> (of <a href="struct.ViewTile.html" title="ViewTile"><code>ViewTile</code></a>) , we might use

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -766,6 +766,20 @@
<span id="766">766</span>
<span id="767">767</span>
<span id="768">768</span>
<span id="769">769</span>
<span id="770">770</span>
<span id="771">771</span>
<span id="772">772</span>
<span id="773">773</span>
<span id="774">774</span>
<span id="775">775</span>
<span id="776">776</span>
<span id="777">777</span>
<span id="778">778</span>
<span id="779">779</span>
<span id="780">780</span>
<span id="781">781</span>
<span id="782">782</span>
</pre><pre class="rust"><code><span class="doccomment">//! Provides utilities related to coordinates.
</span><span class="kw">use </span>std::{
@ -1224,6 +1238,20 @@
z: <span class="self">self</span>.z - <span class="number">1</span>,
})
}
<span class="doccomment">/// Returns unique stencil reference values for WorldTileCoords which are 3D.
/// Tiles from arbitrary `z` can lie next to each other, because we mix tiles from
/// different levels based on availability.
</span><span class="kw">pub fn </span>stencil_reference_value_3d(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; u8 {
<span class="kw">const </span>CASES: u8 = <span class="number">4</span>;
<span class="kw">let </span>z = u8::from(<span class="self">self</span>.z);
<span class="kw">match </span>(<span class="self">self</span>.x % <span class="number">2 </span>== <span class="number">0</span>, <span class="self">self</span>.y % <span class="number">2 </span>== <span class="number">0</span>) {
(<span class="bool-val">true</span>, <span class="bool-val">true</span>) =&gt; <span class="number">0 </span>+ z * CASES,
(<span class="bool-val">true</span>, <span class="bool-val">false</span>) =&gt; <span class="number">1 </span>+ z * CASES,
(<span class="bool-val">false</span>, <span class="bool-val">true</span>) =&gt; <span class="number">2 </span>+ z * CASES,
(<span class="bool-val">false</span>, <span class="bool-val">false</span>) =&gt; <span class="number">3 </span>+ z * CASES,
}
}
}
<span class="kw">impl </span>From&lt;(i32, i32, ZoomLevel)&gt; <span class="kw">for </span>WorldTileCoords {

View File

@ -268,7 +268,7 @@
<span class="macro">tracing::trace!</span>(<span class="string">&quot;Drawing mask {}&quot;</span>, <span class="kw-2">&amp;</span>source_shape.coords());
<span class="comment">// Draw mask with stencil value of e.g. parent
</span><span class="kw">let </span>reference = tile_view_pattern.stencil_reference_value_3d(<span class="kw-2">&amp;</span>source_shape.coords()) <span class="kw">as </span>u32;
</span><span class="kw">let </span>reference = source_shape.coords().stencil_reference_value_3d() <span class="kw">as </span>u32;
pass.set_stencil_reference(reference);
pass.set_vertex_buffer(
@ -317,7 +317,7 @@
(<span class="kw-2">&amp;</span>state.buffer_pool, <span class="kw-2">&amp;</span>state.tile_view_pattern) <span class="kw">else </span>{ <span class="kw">return </span>RenderCommandResult::Failure; };
<span class="comment">// Uses stencil value of requested tile and the shape of the requested tile
</span><span class="kw">let </span>reference = tile_view_pattern.stencil_reference_value_3d(<span class="kw-2">&amp;</span>shape.coords()) <span class="kw">as </span>u32;
</span><span class="kw">let </span>reference = shape.coords().stencil_reference_value_3d() <span class="kw">as </span>u32;
<span class="macro">tracing::trace!</span>(
<span class="string">&quot;Drawing layer {:?} at {}&quot;</span>,

View File

@ -236,32 +236,6 @@
<span id="236">236</span>
<span id="237">237</span>
<span id="238">238</span>
<span id="239">239</span>
<span id="240">240</span>
<span id="241">241</span>
<span id="242">242</span>
<span id="243">243</span>
<span id="244">244</span>
<span id="245">245</span>
<span id="246">246</span>
<span id="247">247</span>
<span id="248">248</span>
<span id="249">249</span>
<span id="250">250</span>
<span id="251">251</span>
<span id="252">252</span>
<span id="253">253</span>
<span id="254">254</span>
<span id="255">255</span>
<span id="256">256</span>
<span id="257">257</span>
<span id="258">258</span>
<span id="259">259</span>
<span id="260">260</span>
<span id="261">261</span>
<span id="262">262</span>
<span id="263">263</span>
<span id="264">264</span>
</pre><pre class="rust"><code><span class="doccomment">//! Utility for generating a tile pattern which can be used for masking.
</span><span class="kw">use </span>std::{marker::PhantomData, mem::size_of, ops::Range};
@ -499,32 +473,6 @@
}
queue.write_buffer(<span class="kw-2">&amp;</span><span class="self">self</span>.buffer.inner, <span class="number">0</span>, raw_buffer);
}
<span class="doccomment">/// 2D version of [`TileViewPattern::stencil_reference_value_3d`]. This is kept for reference.
/// For the 2D case we do not take into account the Z value, so only 4 cases exist.
</span><span class="kw">pub fn </span>stencil_reference_value_2d(<span class="kw-2">&amp;</span><span class="self">self</span>, world_coords: <span class="kw-2">&amp;</span>WorldTileCoords) -&gt; u8 {
<span class="kw">match </span>(world_coords.x, world_coords.y) {
(x, y) <span class="kw">if </span>x % <span class="number">2 </span>== <span class="number">0 </span>&amp;&amp; y % <span class="number">2 </span>== <span class="number">0 </span>=&gt; <span class="number">2</span>,
(x, y) <span class="kw">if </span>x % <span class="number">2 </span>== <span class="number">0 </span>&amp;&amp; y % <span class="number">2 </span>!= <span class="number">0 </span>=&gt; <span class="number">1</span>,
(x, y) <span class="kw">if </span>x % <span class="number">2 </span>!= <span class="number">0 </span>&amp;&amp; y % <span class="number">2 </span>== <span class="number">0 </span>=&gt; <span class="number">4</span>,
(x, y) <span class="kw">if </span>x % <span class="number">2 </span>!= <span class="number">0 </span>&amp;&amp; y % <span class="number">2 </span>!= <span class="number">0 </span>=&gt; <span class="number">3</span>,
<span class="kw">_ </span>=&gt; <span class="macro">unreachable!</span>(),
}
}
<span class="doccomment">/// Returns unique stencil reference values for WorldTileCoords which are 3D.
/// Tiles from arbitrary `z` can lie next to each other, because we mix tiles from
/// different levels based on availability.
</span><span class="kw">pub fn </span>stencil_reference_value_3d(<span class="kw-2">&amp;</span><span class="self">self</span>, world_coords: <span class="kw-2">&amp;</span>WorldTileCoords) -&gt; u8 {
<span class="kw">const </span>CASES: u8 = <span class="number">4</span>;
<span class="kw">match </span>(world_coords.x, world_coords.y, u8::from(world_coords.z)) {
(x, y, z) <span class="kw">if </span>x % <span class="number">2 </span>== <span class="number">0 </span>&amp;&amp; y % <span class="number">2 </span>== <span class="number">0 </span>=&gt; <span class="number">0 </span>+ z * CASES,
(x, y, z) <span class="kw">if </span>x % <span class="number">2 </span>== <span class="number">0 </span>&amp;&amp; y % <span class="number">2 </span>!= <span class="number">0 </span>=&gt; <span class="number">1 </span>+ z * CASES,
(x, y, z) <span class="kw">if </span>x % <span class="number">2 </span>!= <span class="number">0 </span>&amp;&amp; y % <span class="number">2 </span>== <span class="number">0 </span>=&gt; <span class="number">2 </span>+ z * CASES,
(x, y, z) <span class="kw">if </span>x % <span class="number">2 </span>!= <span class="number">0 </span>&amp;&amp; y % <span class="number">2 </span>!= <span class="number">0 </span>=&gt; <span class="number">3 </span>+ z * CASES,
<span class="kw">_ </span>=&gt; <span class="macro">unreachable!</span>(),
}
}
}
</code></pre></div>
</section></div></main><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="maplibre" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.65.0 (897e37553 2022-11-02)" ></div></body></html>