Sorting Objects Using STL
Here’s an example of how using objects (hat-tip: Paul Wolfensberger)
Here’s an example of how using objects (hat-tip: Paul Wolfensberger)
Using boost::scoped_array When we want to dynamically allocate an array of objects for some purpose, the C++ programming language offers us the new and delete operators that are intended to replace the traditional malloc() and free() subroutines that are part of the standard library :
Assuming you have downloaded and installed Python, whichever latest version it is, using the IDLE editor is very simple. For a proverbial “Hello World!” example follow the instructions below:
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++’ »
Just some simple examples posted here as a means of easy lookup…
I have recently been working on a knotty problem involving control and image acquisition using the Flea®2 camera, using FlyCapture® SDK by Point Grey Research, Inc.
I recently needed to revisit this to create simple monochrome bitmaps representing the sets of nozzles turned off/on on a Xaar microarrayer printhead. Sample code here. Essential steps are outlined in the following code A simple dialog application example to download: Bitmaps.zip
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++’ »
Declaring and initializing multi-dimensional arrays in C++ can be done not just by way of traditional pointer arithmetic, but using the STL / Boost libraries as well. Here are some examples:
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’ »