MCPcopy Create free account
hub / github.com/daniel-e/rustml / to_file

Method to_file

src/opencv/mod.rs:234–246  ·  view source on GitHub ↗

Writes the image into a file. The file format that is written depends on the extension of the filename. Supported formats are JPEG, PNG, PPM, PGM, PBM. Returns `false` if file could not be written and `true` on success.

(&self, fname: &str)

Source from the content-addressed store, hash-verified

232 /// Supported formats are JPEG, PNG, PPM, PGM, PBM. Returns `false` if file
233 /// could not be written and `true` on success.
234 fn to_file(&self, fname: &str) -> bool {
235
236 let mut s = fname.to_string();
237 s.push('\0');
238 unsafe {
239 let r = cvSaveImage(
240 s.as_ptr() as *const c_char,
241 self.buffer() as *const CvArr,
242 0 as *const c_int
243 );
244 r != 0
245 }
246 }
247
248 /// Copies an area from the given image at location `(x,y )` with width `width`
249 /// and height `height` into this image at position `(dstx, dsty)`.

Callers 1

test_fontFunction · 0.45

Implementers 1

mod.rssrc/opencv/mod.rs

Calls 2

to_stringMethod · 0.80
bufferMethod · 0.80

Tested by 1

test_fontFunction · 0.36