[fpc-pascal] Implementing AggPas with PtcGraph

James Richters james at productionautomation.net
Thu Jun 22 18:47:40 CEST 2017


I squeezed a little more out of putimage by doing as little math as possible with a couple of variables to store j*ptcwidth and i+j*ptcwidth  I got my 1000x test loop down to 1.013 seconds.  Here is what it looks like at the moment, any ideas on how to optimize it further?

 

https://github.com/Zaaphod/ptcpas/compare/master...Zaaphod_Custom#diff-fb31461e009ff29fda5c35c5115978b4

 

var

  pixels:Pword;

  k: longint;

  i, j, y1, x1, deltaX, deltaX1, deltaY: smallint;

  JxW, I_JxW: Longword;

..

        XORPut: 

          Begin

            for j:=Y to Y1 do

              Begin

                JxW:=j*PTCWidth;

                inc(k,deltaX);

                for i:=X to X1 do

                  begin

                    I_JxW:=i+JxW;

                    pixels[I_JxW] := pixels[I_JxW] xor pt(bitmap)[k];

                    inc(k);

                  end;

                inc(k,deltaX1);

              End;

          End;

..

 

James

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20170622/1f634a00/attachment.html>


More information about the fpc-pascal mailing list