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/imageutils.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/imageutils.cpp')
-rw-r--r-- | src/imageutils/imageutils.cpp | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/src/imageutils/imageutils.cpp b/src/imageutils/imageutils.cpp index 0dce222..2ec1209 100644 --- a/src/imageutils/imageutils.cpp +++ b/src/imageutils/imageutils.cpp @@ -1,7 +1,7 @@ // vim: set tabstop=4 shiftwidth=4 noexpandtab /* Gwenview - A simple image viewer for KDE -Copyright 2000-2004 Aur�lien G�teau +Copyright 2000-2004 Aur�lien G�teau This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -20,9 +20,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include <math.h> -// Qt -#include <qimage.h> -#include <qwmatrix.h> +// TQt +#include <tqimage.h> +#include <tqwmatrix.h> // KDE #include <kdebug.h> @@ -35,8 +35,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. namespace ImageUtils { -QWMatrix transformMatrix(Orientation orientation) { - QWMatrix matrix; +TQWMatrix transformMatrix(Orientation orientation) { + TQWMatrix matrix; switch (orientation) { case NOT_AVAILABLE: case NORMAL: @@ -77,7 +77,7 @@ QWMatrix transformMatrix(Orientation orientation) { } -QImage transform(const QImage& img, Orientation orientation) { +TQImage transform(const TQImage& img, Orientation orientation) { if (orientation != NOT_AVAILABLE && orientation != NORMAL) { return img.xForm(transformMatrix(orientation)); } else { @@ -123,9 +123,9 @@ int changeUsingTable( int value, const int table[] ) template< int operation( int, int ) > static -QImage changeImage( const QImage& image, int value ) +TQImage changeImage( const TQImage& image, int value ) { - QImage im = image; + TQImage im = image; im.detach(); if( im.numColors() == 0 ) /* truecolor */ { @@ -142,14 +142,14 @@ QImage changeImage( const QImage& image, int value ) y < im.height(); ++y ) { - QRgb* line = reinterpret_cast< QRgb* >( im.scanLine( y )); + TQRgb* line = reinterpret_cast< TQRgb* >( im.scanLine( y )); for( int x = 0; x < im.width(); ++x ) - line[ x ] = qRgba( changeUsingTable( qRed( line[ x ] ), table ), - changeUsingTable( qGreen( line[ x ] ), table ), - changeUsingTable( qBlue( line[ x ] ), table ), - changeUsingTable( qAlpha( line[ x ] ), table )); + line[ x ] = tqRgba( changeUsingTable( tqRed( line[ x ] ), table ), + changeUsingTable( tqGreen( line[ x ] ), table ), + changeUsingTable( tqBlue( line[ x ] ), table ), + changeUsingTable( tqAlpha( line[ x ] ), table )); } } else @@ -158,32 +158,32 @@ QImage changeImage( const QImage& image, int value ) y < im.height(); ++y ) { - QRgb* line = reinterpret_cast< QRgb* >( im.scanLine( y )); + TQRgb* line = reinterpret_cast< TQRgb* >( im.scanLine( y )); for( int x = 0; x < im.width(); ++x ) - line[ x ] = qRgb( changeUsingTable( qRed( line[ x ] ), table ), - changeUsingTable( qGreen( line[ x ] ), table ), - changeUsingTable( qBlue( line[ x ] ), table )); + line[ x ] = tqRgb( changeUsingTable( tqRed( line[ x ] ), table ), + changeUsingTable( tqGreen( line[ x ] ), table ), + changeUsingTable( tqBlue( line[ x ] ), table )); } } } else { - QRgb* colors = im.colorTable(); + TQRgb* colors = im.tqcolorTable(); for( int i = 0; i < im.numColors(); ++i ) - colors[ i ] = qRgb( operation( qRed( colors[ i ] ), value ), - operation( qGreen( colors[ i ] ), value ), - operation( qBlue( colors[ i ] ), value )); + colors[ i ] = tqRgb( operation( tqRed( colors[ i ] ), value ), + operation( tqGreen( colors[ i ] ), value ), + operation( tqBlue( colors[ i ] ), value )); } return im; } // brightness is multiplied by 100 in order to avoid floating point numbers -QImage changeBrightness( const QImage& image, int brightness ) +TQImage changeBrightness( const TQImage& image, int brightness ) { if( brightness == 0 ) // no change return image; @@ -192,7 +192,7 @@ QImage changeBrightness( const QImage& image, int brightness ) // contrast is multiplied by 100 in order to avoid floating point numbers -QImage changeContrast( const QImage& image, int contrast ) +TQImage changeContrast( const TQImage& image, int contrast ) { if( contrast == 100 ) // no change return image; @@ -200,7 +200,7 @@ QImage changeContrast( const QImage& image, int contrast ) } // gamma is multiplied by 100 in order to avoid floating point numbers -QImage changeGamma( const QImage& image, int gamma ) +TQImage changeGamma( const TQImage& image, int gamma ) { if( gamma == 100 ) // no change return image; |