[Qt-interest] display grayscale image?

caius ligarius caius9090 at gmail.com
Wed Apr 28 18:56:57 CEST 2010


Thanks. You are right I think I need to convert the int values to a 12BIT
color table values. I wish there was a simple example which would show this.

Caius

On Wed, Apr 28, 2010 at 9:03 AM, Michael Jackson <
mike.jackson at bluequartz.net> wrote:

> On 4/28/10 11:49 AM, in article
> g2jecaaccc81004280849yabaa4dedrf364ee2fc0b3ab62 at mail.gmail.com, "caius
> ligarius" wrote:
>
> > Yes I looked at that but what would the format of the data be if I have
> > 12Bit Grayscale image?
> >
> > Caius
> >
> > On Tue, Apr 27, 2010 at 3:55 PM, <kurt.korbatits at nokia.com> wrote:
> >
> >>  You should be able to wrap a QImage around the data.
> >>
> >> QImage::QImage ( uchar * data, int width, int height, Format format )
> >>
> >>
> >> Kurt Korbatits
> >> Software Engineer
> >> Nokia - Qt Development Frameworks
> >>
> >>
> >>  ------------------------------
> >> *From:* qt-interest-bounces at trolltech.com [mailto:
> >> qt-interest-bounces at trolltech.com] *On Behalf Of *ext caius ligarius
> >> *Sent:* Wednesday, April 28, 2010 8:45 AM
> >> *To:* qt-interest at trolltech.com
> >> *Subject:* [Qt-interest] display grayscale image?
> >>
> >> Hi,
> >>
> >> I am a first time user and am struggling to display a simple int*
> (512x512)
> >> grayscale image pointer.
> >>
> >> I have looked at some examples but it is still not clear. Seems like one
> of
> >> the ways would be to create QGraphicsScene do an addPIxmap  and pass it
> to a
> >> QGraphicsView. My question is how do I add my 12Bit int* image buffer
> array
> >> which I already have in memory to addPixmap or is there some other way
> to do
> >> it?
> >>
> >>
> >> Thanks,
> >> Caius
> >>
> You may want to run some sort of transform on your data so that you end up
> with an 8 bit image with a lookup table. You can generate the lookup table
> your self. I do with with "normal" 8 bit grayscale images. Not sure of all
> the ramifications with a 12 bit grayscale image buffer though.
>
>  And I do use a QGraphicsScene with a QPixMap added to the scene.
>
> Mike Jackson
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100428/dba9b17a/attachment.html 


More information about the Qt-interest-old mailing list