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

Function test_font

src/opencv/mod.rs:1058–1075  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1056
1057 #[test]
1058 fn test_font() {
1059
1060 let mut img = RgbImage::new(300, 300);
1061 let f = vec![
1062 Font::new(FontFace::CvFontHersheySimplex),
1063 Font::new(FontFace::CvFontHersheyComplex),
1064 Font::new(FontFace::CvFontHersheyComplexSmall),
1065 Font::new(FontFace::CvFontHersheyDuplex),
1066 Font::new(FontFace::CvFontHersheyPlain),
1067 Font::new(FontFace::CvFontHersheyScriptComplex),
1068 Font::new(FontFace::CvFontHersheyScriptSimplex),
1069 Font::new(FontFace::CvFontHersheyTriplex),
1070 ];
1071 for i in (0..8) {
1072 img.draw_text("hallo", 10, i * 20 + 20, f.get(i).unwrap());
1073 }
1074 img.to_file("/tmp/blabla.jpg");
1075 }
1076}

Callers

nothing calls this directly

Calls 3

draw_textMethod · 0.80
getMethod · 0.80
to_fileMethod · 0.45

Tested by

no test coverage detected