ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Performance drop from v.4.0.2 to later versions
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

nwscomps

185 Posts

Posted - Aug 10 2013 :  10:24:33  Show Profile  Reply
Hello I have noticed a performance drop either related to updating layers or related to updating the picture to screen in the imageenview component, since TImageEnView and TImageEnMView has started to expose the Touch property. Are you aware of any performance drop this may have caused? I have found this problem by compiling our TImageEnPAintEngine component with both versions of imageen with identical conditions. The drop is not detectable when painting on the backround layer but it is marked when painting on any of the other layers.

Francesco Savastano
Nwscomps.com
Add-ons for the ImageEn Library

fab

1310 Posts

Posted - Aug 10 2013 :  14:55:18  Show Profile  Reply
Hello,
have you noticed the the performance drop using TImageEnPaintEngine or even with TImageEnView/TImageEnMView alone? In this last case, please provide some code to replicate the performance drop.
Go to Top of Page

nwscomps

185 Posts

Posted - Aug 11 2013 :  14:30:47  Show Profile  Reply
Well I can only offer a comparison using the same code of tImageEnPaintEngine and compiling it with the two different versions of imageEn for now. What is obvious to me is that some imageen function the paint engine is calling extensively before worked faster and after imageEn has been upgraded works quite slower.
One of my guess is that there may be some overhead with the updaterect method in imageEn. I will try to study this issue more and report to you.

Francesco Savastano
Nwscomps.com
Add-ons for the ImageEn Library
Go to Top of Page

nwscomps

185 Posts

Posted - Aug 17 2013 :  14:10:08  Show Profile  Reply
I think I found one possible cause of the slow-down when working with layers. You have changed the following low level access function

from this (which was faster):
function TIEBitmap.GetPixels_ie8(x, y: integer): byte;
begin
result := pbytearray(Scanline[y])^[x];
end;

to this one (slower)
function TIEBitmap.GetPixels_ie8(x, y: integer): byte;
begin
result := pbyte(GetSegment(y, x, 1))^;
end;

Can you confirm this could cause big speed difference when calling this function extensively (for each pixel in a alpha channel)?

Francesco Savastano
Nwscomps.com
Add-ons for the ImageEn Library
Go to Top of Page

fab

1310 Posts

Posted - Sep 06 2013 :  04:26:07  Show Profile  Reply
Hi Francesco,
maybe GetPixels_ie8 is a bit slow now. Anyway it should not be called to loop among image pixels.
Do you read Pixels_ie8[] property in your code?
Go to Top of Page

nwscomps

185 Posts

Posted - Sep 06 2013 :  12:39:55  Show Profile  Reply
Hi Fabrizio, yes I used the pixels_ie8 property to read the alpha channel in a loop, it was very handy and enough fast before. I need to replace it with scanline access or array of scanlines now..
let me know of any other workarounds...

Francesco Savastano
Nwscomps.com
Add-ons for the ImageEn Library
Go to Top of Page

fab

1310 Posts

Posted - Sep 16 2013 :  00:06:29  Show Profile  Reply
Yes, the fastest way is the loop with scanline:

var px: pbyte;
...
for row := 0 to ImageEnView.IEBitmap.Height - 1 do
begin
  px := ImageEnView.IEBitmap.Scanline[row];
  for col := 0 to ImageEnView.IEBitmap.Width - 1 do
  begin
     ...replace ImageEnView.IEBitmap.Pixels_ie8g[] with "px^"...
     inc(px);
  end;
end;
Go to Top of Page

nwscomps

185 Posts

Posted - Dec 04 2013 :  13:00:48  Show Profile  Reply
Just to mention that in our last minor update 4.0.3 of Imageen Paint Engine we have fixed this. Anyone interested can try a fast, flexible and powerful paint engine, very easy to use and setup, from our website:

www.nwscomps.com


Francesco Savastano
Nwscomps.com
Add-ons for the ImageEn Library
Go to Top of Page

xequte

38616 Posts

Posted - Dec 04 2013 :  15:48:36  Show Profile  Reply
Nice one, Francesco. I tried out your demo and it looks good.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

nwscomps

185 Posts

Posted - Dec 05 2013 :  10:41:24  Show Profile  Reply
Thanks, Nigel..

Francesco Savastano
Nwscomps.com
Add-ons for the ImageEn Library
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: