3AJMKZ7CFKK7S6H3I6LCFRSTGCBNJJGOYFIT2WHQKZRI6CMEHSTQC ABITXOUUKIF3XVFXVOQ5YI7N43TS5OEVNEFUQ5Q7J4QEILFG3IPAC PG7KSKJLFLANZCTTVYVCHO6IHYL5QA22OGFM7M2DAF2CKMFVMT7QC E742MTJAS6KZGXIFVCZMKREGQK34LA45VBIT4E7ODBL7J64FKJFAC 6AXPZL5PQMW5P6BPRTGWO3AOWAU5OC33UYBY3TVOHUVQXCRVVTPQC 5AMZXFS5GBD6DS64Q5RTY55U7LQDMDW776UHZK4HQPPXWSMO3MAQC CWOSQTC4HIBTZMMASA34RVBLPT2FRCVGEOIYUZXISNKMDNILV3WQC ROQCAPZJPLENWBMHRK7DNH3CIMZRHPBMVBBKT7NQXRIFHEDZ5JHQC 4IXWCEHMWCEXNCDYUV3H44UPQ7R4HKS3RWRWII7LU4PA6ZZRAS3AC ALMG52BOHW6WB6H7DF742GHU6VWUEPQFLWNFYU3PQBDSD4HQ7VJAC native.landmass_steradians.argtypes = [ctypes.POINTER(ctypes.c_double), ctypes.c_int, ctypes.c_int, ctypes.c_int, ctypes.c_int]native.landmass_steradians.restype = ctypes.c_doublelandmass_steradians = native.landmass_steradians
}}}#[no_mangle]pub extern "C" fn landmass_steradians(source: *const f64, width: u32, height: u32, x: u32, y: u32) -> f64 {use std::collections::HashMap;use std::collections::HashSet;use std::collections::VecDeque;use std::f64::consts::PI;let source = unsafe {std::slice::from_raw_parts(source, (width as usize) * (height as usize))};let mut patch = HashSet::new();let mut q = VecDeque::new();q.push_back((x,y));while let Some((x,y)) = q.pop_front() {if source[(y * width + x) as usize] >= SEA_LEVEL {if patch.insert((x,y)) {let y = y as i32;let x = x as i32;for (x, y) in [(x - 1, y - 1), (x, y - 1), (x + 1, y - 1), (x + 1, y), (x + 1, y + 1), (x, y + 1), (x - 1, y + 1), (x - 1, y)].iter() {if *y > 0 && (*y as u32) < height {let np = ((x % width as i32) as u32, *y as u32);q.push_back(np);}}}
outputs = tf.math.multiply(255, colourize_heightmap(tf.reshape(outputs, (512, 1024, outputs.shape[1]))))image = tensor_to_surface(outputs)
image = tensor_to_surface(tf.math.multiply(255, colourize_heightmap(tf.reshape(outputs, (512, 1024, outputs.shape[1])))))
def landmass_steradians(source, x, y):shape = source.shapesource = tf.cast(source, tf.float64).numpy()return helpers.landmass_steradians(ctypes.cast(ctypes.c_voidp(source.ctypes.data), ctypes.POINTER(ctypes.c_double)), ctypes.c_int(shape[1]), ctypes.c_int(shape[0]), ctypes.c_int(x), ctypes.c_int(y))