[Qt-interest] Quicktime C -> QImage

"Alexander Carôt" alexander_carot at gmx.net
Mon Apr 19 11:00:01 CEST 2010


Hi Stephen,

thanks a lot for the swift response !

> That is a CoreGraphics image reference. How do you actually get a 
> QuickTime image?

I believe this is my actual problem (I am newbie to OSX graphic (esp. Quicktime) programming). How do I obtain the pixel array or pointer to the pixel image data ? Once I have this I will load it straight into the QImage buffer as you described below.

Thanks a lot in advance

-- A l e x


 
> > and then I thought about using the QImage::setPixel(...) in this way:
> > 
> > 
> > ************
> >     unsigned int *pixels = (unsigned int *) image;
> >     int i = 0;
> >     for (int y = 0; y < 240; y++){
> >       for (int x = 0; x < 320; x++){
> >         displayImage->setPixel(x,y,pixels[i]);
> >         i++;
> >       }   
> >     }   
> > **************
> 
> If the "image" variable is the same one you get from CGImageCreate, it's 
> just a reference, not a pointer to image buffer. I am surprised it 
> doesn't crash.
> 
> setPixel is too slow for image construction. You need to create a QImage 
> from the external buffer you get from QT or other source: 
> http://qt.nokia.com/doc/4.6/qimage.html#QImage-6
> 
> Or you can load the QT image directly into a QImage's owned buffer:
> http://qt.nokia.com/doc/4.6/qimage.html#bits
> 
> HTH.
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest

-- 
http://www.carot.de
http://www.triologue.de
Email : Alexander at Carot.de
Tel.: +49 (0)177 5719797



GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01



More information about the Qt-interest-old mailing list