I'm building an application consisting of two parts: QtQuick GUI (C++) and Haskell back-end processing the images using repa
and accelerate
packages.
I want to interactively display images in GUI. I would love not to copy the data but use some kind of shared memory or any other mechanism, which would allow me to gain the most performance.
What is the best way to "transfer" and display these images interactively in C++ GUI?
I heard about HQK
and qtHaskell
, but it supports only qtquick
up to v4.8 (and we need v5.0 - v5.2)
I'm not sure about Haskell but in lablqt (my library for building QtQuick+OCaml applications, http://kakadu.github.io/lablqt/) I would try this method:
Maybe this approach sucks because if we will need resize image, GC will instantiate new image, copy old to new one and after that we will need to update pointer to image in C++ side.
Excuse me, in my idea will be unusable.
Hm, could you use mmap
? There is vector-mmap for Haskell which maps a file into a (shared) memory read only or as mutable vector.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With