Upload

Loading icon Loading...

This video is unavailable.

x64 Assembly and C++ Tutorial 23: C++ Adjust Brightness

Sign in to YouTube

Sign in with your Google Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to like What's a Creel?'s video.

Sign in to YouTube

Sign in with your Google Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to dislike What's a Creel?'s video.

Sign in to YouTube

Sign in with your Google Account (YouTube, Google+, Gmail, Orkut, Picasa, or Chrome) to add What's a Creel?'s video to your playlist.

Uploaded on Oct 9, 2011

We'll be coding the C++ version of our Adjust Brightness algorithm. We will lock the pointers to the bitmap pixels, adjust the brightness, unlock them and display. You could adjust the brightness with GetPixel and SetPixel but it would be impossibly slow.We'd be talking minutes I suspect.

Locking and Unlocking managed memory is the most important aspect of this tutorial. If memory is not locked, Windows might reallocate the pointer mid-way through our algorithm. This would be a disaster.

It's important to note that although we're using unmanaged memory here, we're still using CLR (Common Language Runtime). CLR does not optimise very well so even if we set it to Release mode, there's only a tiny speed up (perhaps 10%).

I've written the algorithm in pure C++, without CLR, it is around twice as fast. This is obviously a great improvement but we loose all the niceties we gained from using CLR.

  • Category

  • License

    Standard YouTube License

Loading icon Loading...

Loading icon Loading...

Loading icon Loading...

The interactive transcript could not be loaded.

Loading icon Loading...

Loading icon Loading...

Ratings have been disabled for this video.
Rating is available when the video has been rented.
This feature is not available right now. Please try again later.

Loading icon Loading...

Advertisement
Loading...
Working...
to add this to Watch Later

Add to