MCPcopy Create free account
hub / github.com/davisking/dlib / test_draw_string

Function test_draw_string

dlib/test/image.cpp:2543–2567  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2541 }
2542
2543 void test_draw_string()
2544 {
2545 print_spinner();
2546 matrix<rgb_pixel> image{48, 48};
2547 assign_all_pixels(image, rgb_pixel{0, 0, 0});
2548 draw_string(image, point{10, 15}, string{"cat"}, rgb_pixel{255, 255, 255});
2549
2550 matrix<rgb_pixel> result;
2551 const std::string data{"gQgLudERwR0JqP9kUiitFNDYSO9rdZzdmeDmricAlM5f5RBqzTlaW6Lp704mTXJq/WXHTQ84wWnGAA=="};
2552 ostringstream sout;
2553 istringstream sin;
2554 base64 base64_coder;
2555 compress_stream::kernel_1ea compressor;
2556 sin.str(data);
2557 base64_coder.decode(sin, sout);
2558 sin.clear();
2559 sin.str(sout.str());
2560 sout.clear();
2561 sout.str("");
2562 compressor.decompress(sin, sout);
2563 sin.clear();
2564 sin.str(sout.str());
2565 deserialize(result, sin);
2566 DLIB_TEST(image == result);
2567 }
2568
2569 template <typename pixel_type>
2570 double avg_pixel_delta(const matrix<pixel_type>& img1, const matrix<pixel_type>& img2)

Callers 1

perform_testMethod · 0.85

Calls 7

print_spinnerFunction · 0.85
assign_all_pixelsFunction · 0.85
draw_stringFunction · 0.85
deserializeFunction · 0.70
strMethod · 0.45
decodeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected