[Gambas-user] gb3: recent changes to PaintImage and DrawImage

Benoît Minisini gambas at ...1...
Sun May 1 03:55:51 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.

As you use gb.image.imlib, you are directly using the imlib painting function, 
that takes all the arguments as is and does its stuff.

I would be surprised if that function didn't do the check.

Before learning C, look at OpenGL to see how you can have a fast rotate and 
blit function. (But for DrawAlpha, I don't know if it possible to do it with 
OpenGL, I have no idea.)

Regards,

-- 
Benoît Minisini




More information about the User mailing list