Changeset 561 for trunk/src/gui/image/qbmphandler.cpp
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/gui/image/qbmphandler.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information ([email protected]) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation ([email protected]) 5 6 ** 6 7 ** This file is part of the QtGui module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you 37 ** @nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 53 53 { 54 54 int i; 55 if (image->depth() == 1 && image-> numColors() == 2) {55 if (image->depth() == 1 && image->() == 2) { 56 56 register uint *p = (uint *)image->bits(); 57 int nbytes = image-> numBytes();57 int nbytes = image->(); 58 58 for (i=0; i<nbytes/4; i++) { 59 59 *p = ~*p; … … 82 82 const int BMP_FILEHDR_SIZE = 14; // size of BMP_FILEHDR data 83 83 84 QDataStream &operator>>(QDataStream &s, BMP_FILEHDR &bf)84 QDataStream &operator>>(QDataStream &s, BMP_FILEHDR &bf) 85 85 { // read file header 86 86 s.readRawData(bf.bfType, 2); … … 89 89 } 90 90 91 QDataStream &operator<<(QDataStream &s, const BMP_FILEHDR &bf)91 QDataStream &operator<<(QDataStream &s, const BMP_FILEHDR &bf) 92 92 { // write file header 93 93 s.writeRawData(bf.bfType, 2); … … 107 107 108 108 109 QDataStream &operator>>(QDataStream &s, BMP_INFOHDR &bi)109 QDataStream &operator>>(QDataStream &s, BMP_INFOHDR &bi) 110 110 { 111 111 s >> bi.biSize; … … 129 129 } 130 130 131 QDataStream &operator<<(QDataStream &s, const BMP_INFOHDR &bi)131 QDataStream &operator<<(QDataStream &s, const BMP_INFOHDR &bi) 132 132 { 133 133 s << bi.biSize; … … 247 247 if (depth != 32) { 248 248 ncols = bi.biClrUsed ? bi.biClrUsed : 1 << nbits; 249 image.set NumColors(ncols);249 image.set(ncols); 250 250 } 251 251 … … 527 527 return false; 528 528 529 if (image.depth() == 8 && image. numColors() <= 16) {529 if (image.depth() == 8 && image.() <= 16) { 530 530 bpl_bmp = (((bpl+1)/2+3)/4)*4; 531 531 nbits = 4; … … 555 555 : 2834; // 72 dpi default 556 556 bi.biYPelsPerMeter = image.dotsPerMeterY() ? image.dotsPerMeterY() : 2834; 557 bi.biClrUsed = image. numColors();558 bi.biClrImportant = image. numColors();557 bi.biClrUsed = image.(); 558 bi.biClrImportant = image.(); 559 559 s << bi; // write info header 560 560 if (s.status() != QDataStream::Ok) … … 562 562 563 563 if (image.depth() != 32) { // write color table 564 uchar *color_table = new uchar[4*image. numColors()];564 uchar *color_table = new uchar[4*image.()]; 565 565 uchar *rgb = color_table; 566 566 QVector<QRgb> c = image.colorTable(); 567 for (int i=0; i<image. numColors(); i++) {567 for (int i=0; i<image.(); i++) { 568 568 *rgb++ = qBlue (c[i]); 569 569 *rgb++ = qGreen(c[i]); … … 571 571 *rgb++ = 0; 572 572 } 573 if (d->write((char *)color_table, 4*image. numColors()) == -1) {573 if (d->write((char *)color_table, 4*image.()) == -1) { 574 574 delete [] color_table; 575 575 return false; … … 755 755 756 756 // Code partially repeated in qt_write_dib 757 if (image.depth() == 8 && image. numColors() <= 16) {757 if (image.depth() == 8 && image.() <= 16) { 758 758 bpl_bmp = (((bpl+1)/2+3)/4)*4; 759 759 } else if (image.depth() == 32) { … … 772 772 bf.bfReserved1 = 0; 773 773 bf.bfReserved2 = 0; 774 bf.bfOffBits = BMP_FILEHDR_SIZE + BMP_WIN + image. numColors() * 4;774 bf.bfOffBits = BMP_FILEHDR_SIZE + BMP_WIN + image.() * 4; 775 775 bf.bfSize = bf.bfOffBits + bpl_bmp*image.height(); 776 776 s << bf;
Note:
See TracChangeset
for help on using the changeset viewer.