diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-02-27 02:13:42 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-02-27 02:13:42 -0600 |
commit | 520c05ef06ce203ad32470730f68402bc7719157 (patch) | |
tree | 8d0bb18bbbecb4c837e232848905e5819db84b81 /examples/canvas/makeimg.cpp | |
parent | b82553bf90cb5311cfe8e673b07cf6cffc95fd3c (diff) | |
download | tqt3-520c05ef06ce203ad32470730f68402bc7719157.tar.gz tqt3-520c05ef06ce203ad32470730f68402bc7719157.zip |
Automated update from qt3
Diffstat (limited to 'examples/canvas/makeimg.cpp')
-rw-r--r-- | examples/canvas/makeimg.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
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) ); } } |