#interpolation #neighbor #natural #2d #nni #fastlem #subproject

naturalneighbor

2D Natural Neighbor Interpolation (NNI) library for Rust

8 stable releases

1.2.2 Jan 26, 2024
1.2.1 Jan 23, 2024
1.1.2 Dec 8, 2023
1.1.0 Oct 25, 2023

#756 in Algorithms

Download history 31/week @ 2024-07-24 11/week @ 2024-07-31 2/week @ 2024-08-28 1/week @ 2024-09-11 5/week @ 2024-09-18 8/week @ 2024-09-25

80 downloads per month
Used in 2 crates

MIT license

23KB
378 lines

naturalneighbor

2D Natural Neighbor Interpolation (NNI) library for Rust.

The implementation of this library is based on 'A Fast and Accurate Algorithm for Natural Neighbor Interpolation' by G.W. Lucas.

This is a subproject for the fastlem.

Installation

[dependencies]
naturalneighbor = "1.2.2"

Benchmark

Benchmarking is available with criterion.

$ cargo bench

Result

Estimated time per 1 interpolation for 2D NNI with 1000, 10000, and 100000 sites.

CPU: 11th Gen Intel i7-11390H (8) @ 5.000GHz
Version: 1.2.0

N=1000 N=10000 N=100000
Estimated time 617.64 ns 938.76 ns 1.2598 µs

Usage

See the API documentation for details.

There are some examples in the examples directory that are useful for understanding how to use this library.

Note that the computation of this library is much faster for the --release build.

Preview

$ cargo run --example color

color

Dependencies

Contributing

Contributions are welcome.

Feel free to open an issue or pull request if you have any problems or suggestions.

License

MIT

Copyright (c) 2023 Teruki TADA

Dependencies

~2.5MB
~47K SLoC