[Gambas-user] gb3: recent changes to PaintImage and DrawImage
Kevin Fishburne
kevinfishburne at ...1887...
Sun May 1 03:42:59 CEST 2011
On 04/30/2011 09:19 PM, Kevin Fishburne wrote:
> On 04/30/2011 09:05 PM, Benoît Minisini wrote:
>>
>> I fixed Image.PaintImage() in gb.image.imlib, so your code should work again.
>>
>> Now let's try to fix gb.image...
>
> Compiling now on a quad-core 3.5 GHz CPU overclocked to 4.1 GHz.
> Muwahahaaaaa! Will report results shortly.
Using revision 3821 things are back to normal (18 FPS and all's well
graphically). Thanks...your coding moves at the speed of lightning it seems.
I could be wrong about this, but it looks like removing those two
parameters actually increased the frame rate to over 30 FPS. Of course
the FPS increase could have been the result of an error in the recent
revision. If it wasn't, I wonder if the target dimension parameters,
even if the image is not being scaled, slows the image blit. If that's
the case, then embedding a Resize method in PaintImage, DrawImage and
DrawAlpha may be the most efficient way to go. You can just manually add
Resize when you need scaling or leave it out for a pixel-to-pixel
transfer. Or the methods could be written to ignore the target dimension
parameters if the source dimensions are the same, which would create the
same efficiency as the manual use of Resize but transparent to the user.
Something like:
If TargetWidth = SourceWidth And TargetHeight = SourceHeight Then
Do_Not_Use_Scaling_Blit_Algorithm
Else
Use_Scaling_Blit_Algorithm
EndIf
But in C. :) Some day I'm going to learn C, dammit. Everything I know
tells me so.
--
Kevin Fishburne
Eight Virtues
www: http://sales.eightvirtues.com
e-mail: sales at ...1887...
phone: (770) 853-6271
More information about the User
mailing list