rdp 0.8.3

An FFI wrapper for the Ramer–Douglas–Peucker and Visvalingam-Whyatt algorithms
Documentation
/* Generated with cbindgen:0.9.1 */

/* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */

#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>

/**
 * A C-compatible `struct` used for passing arrays across the FFI boundary
 */
typedef struct Array {
    const void *data;
    size_t len;
} Array;

/**
 * Free Array memory of 2D floats which Rust has allocated across the FFI boundary by [`simplify_rdp_ffi`](fn.simplify_rdp_ffi.html)
 *
 * # Safety
 *
 * This function is unsafe because it accesses a raw pointer which could contain arbitrary data
 */
void drop_float_array(Array arr);

/**
 * Free Array memory of usize which Rust has allocated across the FFI boundary by [`simplify_rdp_ffi`](fn.simplify_rdp_ffi.html)
 *
 * # Safety
 *
 * This function is unsafe because it accesses a raw pointer which could contain arbitrary data
 */
void drop_usize_array(Array arr);

/**
 * FFI wrapper for RDP, returning simplified geometry **coordinates**
 *
 * Callers must pass two arguments:
 *
 * - a [Struct](struct.Array.html) with two fields:
 *     - `data`, a void pointer to an array of floating-point point coordinates: `[[1.0, 2.0], ...]`
 *     - `len`, the length of the array being passed. Its type must be `size_t`
 * - a double-precision `float` for the tolerance
 *
 * Implementations calling this function **must** call [`drop_float_array`](fn.drop_float_array.html)
 * with the returned `Array` pointer, in order to free the memory it allocates.
 *
 * # Safety
 *
 * This function is unsafe because it accesses a raw pointer which could contain arbitrary data
 */
Array simplify_rdp_ffi(Array coords,
                       double precision);

/**
 * FFI wrapper for RDP, returning simplified geometry **indices**
 *
 * Callers must pass two arguments:
 *
 * - a [Struct](struct.Array.html) with two fields:
 *     - `data`, a void pointer to an array of floating-point point coordinates: `[[1.0, 2.0], ...]`
 *     - `len`, the length of the array being passed. Its type must be `size_t`
 * - a double-precision `float` for the tolerance
 *
 * Implementations calling this function **must** call [`drop_usize_array`](fn.drop_usize_array.html)
 * with the returned `Array` pointer, in order to free the memory it allocates.
 *
 * # Safety
 *
 * This function is unsafe because it accesses a raw pointer which could contain arbitrary data
 */
Array simplify_rdp_idx_ffi(Array coords,
                           double precision);

/**
 * FFI wrapper for Visvalingam-Whyatt, returning simplified geometry **coordinates**
 *
 * Callers must pass two arguments:
 *
 * - a [Struct](struct.Array.html) with two fields:
 *     - `data`, a void pointer to an array of floating-point point coordinates: `[[1.0, 2.0], ...]`
 *     - `len`, the length of the array being passed. Its type must be `size_t`
 * - a double-precision `float` for the epsilon
 *
 * Implementations calling this function **must** call [`drop_float_array`](fn.drop_float_array.html)
 * with the returned `Array` pointer, in order to free the memory it allocates.
 *
 * # Safety
 *
 * This function is unsafe because it accesses a raw pointer which could contain arbitrary data
 */
Array simplify_visvalingam_ffi(Array coords,
                               double precision);

/**
 * FFI wrapper for Visvalingam-Whyatt, returning simplified geometry **indices**
 *
 * Callers must pass two arguments:
 *
 * - a [Struct](struct.Array.html) with two fields:
 *     - `data`, a void pointer to an array of floating-point point coordinates: `[[1.0, 2.0], ...]`
 *     - `len`, the length of the array being passed. Its type must be `size_t`
 * - a double-precision `float` for the epsilon
 *
 * Implementations calling this function **must** call [`drop_usize_array`](fn.drop_usize_array.html)
 * with the returned `Array` pointer, in order to free the memory it allocates.
 *
 * # Safety
 *
 * This function is unsafe because it accesses a raw pointer which could contain arbitrary data
 */
Array simplify_visvalingam_idx_ffi(Array coords,
                                   double precision);

/**
 * FFI wrapper for [`topology-preserving visvalingam`](fn.visvalingam_preserve.html)
 *
 * Callers must pass two arguments:
 *
 * - a [Struct](struct.Array.html) with two fields:
 *     - `data`, a void pointer to an array of floating-point point coordinates: `[[1.0, 2.0], ...]`
 *     - `len`, the length of the array being passed. Its type must be `size_t`
 * - a double-precision `float` for the epsilon
 *
 * Implementations calling this function **must** call [`drop_float_array`](fn.drop_float_array.html)
 * with the returned `Array` pointer, in order to free the memory it allocates.
 *
 * # Safety
 *
 * This function is unsafe because it accesses a raw pointer which could contain arbitrary data
 */
Array simplify_visvalingamp_ffi(Array coords,
                                double precision);