Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Does anyone know of a library (managed or native) that can perform a gaussian blur of a windows CE screenshot (low res) in 1 or 2 seconds?

I found a PC one in C# and it took around 10 seconds.

My objective is to blur out the screen and paint an in focus popup box in the middle of the screen, I have the necessary tools for the alpha blending and so forth, but finding any sort of image manipulation library is proving to be a challenge.
Posted

1 solution

The trick to speeding up gaussian blur is to take advantage of its separability. That is, you can do one pass in the x direction (along each single row) and one pass in the y direction (down each column). Much faster than using a square kernel. Look up wikipedia for "gaussian blur"; the first external link even includes some code. For your application, you can affort to truncate the kernel pretty aggressively too. (I'm guessing 7x7 or even 5x5 will give you an acceptable result.)
[edit] You can probably get even more speedup using scaled integer arithmetic rather than float. Remember that you don't need NASA's gold-plated hammer to whack a nail into a plank! A lump of rock can do that job.[/edit]


Peter

To respond to this answer, add a comment to it and/or modify your question. Vote, and accept if you like it.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900