From bf7f88413be3831a9372d323d02fc0335b9f9188 Mon Sep 17 00:00:00 2001 From: tpearson Date: Thu, 26 May 2011 21:04:57 +0000 Subject: 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 --- src/imageutils/imageutils.cpp | 50 +++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'src/imageutils/imageutils.cpp') 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 -// Qt -#include -#include +// TQt +#include +#include // KDE #include @@ -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; -- cgit v1.2.1