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

Function test_dng_float_int

dlib/test/image.cpp:1814–1836  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1812 }
1813
1814 void test_dng_float_int()
1815 {
1816 dlog << LINFO << "in test_dng_float_int";
1817 print_spinner();
1818
1819 array2d<uint16> img;
1820 assign_image(img, gaussian_randm(101,100)*10000);
1821
1822 ostringstream sout;
1823 save_dng(img, sout);
1824 istringstream sin(sout.str());
1825 array2d<double> img2;
1826 load_dng(img2, sin);
1827 sout.clear(); sout.str("");
1828
1829 save_dng(img2, sout);
1830 sin.clear(); sin.str(sout.str());
1831 array2d<uint16> img3;
1832 load_dng(img3, sin);
1833
1834 // this whole thing should have been totally lossless.
1835 DLIB_TEST(mat(img) == mat(img3));
1836 }
1837
1838// ----------------------------------------------------------------------------------------
1839

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