Migrating Stackblur fuzzy algorithms to SDL

Source: Internet
Author: User

Stackblur is the Android standard fuzzy algorithm, which also caused a wave of Mao glass. IOS7 uses this algorithm (which is suspected of copying Android because Android1.5 added this function to the library). The algorithm is highly efficient, which is why it can run smoothly on mobile devices. But it is only the standard library function on Andorid, and the ported version only appears on Java. This article brings up a stackblur algorithm that is ported on SDL. The operation effect is basically like.

  

At one glance, the effect of glass is directly related to radius. Radius at 5 o'clock, the effect is similar to the dynamic blur, at 10 o'clock, there will be a bit of mosaic feeling, at 35 o'clock, is the IOS7 glass effect.

As mentioned earlier, the algorithm is highly efficient. According to the test (native CPU E3 1230v2, video card HD6770), at radius>0, the frame rate is stable at around 140fps and the image with radius changes is similar, but the amplitude is very small, did not fall below 120fps.

  

SDL Partial porting is also relatively easy, since SDL's surface objects can be read and written directly as a two-dimensional array in an ARGB8888 format via an int pointer, so it is particularly handy, and some code can even be copy-paste directly. As for the basic algorithm principle of stackblur, here is not much to say, interested friends can go to GitHub to search this item. This concludes with a Demo:FastBlurDemo.zip of the post-transplant code.

Migrating Stackblur fuzzy algorithms to SDL

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.