code: def _heightmap_cdata(array: np.ndarray) -> ffi.CData:
      
      if array.flags["F_CONTIGUOUS"]:
          array = array.transpose()
      if not array.flags["C_CONTIGUOUS"]:
          raise ValueError("array must be a contiguous segment.")
      if array.dtype != np.float32:
          raise ValueError("array dtype must be float32, not %r" % array.dtype)
      width, height = array.shape
      pointer = ffi.cast("float *", array.ctypes.data)
      return ffi.new("TCOD_heightmap_t *", (width, height, pointer))
docs: Return a new TCOD_heightmap_t instance using an array.
  
      Formatting is verified during this function.