src/gui/image/qpnghandler.cpp
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
--- a/src/gui/image/qpnghandler.cpp	Tue Jan 26 12:42:25 2010 +0200
+++ b/src/gui/image/qpnghandler.cpp	Tue Feb 02 00:43:10 2010 +0200
@@ -171,7 +171,7 @@
                 if (image.isNull())
                     return;
             }
-            image.setNumColors(2);
+            image.setColorCount(2);
             image.setColor(1, qRgb(0,0,0));
             image.setColor(0, qRgb(255,255,255));
         } else if (bit_depth == 16 && png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) {
@@ -199,7 +199,7 @@
                 if (image.isNull())
                     return;
             }
-            image.setNumColors(ncols);
+            image.setColorCount(ncols);
             for (int i=0; i<ncols; i++) {
                 int c = i*255/(ncols-1);
                 image.setColor(i, qRgba(c,c,c,0xff));
@@ -230,7 +230,7 @@
             if (image.isNull())
                 return;
         }
-        image.setNumColors(info_ptr->num_palette);
+        image.setColorCount(info_ptr->num_palette);
         int i = 0;
         if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) {
             while (i < info_ptr->num_trans) {
@@ -508,7 +508,7 @@
     // sanity check palette entries
     if (color_type == PNG_COLOR_TYPE_PALETTE
         && outImage->format() == QImage::Format_Indexed8) {
-        int color_table_size = outImage->numColors();
+        int color_table_size = outImage->colorCount();
         for (int y=0; y<(int)height; ++y) {
             uchar *p = outImage->scanLine(y);
             uchar *end = p + width;
@@ -762,9 +762,9 @@
 
     png_colorp palette = 0;
     png_bytep copy_trans = 0;
-    if (image.numColors()) {
+    if (image.colorCount()) {
         // Paletted
-        int num_palette = image.numColors();
+        int num_palette = image.colorCount();
         palette = new png_color[num_palette];
         png_set_PLTE(png_ptr, info_ptr, palette, num_palette);
         int* trans = new int[num_palette];