|
|||||||
| Newbie Newbie to Qt? Ask your questions here. |
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hello experts.
Id like to know a way to display an image's color table in a QTableWidget. Let me rephrase the question, if I wanted to display the color table of an image how would I do it? I would need the output of the color table to find colors that are in a specific range so I can manipulate those color group. Thank you very much in advance. |
|
#2
|
|||
|
|||
|
If we are speaking about images that do have colour tables (8 bit or less), then use QImage::colorTable() to retrieve it and create table items out of it. If the image is 24b deep, you'll need to iterate the image using QImage::pixel() and build the colour table yourself.
|
|
#3
|
|||
|
|||
|
Quote:
|
|
#4
|
|||
|
|||
|
No, it means creating a QList<QColor> and filling it with colours retrieved from the image using QImage::pixel(). 24 bit images don't have colour lookup tables, because the amount of space they would take is bigger than the cost of storing the colour value directly in pixel data. At worst such a lookup table would have 16.7M entries, 3 bytes each + 3 bytes per pixel to store the index of the table in the pixel. It's better to just use 3 bytes per pixel to store the colour directly.
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Displaying different images and data on the same dialog | merry | Qt Programming | 3 | 17th May 2007 13:50 |
| Displaying real time images | Sheetal | Qt Programming | 9 | 22nd February 2007 11:29 |