X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FQLImage.C;h=08a394b68b58a0dbfd560bb8d5c7e8c43785225b;hb=e18dcb5b9d39efbf1a339f0985af1b8a43bf4be4;hp=54d9537fa0b62a0ad2691fb40d00e772cc75586f;hpb=f7d81fbabf71f5bc3c6a472be78f9d78b59ccdcf;p=lyx.git diff --git a/src/frontends/qt4/QLImage.C b/src/frontends/qt4/QLImage.C index 54d9537fa0..08a394b68b 100644 --- a/src/frontends/qt4/QLImage.C +++ b/src/frontends/qt4/QLImage.C @@ -183,14 +183,9 @@ QImage & toGray(QImage & img) int const pixels = img.depth() > 8 ? img.width() * img.height() : img.numColors(); - // FIXME this code used to be like this: - // - //unsigned int * const data = img.depth() > 8 ? - // (unsigned int *)img.bits() : - // (unsigned int *)img.jumpTable(); - // - // But Qt doc just say use bits... - unsigned int * const data = (unsigned int *)img.bits(); + unsigned int *data = img.depth() > 8 ? + reinterpret_cast(img.bits()) : + reinterpret_cast(&img.colorTable()[0]); for(int i = 0; i < pixels; ++i){ int const val = qGray(data[i]); @@ -269,9 +264,6 @@ void QLImage::rotate_impl(Params const & params) QMatrix m; m.rotate(-params.angle); - // FIXME: alpha chanel detection is automautic for monochrome - // and 8-bit images. For 32 bit, is something like still necessary? - //transformed_.setAlphaBuffer(true); transformed_ = transformed_.transformed(m); }