diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-26 21:04:57 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-26 21:04:57 +0000 |
commit | bf7f88413be3831a9372d323d02fc0335b9f9188 (patch) | |
tree | 516fdef9206245b40a14f99b4e3d9ef9289196e0 /src/imageutils/croppedqimage.cpp | |
parent | e238aa77b1fb3c2f55aef2ef2c91ce52166d2cc8 (diff) | |
download | gwenview-bf7f88413be3831a9372d323d02fc0335b9f9188.tar.gz gwenview-bf7f88413be3831a9372d323d02fc0335b9f9188.zip |
TQt4 port Gwenview
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/gwenview@1233720 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/imageutils/croppedqimage.cpp')
-rw-r--r-- | src/imageutils/croppedqimage.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/imageutils/croppedqimage.cpp b/src/imageutils/croppedqimage.cpp index 0271e85..7f47366 100644 --- a/src/imageutils/croppedqimage.cpp +++ b/src/imageutils/croppedqimage.cpp @@ -23,43 +23,43 @@ namespace ImageUtils { -// This class is used in ImageView::performPaint(). Just using QImage::copy( QRect ) +// This class is used in ImageView::performPaint(). Just using TQImage::copy( TQRect ) // takes a significant time with very large images. So instead of copying the image data -// just create CroppedQImage which fakes a subimage by manipulating its scanline pointers. +// just create CroppedTQImage which fakes a subimage by manipulating its scanline pointers. // That will of course break if something doesn't use scanlines but accesses the image -// data directly, QImage::copy() being the most notable case. There are two ways +// data directly, TQImage::copy() being the most notable case. There are two ways // to handle that: 1) It is possible to manually call normalize() which will make -// CroppedQImage copy the image data and own it, just like proper QImage. 2) CroppedQImage -// has as a data member also QImage holding the original image. This ensures that all -// the original image data are still available for the whole lifetime of CroppedQImage. +// CroppedTQImage copy the image data and own it, just like proper TQImage. 2) CroppedTQImage +// has as a data member also TQImage holding the original image. This ensures that all +// the original image data are still available for the whole lifetime of CroppedTQImage. -CroppedQImage::CroppedQImage( const QImage& im, const QRect& rect ) - : QImage( rect.size(), im.depth(), im.numColors(), im.bitOrder()) +CroppedTQImage::CroppedTQImage( const TQImage& im, const TQRect& rect ) + : TQImage( rect.size(), im.depth(), im.numColors(), im.bitOrder()) , orig( im ) { if( im.isNull()) return; - memcpy( colorTable(), im.colorTable(), im.numColors() * sizeof( QRgb )); + memcpy( tqcolorTable(), im.tqcolorTable(), im.numColors() * sizeof( TQRgb )); setAlphaBuffer( im.hasAlphaBuffer()); setDotsPerMeterX( im.dotsPerMeterX()); setDotsPerMeterY( im.dotsPerMeterY()); //data->offset = im.offset(); - // make scanlines point to right places in the original QImage + // make scanlines point to right places in the original TQImage for( int i = 0; i < height(); ++i ) - jumpTable()[ i ] = im.scanLine( rect.y() + i ) + rect.x() * ( depth() / 8 ); + const_cast<CroppedTQImage*>(this)->jumpTable()[ i ] = const_cast<TQImage&>(im).scanLine( rect.y() + i ) + rect.x() * ( depth() / 8 ); } -CroppedQImage& CroppedQImage::operator= ( const QImage& im ) +CroppedTQImage& CroppedTQImage::operator= ( const TQImage& im ) { - QImage::operator=( im ); + TQImage::operator=( im ); return *this; } -void CroppedQImage::normalize() +void CroppedTQImage::normalize() { - // is it a normal QImage with its own data? + // is it a normal TQImage with its own data? uchar* firstdata = ( uchar* )( jumpTable() + height()); if( scanLine( 0 ) == firstdata ) return; |