[Jahshaka-cvs] jah/jahwidgets/src/qt3/widgets scribbler.cpp, 1.10, 1.11 scribbler.h, 1.6, 1.7
Status: Beta
Brought to you by:
jahshaka
From: John B. <ok_...@us...> - 2006-08-28 17:02:19
|
Update of /cvsroot/jahshaka/jah/jahwidgets/src/qt3/widgets In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv9461/jahwidgets/src/qt3/widgets Modified Files: scribbler.cpp scribbler.h Log Message: Can now specify border width. Index: scribbler.cpp =================================================================== RCS file: /cvsroot/jahshaka/jah/jahwidgets/src/qt3/widgets/scribbler.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- scribbler.cpp 28 Aug 2006 16:08:55 -0000 1.10 +++ scribbler.cpp 28 Aug 2006 17:02:08 -0000 1.11 @@ -273,7 +273,7 @@ return image; } -il::image_type_ptr scribbler::border( il::image_type_ptr image, int r, int g, int b, int a ) +il::image_type_ptr scribbler::border( il::image_type_ptr image, int lines, int r, int g, int b, int a ) { if ( image && image->height( ) > 4 ) { @@ -286,8 +286,6 @@ int pitch = image->pitch( ); int temp = 0; - const int lines = 2; - for ( int l = 0; l < lines; ++l ) { temp = width; @@ -297,14 +295,14 @@ } } - temp = height - 4; + temp = height - lines * 2; while( temp -- ) { - *dest ++ = b; *dest ++ = g; *dest ++ = r; *dest ++ = a; - *dest ++ = b; *dest ++ = g; *dest ++ = r; *dest ++ = a; - dest += pitch - lines * 8; - *dest ++ = b; *dest ++ = g; *dest ++ = r; *dest ++ = a; - *dest ++ = b; *dest ++ = g; *dest ++ = r; *dest ++ = a; + for ( int l = 0; l < lines; ++l ) { + *dest ++ = b; *dest ++ = g; *dest ++ = r; *dest ++ = a; + dest += pitch - 8; + *dest ++ = b; *dest ++ = g; *dest ++ = r; *dest ++ = a; + } } for ( int l = 0; l < lines; ++l ) Index: scribbler.h =================================================================== RCS file: /cvsroot/jahshaka/jah/jahwidgets/src/qt3/widgets/scribbler.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- scribbler.h 24 Aug 2006 10:42:13 -0000 1.6 +++ scribbler.h 28 Aug 2006 17:02:08 -0000 1.7 @@ -55,9 +55,9 @@ il::image_type_ptr fill_bg( il::image_type_ptr image ) { return fill( image, bg_.r, bg_.g, bg_.b, bg_.a ); } il::image_type_ptr fill_fg( il::image_type_ptr image ) { return fill( image, fg_.r, fg_.g, fg_.b, fg_.a ); } il::image_type_ptr scribble( il::image_type_ptr, int, int, int x, int y, const pl::wstring &, int = 0 ); - il::image_type_ptr border( il::image_type_ptr, int, int, int, int ); - il::image_type_ptr border_bg( il::image_type_ptr image ) { return border( image, bg_.r, bg_.g, bg_.b, bg_.a ); } - il::image_type_ptr border_fg( il::image_type_ptr image ) { return border( image, fg_.r, fg_.g, fg_.b, fg_.a ); } + il::image_type_ptr border( il::image_type_ptr, int width, int, int, int, int ); + il::image_type_ptr border_bg( il::image_type_ptr image, int width ) { return border( image, width, bg_.r, bg_.g, bg_.b, bg_.a ); } + il::image_type_ptr border_fg( il::image_type_ptr image, int width ) { return border( image, width, fg_.r, fg_.g, fg_.b, fg_.a ); } il::image_type_ptr resize( il::image_type_ptr, int, int, int = 1, int = 1 ); il::image_type_ptr waveform( il::image_type_ptr, MediaPtr media, int in, int out ); il::image_type_ptr composite( il::image_type_ptr, il::image_type_ptr, int, int ) const; |