Created
April 24, 2013 03:10
-
-
Save dymk/5449307 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fn exportPixels(&self) -> ~[RGB] { | |
| //Determine the size of the vector we need to allocate | |
| let mut pixel_buffer = vec::with_capacity::<self::RGB>(self.numPixels()); | |
| unsafe { | |
| let buffer_ptr = vec::raw::to_ptr(pixel_buffer); | |
| wand_extern::MagickExportImagePixels(buffer_ptr); | |
| vec::raw::set_len::<RGB>(pixel_buffer, self.numPixels()); | |
| } | |
| pixel_buffer | |
| } | |
| //wand.rs:125:28: 125:40 error: mismatched types: expected `&mut ~[RGB]` but found `~[RGB]` (expected &-ptr but found vector) | |
| //wand.rs:125 vec::raw::set_len::<RGB>(pixel_buffer, num_pixels); | |
| ^~~~~~~~~~~~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment