Search code examples
qtarrayfire

Convert af::array to QVector


I am looking for a way to convert a image, which is represented (because I used ArrayFire function loadimage()) as af::array to QVector. Any advice on how can I do this?

Thank you!


Solution

  • Let a be you af::array. Provided you can retrieve the pointer to the actual data via a.host() and the number of array elements with a.bytes(), the question reduces to "How can I convert a C array to a QVector.

    That is already answered here: Initialize QVector from array