Re: Using GM with Qt
Bob Friesenhahn <[email protected]>
| Newsgroups | gmane.comp.video.graphicsmagick.help |
|---|---|
| Message-ID | <[email protected]> |
On Wed, 23 Dec 2015, DJ wrote: > Greetings. I just discovered GraphicsMagick last night while running > octave on my Linux box (Linux Mint 17.1). I have only recently begun to > explore image processing programming. > > Quick question: > > Is it practical to use GraphicsMagick libraries with Qt, i.e. for > display and manipulation in a Qt gui? A quick look at the API docs > indicate that GraphicsMagick has its own way to display an image under > X. But does it also provide some in-memory format for images that might > be easily displayable for manipulation in Qt? Yes. Both GraphicsMagick and Qt have their own way to store images in memory. X11 has yet more ways, and the video card might provide even more ways. There will be some memory duplication, no matter what you do. The GraphicsMagick X11 display capabilities have nothing to do with what you would need for Qt. For Qt, you would need a small bit of C++ code to copy pixels from the GraphicsMagick Image representation to Qt's own representation. Then use Qt to display it. If the image is modified using GraphicsMagick functions, then the Image would need to be copied to the Qt representation in order to display the changes using Qt. Naturally, this means that the copy code needs to be as efficient as possible. I am sure that this has all been done before given that KDE has long provided a path from GraphicsMagick into Qt such as to support Krita (https://www.kde.org/applications/graphics/krita/) and other image oriented applications. Bob -- Bob Friesenhahn [email protected], http://www.simplesystems.org/users/bfriesen/ GraphicsMagick Maintainer, http://www.GraphicsMagick.org/ ------------------------------------------------------------------------------