User Guide

DLL Component
// Create new array (assume we have declared 'length' – add 1 for size at front)
char** array = new char*[length+1];
// Set the size
*((int*)array) = length;
// Create the strings in the array
for( int i=1; i<length+1; i++ )
{
// Create new string (assume we have declared 'stringlen')
char* s = new char[stringlen+1];
// {initialise the string here}
// Don't forget to null terminate
s[stringlen] = 0;
// Add to the sting array
array[i] = s;
}
// Assign to correct entry in the output array
*((char***)&pOut[x]) = array;
Bitmaps
Bitmap data is also provided as an array, this time of BYTEs (unsigned chars). The array begins with 12 bytes of data descriptor information.
This is used to supply 3 int parameters: bitmap width, bitmap height and number of channels (bytes per pixel).
You can access these values as follows:
int width = *((int*)pIn[x]);
int height = *((int*)pIn[x]+1);
int channels = *((int*)pIn[x]+2);
The number of bytes of pixel data we will have is then the product of these values:
int bytes = width * height * channels;
You can get at the array of pixel data like this:
unsigned char* pData = (unsigned char*)pIn[x]+12;
The data will give us the value for each channel (0-255) for each pixel in the bitmap. The pixel data runs from top-left across to the right
before starting the next line.
EXAMPLE
Let's say we have 3 channels (Red, Green and Blue) and a bitmap that is 10 pixels wide and 4 pixels high. We will have 10 x 4 x 3 = 120
bytes of pixel data. pData[0] will give you the red component of the top-left pixel. pData[29] will give you the green component for the
rightmost pixel in the top row. pData[90] will give you the bottom-left pixel red component and pData[119] will give you the blue component of
the very last (bottom-right) pixel.
191 of 212