Results 1 to 2 of 2

Thread: Displaying two huges images in some special circumstances.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2006
    Posts
    160
    Thanks
    33
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Displaying two huges images in some special circumstances.

    Hi to everyone here,

    As some of you probably noticed, i'm trying to get a Photoshop plugin made with QT running...
    I have done the trickiest part of the threading, now i'm trying to display the original picture, and the processed picture. Here is how it's made so far:
    - a Main settings dialog containing all buttons, sliders and fine tuning for my filters.
    - This main dialog is in charge of launching / stopping / restarting the processing thread, accordingly to all the settings.
    - i do have a QDialog, which will contain two pictures (Left: Original, Right: Processed with real time advancement with the feedback i have from the processing thread). This dialog is displayed using ->show() from the previously described dialog's constructor.
    - There is a button on the main dialog, which will be used to "split" the previewing dialog into two distinct dialogs (One containing the original picture, the other dialog the processed picture). And of course the inverse function, to "glue" the two windows once they are splitted.

    Now, i'm asking myself on what is the best thing to do for me, i prefered to stop coding and try to get feedback here ^^
    The two pictures which i have to display can be pretty huge (1600x1200, sometimes more, often less). The problem is, the RAM is already holding 5 copies of those pictures (The Photoshop data as an input, the Photoshop data as an output, and internally of my application i have made objects named CARGBPlanes which holds 3 times the pictures: i need original, input and output for each filters).
    So, what will be the best for me (QT side)? If i rewrite my filters (Which were made a long time ago), would it be a good idea to make them use QT objects instead of my CARGBPlanes objects? If i make my filters work on some QT objects (QImage for example), is it possible that i directly use the "working" object as my main display objects?

    I have read a lot tonight about QGraphicsView, QItemsView, QPixmap, QImage, QBitmap... What would be the less RAM-consument combination?

    If you need more information to tell me the good points / drawbacks of your ideas, ask me, i'll try to be more specific.

    I hope you understand what i'm trying to know ^^
    Thanks for any advice.
    Pierre.

    [EDIT:] I forgot the most important point... The preview pictures (Original and processed) has to be zoomable... That's why i aimed my search at QGraphicScene for now ^^ Also i noticed that QPicture have a maximum of a byte per channel (0xAARRGGBB). If i want to use QT objects internaly, i will have to change it from 8 bits to 16 bits ber channel (But i dont need alpha, only RGB) =/ I'm not sure if it's possible or not...
    Last edited by hickscorp; 7th April 2007 at 22:37.

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Displaying two huges images in some special circumstances.

    If i make my filters work on some QT objects (QImage for example), is it possible that i directly use the "working" object as my main display objects?
    Yes, if you store the images as QPixmaps, you could modify directly the QPixmap buffer and update it on screen. But isn't this what you already do with your image buffers?

    I am not sure how much memory you will gain by doing this. It depends on how many identical copies of the image your plug-in has stored in memory.
    QPixmap when loaded, looks into a QPixmapCache, to see if the image you are trying to load has been loaded before. If it has, the it doesn't create a new copy, but instead gives you a reference to the one loaded first.

    If you have only one copy of a image in memory, then QPixmap won't be much help.

    Also, QPixmap has some drawbacks related to image size. It apparently does not work with images larger than 2000x2000 pixels( on some computers even less ), so you will have to split a big image in smaller blocks, process them, and then display them on the screen.

    On the other hand, QGraphicsView is very fast and this could help you a lot with image preview operations such as zoom, scroll, etc.

    Conclusion - QPixmap will not help you much ( from the performance point of view ). But QGraphics view will, therefore you should think about using both.

  3. The following user says thank you to marcel for this useful post:

    hickscorp (14th April 2007)

Similar Threads

  1. Displaying real time images
    By Sheetal in forum Qt Programming
    Replies: 9
    Last Post: 22nd February 2007, 11:29
  2. Any special .dll for images ?
    By probine in forum Installation and Deployment
    Replies: 4
    Last Post: 5th May 2006, 13:04

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
  •  
Qt is a trademark of The Qt Company.