src/gui/image/qimage.cpp
branchRCL_3
changeset 14 c0432d11811c
parent 4 3b1da2848fc7
child 29 b72c6db6890b
equal deleted inserted replaced
13:cc75c76972ee 14:c0432d11811c
   116 const QVector<QRgb> *qt_image_colortable(const QImage &image)
   116 const QVector<QRgb> *qt_image_colortable(const QImage &image)
   117 {
   117 {
   118     return &image.d->colortable;
   118     return &image.d->colortable;
   119 }
   119 }
   120 
   120 
   121 extern int qt_defaultDpiX();
   121 Q_GUI_EXPORT extern int qt_defaultDpiX();
   122 extern int qt_defaultDpiY();
   122 Q_GUI_EXPORT extern int qt_defaultDpiY();
   123 
   123 
   124 QBasicAtomicInt qimage_serial_number = Q_BASIC_ATOMIC_INITIALIZER(1);
   124 QBasicAtomicInt qimage_serial_number = Q_BASIC_ATOMIC_INITIALIZER(1);
   125 
   125 
   126 QImageData::QImageData()
   126 QImageData::QImageData()
   127     : ref(0), width(0), height(0), depth(0), nbytes(0), data(0),
   127     : ref(0), width(0), height(0), depth(0), nbytes(0), data(0),
  5665         return;
  5665         return;
  5666     }
  5666     }
  5667 
  5667 
  5668     detach();
  5668     detach();
  5669 
  5669 
  5670     *this = convertToFormat(QImage::Format_ARGB32_Premultiplied);
  5670     QImage converted = convertToFormat(QImage::Format_ARGB32_Premultiplied);
       
  5671     if (!converted.isNull())
       
  5672         *this = converted;
       
  5673     else
       
  5674         return;
  5671 
  5675 
  5672     // Slight optimization since alphachannels are returned as 8-bit grays.
  5676     // Slight optimization since alphachannels are returned as 8-bit grays.
  5673     if (alphaChannel.d->depth == 8 && alphaChannel.isGrayscale()) {
  5677     if (alphaChannel.d->depth == 8 && alphaChannel.isGrayscale()) {
  5674         const uchar *src_data = alphaChannel.d->data;
  5678         const uchar *src_data = alphaChannel.d->data;
  5675         const uchar *dest_data = d->data;
  5679         const uchar *dest_data = d->data;