LBitmap::Add
#include "ltwrappr.h"
virtual L_INT LBitmap::Add (pBitmapList, uFlag=BC_ADD)
LBitmapList pBitmapList; |
/* pointer to an LBitmapList object */ |
L_UINT uFlag; |
/* operation flag */ |
Adds or averages the bitmaps in a list and the class object's bitmap. The class object's bitmap is updated with the resulting bitmap.
Parameter |
Description | |
pBitmapList |
Pointer to an LBitmapList object that contains a list of bitmaps. | |
uFlag |
Flag that indicates the operation to perform. Possible values are: | |
|
Value |
Meaning |
|
BC_AVG |
[0x0001] Average the bitmaps in the specified list. |
|
BC_ADD |
[0x0002] Add the bitmaps in the specified list. |
Returns
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Comments
This operation can be used to add several images of the same view to improve the lightness or brightness of the image. It can also eliminate the random noise contained in these images by doing an average of all bitmaps.
This function performs operations between data byte-by-byte. An image can be any color resolution.
Bitmap object is assumed to be empty. If Bitmap contains a bitmap, you should free it prior to calling this function. LBitmap::Add will allocate and store the resulting bitmap in Bitmap object. The image resulting from this operation is internally copied from the first image in the list, before performing the adding operation.
The operations are performed based on the smallest width and height of the input images.
To update a status bar or detect a user interrupt during execution of this function, refer to LBase::EnableStatusCallback.
This function supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits.
Required DLLs and Libraries
LTDIS For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application. |
See Also
Example
L_VOID TestFunction(LBitmap & Bitmap, L_TCHAR * szFile)
{
LBitmapList BitmapList;
LBitmap TempBitmap;
Bitmap.Load(szFile);
BitmapList.Create();
for (L_INT i = 1; i < 4; i++)
{
TempBitmap.Copy(Bitmap);
TempBitmap.Rotate(7500 * i, ROTATE_RESAMPLE, RGB(255, 0, 0));
BitmapList.InsertItem(&TempBitmap);
}
Bitmap.Add(&BitmapList, BC_AVG);
BitmapList.Destroy();
}