You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't know if this is a bug or an undocumented limitation (see below), but there may be not too complex ways to fix it (e.g. planar image copy-construction from interleaved image by zero-filling construction followed by copy_pixels with interleaved to planar pixel conversion; slower than uninitialized_copy though). See more details below.
gil::rgb8_image_timg1(gil::rgb8_planar_image_t{}); // OK
gil::rgb8_planar_image_timg2(gil::rgb8_image_t{}); // KO (fails to compile)
Expected behavior
Successful construction of planar images from interleaved images.
C++ Minimal Working Example
#include<boost/gil.hpp>namespacegil= boost::gil;
intmain()
{
gil::rgb8_image_t img_i;
gil::rgb8_planar_image_timg_p(img_i); // fails to compile// due to no overload of uninitialized_copy_aux supporting// input pair of interleaved iterators and output pair of planar iteratorsusing both_planar = std::false_type;
auto iv = gil::view(img_i);
auto pv = gil::view(img_p);
// fails to compilegil::detail::uninitialized_copy_aux(iv.begin().x(), iv.end().x(), pv.begin().x(), both_planar{});
// compiles, becuase this direction is supportedgil::detail::uninitialized_copy_aux(pv.begin().x(), pv.end().x(), iv.begin().x(), both_planar{});
}
Discussion
Apparently, this comment here is not entirely correct or complete:
This issue was reported by @sdebionne on Slack.
I don't know if this is a bug or an undocumented limitation (see below), but there may be not too complex ways to fix it (e.g. planar image copy-construction from interleaved image by zero-filling construction followed by
copy_pixels
with interleaved to planar pixel conversion; slower thanuninitialized_copy
though). See more details below./cc @stefanseefeld @chhenning in case you know more for background of this limitation (or bug).
Actual behavior
Expected behavior
Successful construction of planar images from interleaved images.
C++ Minimal Working Example
Discussion
Apparently, this comment here is not entirely correct or complete:
gil/include/boost/gil/algorithm.hpp
Lines 764 to 767 in b3f72cc
and should rather read
/// std::uninitialized_copy for pairs of interleaved iterators or input pair of planar iterators and output pair of interleaved iterators
The
gil::detail::uninitialized_copy_aux
simply performs https://en.cppreference.com/w/cpp/memory/uninitialized_copy which requiresthat is not feasible for planar pixels.
References
Environment
<boost/version.hpp>
): Boost 1.72, 1.73 (current master and develop)The text was updated successfully, but these errors were encountered: