| 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() |
no test coverage detected