]> git.saurik.com Git - wxWidgets.git/commitdiff
Changed stopat to stopafter in CountColours
authorGuillermo Rodriguez Garcia <guille@iies.es>
Thu, 16 Dec 1999 12:19:02 +0000 (12:19 +0000)
committerGuillermo Rodriguez Garcia <guille@iies.es>
Thu, 16 Dec 1999 12:19:02 +0000 (12:19 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4984 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/image.h
src/common/image.cpp

index 5b15d03af255ad24ef75e63674079cb6f7a4b66d..018d2932b5dc3ea624f946af1d8011a29d80ec61 100644 (file)
@@ -185,7 +185,7 @@ public:
   static void InitStandardHandlers();
 
   // GRG: Dic/99
-  unsigned long CountColours( unsigned long stopat = -1 );
+  unsigned long CountColours( unsigned long stopafter = -1 );
   unsigned long ComputeHistogram( wxHashTable &h );
 
 
index 4a7a6a4a1a6f052391cbcd0544c99cac8ffbf9ad..f2407e0978e21590e6d29b22b0cb86cd26472cc6 100644 (file)
@@ -2303,12 +2303,12 @@ IMPLEMENT_DYNAMIC_CLASS(wxImageModule, wxModule)
 
 // GRG, Dic/99
 // Counts and returns the number of different colours. Optionally stops
-// when it reaches 'stopat' different colours. This is useful, for example,
-// to see if the image can be saved as 8-bit (256 colour or less, in this
-// case it would be invoked as CountColours(257)). Default value for stopat
-// is -1 (don't care).
+// when it exceeds 'stopafter' different colours. This is useful, for
+// example, to see if the image can be saved as 8-bit (256 colour or
+// less, in this case it would be invoked as CountColours(256)). Default
+// value for stopafter is -1 (don't care).
 //
-unsigned long wxImage::CountColours( unsigned long stopat )
+unsigned long wxImage::CountColours( unsigned long stopafter )
 {
     wxHashTable h;
     wxNode *node;
@@ -2320,7 +2320,7 @@ unsigned long wxImage::CountColours( unsigned long stopat )
     size = GetWidth() * GetHeight();
     nentries = 0;
 
-    for (unsigned long j = 0; (j < size) && (nentries < stopat) ; j++)
+    for (unsigned long j = 0; (j < size) && (nentries <= stopafter) ; j++)
     {
         r = *(p++);
         g = *(p++);