Revision: 76020
          http://sourceforge.net/p/brlcad/code/76020
Author:   starseeker
Date:     2020-06-04 15:04:47 +0000 (Thu, 04 Jun 2020)
Log Message:
-----------
Correct variables, restore wireframe capture.

Modified Paths:
--------------
    brlcad/branches/dm-fb-merge/src/libged/screengrab.c

Modified: brlcad/branches/dm-fb-merge/src/libged/screengrab.c
===================================================================
--- brlcad/branches/dm-fb-merge/src/libged/screengrab.c 2020-06-04 14:56:37 UTC 
(rev 76019)
+++ brlcad/branches/dm-fb-merge/src/libged/screengrab.c 2020-06-04 15:04:47 UTC 
(rev 76020)
@@ -58,8 +58,8 @@
 
     int i;
     int print_help = 0;
-    int width = 0;
-    int height = 0;
+    int scr_width = 0;
+    int scr_height = 0;
     int scr_xoff = 0;
     int scr_yoff = 0;
     int bytes_per_pixel = 0;
@@ -78,8 +78,8 @@
     BU_OPT(d[1], "F", "fb",             "",     NULL,             &grab_fb,    
      "screengrab framebuffer instead of scene display");
     BU_OPT(d[2], "X", "scr_xoff",       "#",    &bu_opt_int,      &scr_xoff,   
      "X offset");
     BU_OPT(d[3], "Y", "scr_yoff",       "#",    &bu_opt_int,      &scr_yoff,   
      "Y offset");
-    BU_OPT(d[4], "W", "scr_maxwidth",   "#",    &bu_opt_int,      &width,      
      "width of image to grab");
-    BU_OPT(d[5], "N", "scr_maxheight",  "#",    &bu_opt_int,      &height,     
      "height of image to grab");
+    BU_OPT(d[4], "W", "scr_maxwidth",   "#",    &bu_opt_int,      &scr_width,  
      "width of image to grab");
+    BU_OPT(d[5], "N", "scr_maxheight",  "#",    &bu_opt_int,      &scr_height, 
      "height of image to grab");
     BU_OPT(d[6], "",  "format",         "fmt",  &image_mime,      &type,       
      "output image file format");
     BU_OPT_NULL(d[7]);
 
@@ -129,12 +129,12 @@
        return GED_HELP;
     }
 
-    bytes_per_pixel = 3;
-    bytes_per_line = width * bytes_per_pixel;
-
     /* create image file */
     if (!grab_fb) {
 
+       bytes_per_pixel = 3;
+       bytes_per_line = dm_get_width(dmp) * bytes_per_pixel;
+
        dm_get_display_image(dmp, &idata);
        if (!idata) {
            bu_vls_printf(gedp->ged_result_str, "%s: display manager did not 
return image data.", argv[1]);
@@ -163,10 +163,10 @@
     }
 
     /* Crop the image, if the settings indicate we need to */
-    if (scr_xoff || scr_yoff || width || height) {
-        width = (width) ? width : (int)bif->width - scr_xoff;
-        height = (height) ? height : (int)bif->height - scr_yoff;
-        icv_rect(bif, scr_xoff, scr_yoff, width, height);
+    if (scr_xoff || scr_yoff || scr_width || scr_height) {
+        scr_width = (scr_width) ? scr_width : (int)bif->width - scr_xoff;
+        scr_height = (scr_height) ? scr_height : (int)bif->height - scr_yoff;
+        icv_rect(bif, scr_xoff, scr_yoff, scr_width, scr_height);
     }
 
     icv_write(bif, argv[0], type);

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to