simplify_visvalingamp_ffi

Function simplify_visvalingamp_ffi 

Source
#[unsafe(no_mangle)]
pub extern "C" fn simplify_visvalingamp_ffi( coords: ExternalArray, precision: c_double, ) -> InternalArray
Expand description

FFI wrapper for topology-preserving Visvalingam-Whyatt, returning simplified geometry coordinates.

Callers must pass two arguments:

  • a Struct 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 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