Results 1 to 3 of 3

Thread: How to enable OpenEXR support in QT on windows

  1. #1
    Join Date
    Jul 2014
    Posts
    32
    Qt products
    Qt5
    Platforms
    Windows

    Default How to enable OpenEXR support in QT on windows

    Hi,
    i am trying to figure out, how to get support for OpenEXR images in QT on windows.

    I now that I have to somehow compile the OpenEXR libs (http://www.openexr.com), but I could not find anything about compiling it in QT Creator. I could not find a good step by step tutorial. And in most cases it was for Linux.

    Does anyone successfully use the OpenEXR libs with QT Creator? Can I simpy use precompiles libs from another tool? And how is the file format recognized by the QT classes like QImage etc?

    Thanks for your help.

  2. #2
    Join Date
    Jul 2014
    Posts
    32
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: How to enable OpenEXR support in QT on windows

    I found a very interesting plugin: It is called "ResIL" which ic based on "devIL": http://openil.sourceforge.net/

    I was able to compile ResIL with the help of Visual Studio 2010.

    Then I found a page which describes how to create a custom image file format for QT. The problem here is that the page is in French. And the code is a little bit confusing. I cannot really figure out how the code is using the libs from ResIL.

    http://tcuvelier.developpez.com/tuto.../extend/devil/

    https://translate.google.com/transla...end%2Fdevil%2F

    It is based on this site: http://doc.qt.digia.com/qq/qq17-imageio.html

    Maybe someone has an idea how to create this plugin. It is really unfortunattly that the link to the project file at the end is not working.


    Added after 1 35 minutes:


    OK, I ignored the french site and tried the old qt page tutorial. Now I am almost done and I only get one error message:

    argbplugin.cpp:32: error: invalid new-expression of abstract class type 'ArgbHandler'
    QImageIOHandler *handler = new ArgbHandler;



    I dont know why it is not compiling. I just copy / paste it from the tutorial. I will attach the pro file. I think it is quite easy but i am lacking experience here:

    I am using QT 5.41. and QT Creator 3.3.1

    Qt Code:
    1. class ArgbPlugin : public QImageIOPlugin
    2. {
    3.  
    4. QImageIOHandler *create(QIODevice *device, const QByteArray &format = QByteArray()) const;
    5. };
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. QImageIOHandler *ArgbPlugin::create( QIODevice *device, const QByteArray &format) const
    2. {
    3. QImageIOHandler *handler = new ArgbHandler;
    4. handler->setDevice(device);
    5. handler->setFormat(format);
    6. return handler;
    7. }
    To copy to clipboard, switch view to plain text mode 
    Project:ARGB2.zip
    Last edited by jho; 9th March 2015 at 00:01.

  3. #3
    Join Date
    Jul 2014
    Posts
    32
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: How to enable OpenEXR support in QT on windows

    I forgot some code snippet:

    Qt Code:
    1. class ArgbHandler : public QImageIOHandler
    2. {
    3. public:
    4. ArgbHandler();
    5. ~ArgbHandler();
    6.  
    7. // some methods are following....
    8. };
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Replies: 0
    Last Post: 10th October 2013, 08:04
  2. New to Qt - Windows 95 support?
    By cmg5217 in forum Newbie
    Replies: 1
    Last Post: 31st August 2013, 16:58
  3. Replies: 1
    Last Post: 19th March 2010, 14:36
  4. GIF support in Windows ?
    By probine in forum Qt Programming
    Replies: 6
    Last Post: 16th January 2007, 00:19
  5. 64-bit support in Windows?
    By jamos in forum Qt Programming
    Replies: 1
    Last Post: 12th May 2006, 17:29

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.