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

Function test_dng_float_int

dlib/test/image.cpp:1729–1751  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1727 }
1728
1729 void test_dng_float_int()
1730 {
1731 dlog << LINFO << "in test_dng_float_int";
1732 print_spinner();
1733
1734 array2d<uint16> img;
1735 assign_image(img, gaussian_randm(101,100)*10000);
1736
1737 ostringstream sout;
1738 save_dng(img, sout);
1739 istringstream sin(sout.str());
1740 array2d<double> img2;
1741 load_dng(img2, sin);
1742 sout.clear(); sout.str("");
1743
1744 save_dng(img2, sout);
1745 sin.clear(); sin.str(sout.str());
1746 array2d<uint16> img3;
1747 load_dng(img3, sin);
1748
1749 // this whole thing should have been totally lossless.
1750 DLIB_TEST(mat(img) == mat(img3));
1751 }
1752
1753// ----------------------------------------------------------------------------------------
1754

Callers 1

perform_testMethod · 0.85

Calls 8

print_spinnerFunction · 0.85
gaussian_randmFunction · 0.85
save_dngFunction · 0.85
load_dngFunction · 0.85
assign_imageFunction · 0.50
matFunction · 0.50
strMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected