C ++ achieves water ripple, flame and plasma Effect

Source: Internet
Author: User

Click here to view the original article

Code project caught fire!

The entire project has three categories, which allow you to add some cool effects to the image.

I put all these files in my code compressed package, and made a small project to make it easier for some people to use, but I did not provide their documentation.

After you click the "animate" button on the demo program, move your mouse over the image, click, and set other options. Slide strips are used to change the transparency of plasma effect and flame effect. To make the settings take effect, you need to release the mouse.

Normally, you will see that these effects are all real-time, and I try to convert the code into an object-oriented class design. I used them as vis plug-ins in an audio application.

I used a cdibsectionlite class created by Chris Maunder, so I need to do some work to render the image. These effects are all 32-bit images.

Cwaterroutine-rendering water Ripple Effect
Cfireroutine-rendering flame effect
Cplasmaroutine-rendering plasma Effect

After reading the code for these effects, you will notice that these effects are implemented using a separate filter. If you have never seen the ripple code, you will be surprised, because such a simple code can achieve such a great effect. The flame and plasma effects are the same. Try to change some of the data members. You can do a lot of other effects, not just demonstrate the effects in the program.

The animation effect is only implemented by a simple windows timer. One thing to note is that I render these effects on other effects.

You can use this code at will, but if you use it in other more interesting places, or expand, or want to complain about the lack of documentation, you can leave me an email, or you just want to know me.

Related Article

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.