28 #ifndef SCRIBO_CONVERT_FROM_QIMAGE_HH
29 # define SCRIBO_CONVERT_FROM_QIMAGE_HH
36 # include <QtGui/QImage>
38 # include <mln/core/image/image2d.hh>
39 # include <mln/value/qt/rgb32.hh>
41 # if QT_VERSION < 0x040000
42 # error "Qt library too old. You need at least Qt 4.x."
43 # endif // ! QT_VERSION
60 from_qimage(
const QImage& ima);
63 # ifndef MLN_INCLUDE_ONLY
66 from_qimage(
const QImage& ima)
70 if (ima.format() != QImage::Format_RGB32)
71 tmp = ima.convertToFormat(QImage::Format_RGB32);
79 QImage qima(
ncols, nrows, QImage::Format_RGB32);
80 std::memcpy(output.buffer(),
82 output.nelements() * 4);
87 # endif // ! MLN_INCLUDE_ONLY
93 #endif // ! SCRIBO_CONVERT_FROM_QIMAGE_HH