From 520c05ef06ce203ad32470730f68402bc7719157 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Mon, 27 Feb 2012 02:13:42 -0600 Subject: Automated update from qt3 --- examples/canvas/makeimg.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'examples/canvas/makeimg.cpp') diff --git a/examples/canvas/makeimg.cpp b/examples/canvas/makeimg.cpp index bc1da57dd..acb90dbde 100644 --- a/examples/canvas/makeimg.cpp +++ b/examples/canvas/makeimg.cpp @@ -13,19 +13,19 @@ static inline int blendComponent( int v, int av, int s, int as ) static inline TQRgb blendShade( TQRgb v, TQRgb s ) { //pick a number: shadow is 1/3 of object - int as = qAlpha(s)/3; - int av = qAlpha(v); + int as = tqAlpha(s)/3; + int av = tqAlpha(v); if ( as == 0 || av == 255 ) return v; int a = as + av -(as*av)/255; - int r = blendComponent( qRed(v),av, qRed(s), as)/a; - int g = blendComponent( qGreen(v),av, qGreen(s), as)/a; - int b = blendComponent( qBlue(v),av, qBlue(s), as)/a; + int r = blendComponent( tqRed(v),av, tqRed(s), as)/a; + int g = blendComponent( tqGreen(v),av, tqGreen(s), as)/a; + int b = blendComponent( tqBlue(v),av, tqBlue(s), as)/a; - return qRgba(r,g,b,a); + return tqRgba(r,g,b,a); } int main( int*, char**) @@ -44,9 +44,9 @@ int main( int*, char**) uint *line = (uint*)img->scanLine( y ); for ( int x = 0; x < w; x++ ) { uint pixel = line[x]; - int r = qRed(pixel); - int g = qGreen(pixel); - int b = qBlue(pixel); + int r = tqRed(pixel); + int g = tqGreen(pixel); + int b = tqBlue(pixel); int min = TQMIN( r, TQMIN( g, b ) ); int max = TQMAX( r, TQMAX( g, b ) ); r -= min; @@ -59,7 +59,7 @@ int main( int*, char**) } int a = 255-min; a -= (max-min)/3; //hack more transparency for colors. - line[x] = qRgba( r, g, b, a ); + line[x] = tqRgba( r, g, b, a ); } } #endif @@ -77,13 +77,13 @@ int main( int*, char**) for ( int x = 0; x < w; x++ ) { TQRgb shader = img->pixel( x, y ); - int as = qAlpha(shader)/3; + int as = tqAlpha(shader)/3; - int r = (qRed(shader)*(255-as))/255; - int g = (qGreen(shader)*(255-as))/255; - int b = (qBlue(shader)*(255-as))/255; + int r = (tqRed(shader)*(255-as))/255; + int g = (tqGreen(shader)*(255-as))/255; + int b = (tqBlue(shader)*(255-as))/255; - img2->setPixel( x, y, qRgba(r,g,b,as) ); + img2->setPixel( x, y, tqRgba(r,g,b,as) ); } } -- cgit v1.2.1