[master] 8a9e25c - Optimization for pixel loop.

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[master] 8a9e25c - Optimization for pixel loop. "Greg Ercolano" 12:32 Mar 23 top right image
 
commit 8a9e25cdac38f72cf9d561b8e4db0831b5ba7817
Author:     Greg Ercolano <erco@seriss.com>
AuthorDate: Tue Mar 23 12:18:41 2021 -0700
Commit:     Greg Ercolano <erco@seriss.com>
CommitDate: Tue Mar 23 12:18:41 2021 -0700

    Optimization for pixel loop.
    
    As per erco's comments on fltk.coredev, Mar 21 2021
    in thread Subject: Re: 1.4 build failing on OSX for me

 src/drivers/PostScript/Fl_PostScript_image.cxx | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git src/drivers/PostScript/Fl_PostScript_image.cxx src/drivers/PostScript/Fl_PostScript_image.cxx
index 297f1f7..38b129e 100644
--- src/drivers/PostScript/Fl_PostScript_image.cxx
+++ src/drivers/PostScript/Fl_PostScript_image.cxx
@@ -40,10 +40,11 @@ static void draw_image_cb(void *data, int x, int y, int w, uchar *buf) {
 
   cb_data = (struct callback_data*)data;
   int last = x+w;
+  const size_t aD = abs(cb_data->D);
   curdata = cb_data->data + x*cb_data->D + y*cb_data->LD;
   for (; x<last; x++) {
-    memcpy(buf, curdata, abs(cb_data->D));
-    buf += abs(cb_data->D);
+    memcpy(buf, curdata, aD);
+    buf += aD;
     curdata += cb_data->D;
   }
 }
Direct Link to Message ]
 
bottom left image   bottom right image
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2022 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.