Using Function Objects (Functors) in STL / C++

Generically, function objects (or functors) are class instances whose member function operator() has been defined. This member function allows the object to be used with the same syntax as a regular function call, and therefore its type can be used as template parameter when a generic function type is expected. So why not just use …

Continue reading ‘Using Function Objects (Functors) in STL / C++’ »

Creating Bitmap Files from Raw Pixel Data in C++

Creating the byte array This post describes a means of taking data in the form of raw pixels containing RGB values as well as the image height, width and the number of bits per pixel (24 in this case) and converting this into a bitmap (BMP) file. Example Visual Studio 2010 project is downloadable from …

Continue reading ‘Creating Bitmap Files from Raw Pixel Data in C++’ »

How to use the Boost Libraries in Visual Studio

In this guide we will use boost::format, a Boost library requiring no separate compilation. If you do not already have Boost installed, the first task is to download and extract the Boost zip file to a destination of your choice. Official releases of Boost may be obtained from here: http://www.boost.org/users/download/. Download and extract the zip …

Continue reading ‘How to use the Boost Libraries in Visual Studio’ »