[Lazarus] Slow pointer assignments

2013-04-18 Thread Leonardo M . Ramé
Hi, this routine copies pixel data from a buffer onto a TBitmap.RawImage.Data structure. var PixelPtr: PByte; PixelRowPtr: PByte; begin PixelRowPtr := Fbmp.RawImage.Data; for Y := 0 to Self.Height - 1 do begin PixelPtr := PixelRowPtr; for X := 0 to Self.Width - 1 do begin

Re: [Lazarus] Slow pointer assignments

2013-04-18 Thread leledumbo
.nabble.com/Lazarus-Slow-pointer-assignments-tp4030759p4030762.html Sent from the Free Pascal - Lazarus mailing list archive at Nabble.com. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo

Re: [Lazarus] Slow pointer assignments

2013-04-18 Thread Leonardo M . Ramé
On 2013-04-18 08:48:11 -0700, leledumbo wrote: Assign all the RGBA value in one go, that would reduce the inner loop by 4 times. i.e.: var PixelPtr: PLongWord; PixelRowPtr: PByte; begin PixelRowPtr := Fbmp.RawImage.Data; for Y := 0 to Self.Height - 1 do begin

Re: [Lazarus] Slow pointer assignments

2013-04-18 Thread Leonardo M . Ramé
On 2013-04-18 12:49:07 -0300, Leonardo M. Ramé wrote: On 2013-04-18 08:48:11 -0700, leledumbo wrote: Assign all the RGBA value in one go, that would reduce the inner loop by 4 times. i.e.: var PixelPtr: PLongWord; PixelRowPtr: PByte; begin PixelRowPtr :=

Re: [Lazarus] Slow pointer assignments

2013-04-18 Thread Ludo Brands
On 04/18/2013 07:53 PM, Leonardo M. Ramé wrote: On 2013-04-18 12:49:07 -0300, Leonardo M. Ramé wrote: On 2013-04-18 08:48:11 -0700, leledumbo wrote: Assign all the RGBA value in one go, that would reduce the inner loop by 4 times. i.e.: var PixelPtr: PLongWord; PixelRowPtr: PByte;

Re: [Lazarus] Slow pointer assignments

2013-04-18 Thread Leonardo M . Ramé
On 2013-04-18 20:37:06 +0200, Ludo Brands wrote: On 04/18/2013 07:53 PM, Leonardo M. Ramé wrote: On 2013-04-18 12:49:07 -0300, Leonardo M. Ramé wrote: On 2013-04-18 08:48:11 -0700, leledumbo wrote: Assign all the RGBA value in one go, that would reduce the inner loop by 4 times. i.e.: