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

Function check_image

dlib/test/ffmpeg.cpp:57–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55
56 template <class pixel>
57 void check_image (
58 const frame& f,
59 const matrix<pixel>& img
60 )
61 {
62 DLIB_TEST(!f.is_empty());
63 DLIB_TEST(f.is_image());
64 DLIB_TEST(!f.is_audio());
65 DLIB_TEST(f.samplefmt() == AV_SAMPLE_FMT_NONE);
66 DLIB_TEST(f.sample_rate() == 0);
67 DLIB_TEST(f.nsamples() == 0);
68 DLIB_TEST(f.layout() == 0);
69 DLIB_TEST(f.nchannels() == 0);
70 DLIB_TEST(f.pixfmt() == pix_traits<pixel>::fmt);
71 DLIB_TEST(f.height() == img.nr());
72 DLIB_TEST(f.width() == img.nc());
73
74 matrix<pixel> dummy;
75 convert(f, dummy);
76 DLIB_TEST(dummy.nc() == img.nc());
77 DLIB_TEST(dummy.nr() == img.nr());
78 DLIB_TEST(img == dummy);
79 }
80
81 template <class pixel>
82 void test_frame()

Callers 1

test_frameFunction · 0.85

Calls 14

is_imageMethod · 0.80
is_audioMethod · 0.80
samplefmtMethod · 0.80
nsamplesMethod · 0.80
pixfmtMethod · 0.80
convertFunction · 0.50
is_emptyMethod · 0.45
sample_rateMethod · 0.45
layoutMethod · 0.45
nchannelsMethod · 0.45
heightMethod · 0.45
nrMethod · 0.45

Tested by

no test coverage detected