inline void opencv_copy_mat_to_image(const cv::Mat &mat, image2d &image, command_queue &queue = system::default_queue()) { BOOST_ASSERT(mat.data != 0); BOOST_ASSERT(mat.isContinuous()); BOOST_ASSERT(image.get_context() == queue.get_context()); queue.enqueue_write_image(image, image.origin(), image.size(), mat.data); }
inline void opencv_copy_mat_to_image(const cv::Mat &mat, image2d &image, command_queue &queue = system::default_queue()) { BOOST_ASSERT(mat.data != 0); BOOST_ASSERT(mat.isContinuous()); BOOST_ASSERT(image.get_context() == queue.get_context()); size_t origin[2] = { 0, 0 }; size_t region[2] = { image.width(), image.height() }; queue.enqueue_write_image(image, origin, region, 0, mat.data); }
inline void qt_copy_qimage_to_image2d(const QImage &qimage, image2d &image, command_queue &queue) { queue.enqueue_write_image(image, image.origin(), image.size(), qimage.constBits()); }