moonlight-triangulation-1.4.0.2: ffi/bindings/rust/src/raw_generated.rs
// Generated from Moonlight.Triangulation.Foreign.Contract.
// Run moonlight-triangulation-ffi-contract write; do not edit this file.
// This private module is the complete wire projection; wrappers consume a subset.
#![allow(dead_code)]
use std::ffi::{c_char, c_double, c_uint};
pub(crate) const ABI_VERSION: u32 = 2;
pub(crate) const ML_STATUS_OK: u32 = 0;
pub(crate) const ML_STATUS_NULL_POINTER: u32 = 1;
pub(crate) const ML_STATUS_COUNT_OVERFLOW: u32 = 2;
pub(crate) const ML_STATUS_BUFFER_TOO_SMALL: u32 = 3;
pub(crate) const ML_STATUS_GEOMETRY_OBSTRUCTION: u32 = 4;
pub(crate) const ML_STATUS_RUNTIME_FAILURE: u32 = 5;
pub(crate) const ML_OBSTRUCTION_NONE: u32 = 0;
pub(crate) const ML_OBSTRUCTION_INVALID_COORDINATE: u32 = 1;
pub(crate) const ML_OBSTRUCTION_POINT_LOCATION_FAILED: u32 = 2;
pub(crate) const ML_OBSTRUCTION_LOCATION_WALK_EXHAUSTED: u32 = 3;
pub(crate) const ML_OBSTRUCTION_REFINEMENT_INPUT_TOPOLOGY_INVALID: u32 = 4;
pub(crate) const ML_OBSTRUCTION_FRESH_INSERTION_MATCHED_EXISTING_VERTEX: u32 = 5;
pub(crate) const ML_OBSTRUCTION_DEGENERATE_LINE_ENDPOINT_MISSING_OUTGOING: u32 = 6;
pub(crate) const ML_OBSTRUCTION_DEGENERATE_LINE_ENDPOINT_TURN_MISSING: u32 = 7;
pub(crate) const ML_OBSTRUCTION_DEGENERATE_LINE_CONNECTED_VERTEX_MISSING: u32 = 8;
pub(crate) const ML_OBSTRUCTION_HULL_START_NOT_VISIBLE: u32 = 9;
pub(crate) const ML_OBSTRUCTION_OUTER_RANGE_DID_NOT_TERMINATE: u32 = 10;
pub(crate) const ML_OBSTRUCTION_OUTER_RANGE_CONTAINS_INNER_EDGE: u32 = 11;
pub(crate) const ML_OBSTRUCTION_CONSTRAINED_EDGE_FLIP_REFUSED: u32 = 12;
pub(crate) const ML_OBSTRUCTION_REMOVAL_VERTEX_OUT_OF_RANGE: u32 = 13;
pub(crate) const ML_OBSTRUCTION_REMOVAL_EDGE_OUT_OF_RANGE: u32 = 14;
pub(crate) const ML_OBSTRUCTION_REMOVAL_FACE_OUT_OF_RANGE: u32 = 15;
pub(crate) const ML_OBSTRUCTION_REMOVAL_FACE_CYCLE_DID_NOT_TERMINATE: u32 = 16;
pub(crate) const ML_OBSTRUCTION_REMOVAL_EMPTY_TRIANGULATION: u32 = 17;
pub(crate) const ML_OBSTRUCTION_REMOVAL_TWO_POINT_DEGREE_MISMATCH: u32 = 18;
pub(crate) const ML_OBSTRUCTION_REMOVAL_COLLINEAR_DEGREE_MISMATCH: u32 = 19;
pub(crate) const ML_OBSTRUCTION_REMOVAL_BORDER_TOO_SHORT: u32 = 20;
pub(crate) const ML_OBSTRUCTION_REMOVAL_BORDER_ARITY_MISMATCH: u32 = 21;
pub(crate) const ML_OBSTRUCTION_REMOVAL_OUTGOING_CYCLE_DID_NOT_TERMINATE: u32 = 22;
pub(crate) const ML_OBSTRUCTION_CIRCLE_SWEEP_HULL_EMPTY: u32 = 23;
pub(crate) const ML_OBSTRUCTION_OUTER_CYCLE_DID_NOT_TERMINATE: u32 = 24;
pub(crate) const ML_OBSTRUCTION_HIERARCHY_LEVEL_POPULATION_MISMATCH: u32 = 25;
pub(crate) const ML_OBSTRUCTION_HIERARCHY_INSERTION_HANDLE_MISMATCH: u32 = 26;
pub(crate) const ML_OBSTRUCTION_POINT_INDEX_CAPACITY_EXHAUSTED: u32 = 27;
pub(crate) const ML_OBSTRUCTION_REFINEMENT_MINIMUM_ANGLE_NOT_FINITE: u32 = 28;
pub(crate) const ML_OBSTRUCTION_REFINEMENT_MINIMUM_ANGLE_OUT_OF_RANGE: u32 = 29;
pub(crate) const ML_OBSTRUCTION_REFINEMENT_MINIMUM_ANGLE_DERIVED_RATIO_NOT_FINITE: u32 = 30;
pub(crate) const ML_OBSTRUCTION_REFINEMENT_MAXIMUM_ADDITIONAL_VERTICES_NEGATIVE: u32 = 31;
pub(crate) const ML_OBSTRUCTION_REFINEMENT_MINIMUM_AREA_NOT_FINITE: u32 = 32;
pub(crate) const ML_OBSTRUCTION_REFINEMENT_MINIMUM_AREA_NEGATIVE: u32 = 33;
pub(crate) const ML_OBSTRUCTION_REFINEMENT_MAXIMUM_AREA_NOT_FINITE: u32 = 34;
pub(crate) const ML_OBSTRUCTION_REFINEMENT_MAXIMUM_AREA_NOT_POSITIVE: u32 = 35;
pub(crate) const ML_OBSTRUCTION_REFINEMENT_MAXIMUM_RADIUS_EDGE_RATIO_NOT_FINITE: u32 = 36;
pub(crate) const ML_OBSTRUCTION_REFINEMENT_MAXIMUM_RADIUS_EDGE_RATIO_NOT_POSITIVE: u32 = 37;
pub(crate) const ML_OBSTRUCTION_REFINEMENT_MINIMUM_AREA_EXCEEDS_MAXIMUM: u32 = 38;
pub(crate) const ML_OBSTRUCTION_REFINEMENT_SEED_FACE_NOT_ACTIVE: u32 = 39;
pub(crate) const ML_OBSTRUCTION_REFINEMENT_DOMAIN_INTERFACE_EDGE_NOT_ACTIVE: u32 = 40;
pub(crate) const ML_OBSTRUCTION_REFINEMENT_DOMAIN_INTERFACE_MISSING: u32 = 41;
pub(crate) const ML_OBSTRUCTION_REFINEMENT_DOMAIN_INTERFACE_EXTRANEOUS: u32 = 42;
pub(crate) const ML_OBSTRUCTION_REFINEMENT_DOMAIN_TOPOLOGY_CHANGED: u32 = 43;
pub(crate) const ML_OBSTRUCTION_REFINEMENT_DOMAIN_REQUIRES_CONVEX_HULL_PRESERVATION: u32 = 44;
pub(crate) const ML_OBSTRUCTION_REFINEMENT_DOMAIN_REQUIRES_CONSTRAINT_PRESERVATION: u32 = 45;
pub(crate) const ML_OBSTRUCTION_REFINEMENT_DOMAIN_FORBIDS_OUTER_FACE_EXCLUSION: u32 = 46;
pub(crate) const ML_OBSTRUCTION_REFINEMENT_DOMAIN_WOULD_CROSS_INTERFACE: u32 = 47;
pub(crate) const ML_OBSTRUCTION_REFINEMENT_DOMAIN_WOULD_REWRITE_PROTECTED_FACE: u32 = 48;
pub(crate) const ML_OBSTRUCTION_REFINEMENT_DOMAIN_PROTECTED_FACE_CHANGED: u32 = 49;
pub(crate) const ML_OBSTRUCTION_CAPACITY_EXCEEDED: u32 = 50;
pub(crate) const ML_OBSTRUCTION_HALF_EDGE_CAPACITY_EXCEEDED: u32 = 51;
pub(crate) const ML_OBSTRUCTION_FACE_CAPACITY_EXCEEDED: u32 = 52;
pub(crate) const ML_OBSTRUCTION_PAYLOAD_STORAGE_FAILURE: u32 = 53;
pub(crate) const ML_OBSTRUCTION_COORDINATE_PAYLOAD_COUNT_MISMATCH: u32 = 54;
pub(crate) const ML_OBSTRUCTION_CIRCLE_SWEEP_REQUIRES_DENSE_STORAGE: u32 = 55;
pub(crate) const ML_OBSTRUCTION_SEAM_FRONTIER_UNAVAILABLE: u32 = 56;
pub(crate) const ML_OBSTRUCTION_REFINEMENT_DOMAIN_REQUIRES_FINITE_VERTEX_BUDGET: u32 = 57;
pub(crate) const ML_OBSTRUCTION_SEAM_SOURCE_EDGE_REQUIRES_FLIP: u32 = 58;
pub(crate) const ML_OBSTRUCTION_SEAM_PROTECTED_SOURCE_FACE_CHANGED: u32 = 59;
pub(crate) const ML_OBSTRUCTION_REFINEMENT_MAXIMUM_EDGE_LENGTH_NOT_FINITE: u32 = 60;
pub(crate) const ML_OBSTRUCTION_REFINEMENT_MAXIMUM_EDGE_LENGTH_NOT_POSITIVE: u32 = 61;
pub(crate) const ML_OBSTRUCTION_REFINEMENT_OVERSIZED_EDGE: u32 = 62;
pub(crate) const ML_OBSTRUCTION_REFINEMENT_SEAM_BRIDGE_BUDGET_EXCEEDED: u32 = 63;
pub(crate) const ML_OBSTRUCTION_REFINEMENT_SEAM_BRIDGE_MIDPOINT_COLLAPSED: u32 = 64;
pub(crate) const ML_OBSTRUCTION_BOUNDARY_SPLIT_REQUIRES_BOUNDARY_EDGE: u32 = 65;
pub(crate) const ML_OBSTRUCTION_REFINEMENT_DOMAIN_INTERFACE_OPPOSITE_FACE_NOT_PERMITTED: u32 = 66;
pub(crate) const ML_OBSTRUCTION_NULL_POINTER: u32 = 100;
pub(crate) const ML_OBSTRUCTION_COUNT_OVERFLOW: u32 = 101;
pub(crate) const ML_OBSTRUCTION_BUFFER_TOO_SMALL: u32 = 102;
pub(crate) const ML_OBSTRUCTION_RUNTIME_FAILURE: u32 = 103;
pub(crate) const ML_OBSTRUCTION_REGION_LAYOUT_INVALID: u32 = 200;
pub(crate) const ML_OBSTRUCTION_REGION_VALIDATION_FAILED: u32 = 201;
pub(crate) const ML_OBSTRUCTION_OVERLAY_FAILED: u32 = 202;
pub(crate) const ML_OBSTRUCTION_REGION_PUBLICATION_FAILED: u32 = 203;
pub(crate) const ML_OBSTRUCTION_VALUATION_FAILED: u32 = 204;
pub(crate) const ML_OBSTRUCTION_MINKOWSKI_FAILED: u32 = 205;
pub(crate) const ML_OBSTRUCTION_REGION_PROJECTION_FAILED: u32 = 206;
pub(crate) const ML_COORDINATE_ERROR_NONE: u32 = 0;
pub(crate) const ML_COORDINATE_ERROR_NAN: u32 = 1;
pub(crate) const ML_COORDINATE_ERROR_INFINITE: u32 = 2;
pub(crate) const ML_COORDINATE_ERROR_TOO_SMALL: u32 = 3;
pub(crate) const ML_COORDINATE_ERROR_TOO_LARGE: u32 = 4;
pub(crate) const ML_REGION_EXTERIOR: u32 = 0;
pub(crate) const ML_REGION_BOUNDARY: u32 = 1;
pub(crate) const ML_REGION_INTERIOR: u32 = 2;
pub(crate) const ML_MINKOWSKI_ADDITION: u32 = 0;
pub(crate) const ML_MINKOWSKI_EROSION: u32 = 1;
pub(crate) const ML_MINKOWSKI_OPENING: u32 = 2;
pub(crate) const ML_MINKOWSKI_CLOSING: u32 = 3;
#[repr(C)]
pub(crate) struct NativeMesh {
_private: [u8; 0],
}
#[repr(C)]
pub(crate) struct NativeRegion {
_private: [u8; 0],
}
#[repr(C)]
pub(crate) struct NativeStructuringElement {
_private: [u8; 0],
}
#[repr(C)]
pub(crate) struct NativeObstruction {
pub(crate) code: u32,
pub(crate) coordinate_error: u32,
pub(crate) input_index: u64,
pub(crate) first_index: u64,
pub(crate) second_index: u64,
pub(crate) first_value: f64,
pub(crate) second_value: f64,
pub(crate) point_x: f64,
pub(crate) point_y: f64,
pub(crate) message: [c_char; 256],
}
impl Default for NativeObstruction {
fn default() -> Self {
Self {
code: 0,
coordinate_error: 0,
input_index: 0,
first_index: 0,
second_index: 0,
first_value: 0.0,
second_value: 0.0,
point_x: 0.0,
point_y: 0.0,
message: [0; 256],
}
}
}
#[repr(C)]
pub(crate) struct NativeMinkowskiReceipt {
pub(crate) operation: u32,
pub(crate) reserved: u32,
pub(crate) input_components: u64,
pub(crate) convex_pieces: u64,
pub(crate) generated_pieces: u64,
pub(crate) generated_convolution_edges: u64,
pub(crate) overlay_passes: u64,
pub(crate) exact_crossings: u64,
pub(crate) output_cells: u64,
pub(crate) exact_coordinate_bit_growth: u64,
}
impl Default for NativeMinkowskiReceipt {
fn default() -> Self {
Self {
operation: 0,
reserved: 0,
input_components: 0,
convex_pieces: 0,
generated_pieces: 0,
generated_convolution_edges: 0,
overlay_passes: 0,
exact_crossings: 0,
output_cells: 0,
exact_coordinate_bit_growth: 0,
}
}
}
#[link(name = "moonlight-triangulation-c")]
unsafe extern "C" {
pub(crate) fn ml_abi_version() -> c_uint;
pub(crate) fn ml_runtime_initialize() -> c_uint;
pub(crate) fn ml_delaunay_f64(
coordinates: *const c_double,
point_count: usize,
result: *mut *mut NativeMesh,
obstruction: *mut NativeObstruction,
) -> c_uint;
pub(crate) fn ml_mesh_insert_many_f64(
mesh: *const NativeMesh,
coordinates: *const c_double,
point_count: usize,
result: *mut *mut NativeMesh,
obstruction: *mut NativeObstruction,
) -> c_uint;
pub(crate) fn ml_mesh_site_union(
left: *const NativeMesh,
right: *const NativeMesh,
result: *mut *mut NativeMesh,
obstruction: *mut NativeObstruction,
) -> c_uint;
pub(crate) fn ml_mesh_site_intersection(
left: *const NativeMesh,
right: *const NativeMesh,
result: *mut *mut NativeMesh,
obstruction: *mut NativeObstruction,
) -> c_uint;
pub(crate) fn ml_mesh_site_difference(
left: *const NativeMesh,
right: *const NativeMesh,
result: *mut *mut NativeMesh,
obstruction: *mut NativeObstruction,
) -> c_uint;
pub(crate) fn ml_mesh_site_symmetric_difference(
left: *const NativeMesh,
right: *const NativeMesh,
result: *mut *mut NativeMesh,
obstruction: *mut NativeObstruction,
) -> c_uint;
pub(crate) fn ml_mesh_vertex_count(
mesh: *const NativeMesh,
count: *mut usize,
obstruction: *mut NativeObstruction,
) -> c_uint;
pub(crate) fn ml_mesh_triangle_count(
mesh: *const NativeMesh,
count: *mut usize,
obstruction: *mut NativeObstruction,
) -> c_uint;
pub(crate) fn ml_mesh_copy_vertices_f64(
mesh: *const NativeMesh,
coordinates: *mut c_double,
point_capacity: usize,
points_written: *mut usize,
obstruction: *mut NativeObstruction,
) -> c_uint;
pub(crate) fn ml_mesh_copy_triangles_u32(
mesh: *const NativeMesh,
triangles: *mut u32,
triangle_capacity: usize,
triangles_written: *mut usize,
obstruction: *mut NativeObstruction,
) -> c_uint;
pub(crate) fn ml_mesh_free(mesh: *mut NativeMesh);
pub(crate) fn ml_region_create_f64(
coordinates: *const c_double,
point_count: usize,
loop_point_counts: *const usize,
loop_count: usize,
component_loop_counts: *const usize,
component_count: usize,
result: *mut *mut NativeRegion,
obstruction: *mut NativeObstruction,
) -> c_uint;
pub(crate) fn ml_region_counts(
region: *const NativeRegion,
component_count: *mut usize,
loop_count: *mut usize,
point_count: *mut usize,
obstruction: *mut NativeObstruction,
) -> c_uint;
pub(crate) fn ml_region_copy_f64(
region: *const NativeRegion,
coordinates: *mut c_double,
point_capacity: usize,
loop_point_offsets: *mut usize,
loop_offset_capacity: usize,
component_loop_offsets: *mut usize,
component_offset_capacity: usize,
obstruction: *mut NativeObstruction,
) -> c_uint;
pub(crate) fn ml_region_union(
left: *const NativeRegion,
right: *const NativeRegion,
result: *mut *mut NativeRegion,
obstruction: *mut NativeObstruction,
) -> c_uint;
pub(crate) fn ml_region_intersection(
left: *const NativeRegion,
right: *const NativeRegion,
result: *mut *mut NativeRegion,
obstruction: *mut NativeObstruction,
) -> c_uint;
pub(crate) fn ml_region_difference(
left: *const NativeRegion,
right: *const NativeRegion,
result: *mut *mut NativeRegion,
obstruction: *mut NativeObstruction,
) -> c_uint;
pub(crate) fn ml_region_symmetric_difference(
left: *const NativeRegion,
right: *const NativeRegion,
result: *mut *mut NativeRegion,
obstruction: *mut NativeObstruction,
) -> c_uint;
pub(crate) fn ml_region_locate_point_f64(
region: *const NativeRegion,
x: c_double,
y: c_double,
location: *mut u32,
obstruction: *mut NativeObstruction,
) -> c_uint;
pub(crate) fn ml_region_measure(
region: *const NativeRegion,
euler_characteristic: *mut i64,
area_ratio_utf8: *mut c_char,
area_capacity: usize,
area_bytes_written: *mut usize,
perimeter_lower: *mut c_double,
perimeter_upper: *mut c_double,
obstruction: *mut NativeObstruction,
) -> c_uint;
pub(crate) fn ml_region_free(region: *mut NativeRegion);
pub(crate) fn ml_structuring_element_create_f64(
coordinates: *const c_double,
point_count: usize,
result: *mut *mut NativeStructuringElement,
obstruction: *mut NativeObstruction,
) -> c_uint;
pub(crate) fn ml_structuring_element_free(element: *mut NativeStructuringElement);
pub(crate) fn ml_region_minkowski_sum(
left: *const NativeRegion,
right: *const NativeRegion,
result: *mut *mut NativeRegion,
receipt: *mut NativeMinkowskiReceipt,
obstruction: *mut NativeObstruction,
) -> c_uint;
pub(crate) fn ml_region_offset(
element: *const NativeStructuringElement,
region: *const NativeRegion,
result: *mut *mut NativeRegion,
receipt: *mut NativeMinkowskiReceipt,
obstruction: *mut NativeObstruction,
) -> c_uint;
pub(crate) fn ml_region_inset(
element: *const NativeStructuringElement,
region: *const NativeRegion,
result: *mut *mut NativeRegion,
receipt: *mut NativeMinkowskiReceipt,
obstruction: *mut NativeObstruction,
) -> c_uint;
pub(crate) fn ml_region_open(
element: *const NativeStructuringElement,
region: *const NativeRegion,
result: *mut *mut NativeRegion,
receipt: *mut NativeMinkowskiReceipt,
obstruction: *mut NativeObstruction,
) -> c_uint;
pub(crate) fn ml_region_close(
element: *const NativeStructuringElement,
region: *const NativeRegion,
result: *mut *mut NativeRegion,
receipt: *mut NativeMinkowskiReceipt,
obstruction: *mut NativeObstruction,
) -> c_uint;
}