]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/gil/test/core/image/image.cpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / libs / gil / test / core / image / image.cpp
index b1218343297062e7d9ab87eb0e432af3c65bda49..0010359984b9cc74e470dbd129df709cfaa5a89b 100644 (file)
@@ -38,6 +38,40 @@ struct test_constructor_with_dimensions_pixel
     }
 };
 
+struct test_constructor_from_other_image
+{
+    template <typename Image>
+    void operator()(Image const &)
+    {
+        using image_t = Image;
+        gil::point_t const dimensions{256, 128};
+        using pixel_t = typename image_t::view_t::value_type;
+        pixel_t const rnd_pixel = fixture::pixel_generator<pixel_t>::random();
+        {
+            //constructor interleaved from planar
+            gil::image<pixel_t, true> image1(dimensions, rnd_pixel); 
+            image_t image2(image1);
+            BOOST_TEST_EQ(image2.dimensions(), dimensions);
+            auto v1 = gil::const_view(image1);
+            auto v2 = gil::const_view(image2);
+            BOOST_TEST_ALL_EQ(v1.begin(), v1.end(), v2.begin(), v2.end());
+        }
+        // {
+        //     //constructor planar from interleaved
+        //     image_t image1(dimensions, rnd_pixel); 
+        //     gil::image<pixel_t, true> image2(image1); 
+        //     BOOST_TEST_EQ(image2.dimensions(), dimensions);
+        //     auto v1 = gil::const_view(image1);
+        //     auto v2 = gil::const_view(image2);
+        //     BOOST_TEST_ALL_EQ(v1.begin(), v1.end(), v2.begin(), v2.end());
+        // }
+    }
+    static void run()
+    {
+        boost::mp11::mp_for_each<fixture::rgb_interleaved_image_types>(test_constructor_from_other_image{});
+    }
+};
+
 struct test_move_constructor
 {
     template <typename Image>
@@ -83,6 +117,7 @@ struct test_move_assignement
 int main()
 {
     test_constructor_with_dimensions_pixel::run();
+    test_constructor_from_other_image::run();
 
     test_move_constructor::run();
     test_move_assignement::run();