Skip to content

Instantly share code, notes, and snippets.

@jbclements
Created March 30, 2013 00:37
Show Gist options
  • Save jbclements/5274689 to your computer and use it in GitHub Desktop.
Save jbclements/5274689 to your computer and use it in GitHub Desktop.
The rust side of the linkage.
#[no_mangle]
pub extern fn blur(width: c_uint, height: c_uint, data: *mut u8) {
let width = width as uint;
let height = height as uint;
unsafe {
do vec::raw::mut_buf_as_slice(data, width * height) |data| {
let out_data = blur_rust(width, height, data);
vec::raw::copy_memory(data, out_data, width * height);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment