Revision: 50613 http://brlcad.svn.sourceforge.net/brlcad/?rev=50613&view=rev Author: bob1961 Date: 2012-05-18 14:10:10 +0000 (Fri, 18 May 2012) Log Message: ----------- More simplification of to_png() and to_pix().
Modified Paths: -------------- brlcad/trunk/src/libtclcad/tclcad_obj.c Modified: brlcad/trunk/src/libtclcad/tclcad_obj.c =================================================================== --- brlcad/trunk/src/libtclcad/tclcad_obj.c 2012-05-18 13:57:16 UTC (rev 50612) +++ brlcad/trunk/src/libtclcad/tclcad_obj.c 2012-05-18 14:10:10 UTC (rev 50613) @@ -8683,7 +8683,7 @@ unsigned char *scanline; unsigned char *pixels; static int bytes_per_pixel = 3; - int i = 0, j = 0; + int i = 0; int width = 0; int height = 0; int make_ret = 0; @@ -8747,8 +8747,8 @@ glReadBuffer(GL_FRONT); glReadPixels(0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE, pixels); - for (i = 0, j = 0; i < height; ++i, ++j) { - scanline = (unsigned char *)(pixels + (j*bytes_per_line)); + for (i = 0; i < height; ++i) { + scanline = (unsigned char *)(pixels + (i*bytes_per_line)); if (fwrite((char *)scanline, bytes_per_line, 1, fp) != 1) { perror("fwrite"); @@ -8779,7 +8779,7 @@ unsigned char *pixels; static int bytes_per_pixel = 3; static int bits_per_channel = 8; /* bits per color channel */ - int i = 0, j = 0; + int i = 0; int width = 0; int height = 0; int make_ret = 0; @@ -8858,8 +8858,8 @@ glReadPixels(0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE, pixels); rows = (unsigned char **)bu_calloc(height, sizeof(unsigned char *), "rows"); - for (i = 0, j = 0; i < height; ++i, ++j) - rows[j] = (unsigned char *)(pixels + ((height-i-1)*bytes_per_line)); + for (i = 0; i < height; ++i) + rows[i] = (unsigned char *)(pixels + ((height-i-1)*bytes_per_line)); png_init_io(png_p, fp); png_set_filter(png_p, 0, PNG_FILTER_NONE); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ BRL-CAD Source Commits mailing list brlcad-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/brlcad-commits