LBitmap::FreeKmeansOutput

Summary

Frees the data generated by the LBitmap::KMeansBitmapSegmentation function.

Syntax

#include "ltwrappr.h"

virtual L_INT LBitmap::FreeKmeansOutput(pOutCenters)

Parameters

L_COLORREF* pOutCenters

Pointer to the data generated by the LBitmap::KMeansBitmapSegmentation function.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

Use this function to free the data generated by the LBitmap::KMeansBitmapSegmentation function.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

L_INT LBitmap__FreeKmeansOutputExample() 
{ 
   L_INT nRet; 
   LBitmap LeadBitmap; 
 
   nRet =LeadBitmap.Load(MAKE_IMAGE_PATH(TEXT("Clean.tif")), 0, ORDER_BGRORGRAY); 
   if(nRet !=SUCCESS) 
      return nRet; 
 
   L_UINT nCluster = 4; 
   L_COLORREF OutCenter = (L_COLORREF) RGB(25,50,70); 
   L_COLORREF* pOutCenters = &OutCenter; 
   L_INT nOutCentersCount = -1; 
 
   nRet = LeadBitmap.KMeansBitmapSegmentation(nCluster, &pOutCenters, &nOutCentersCount, NULL, KMEANS_RANDOM); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   //free the pOutCenters data 
   LeadBitmap.FreeKmeansOutput(pOutCenters); 
 
   nRet = LeadBitmap.Save (MAKE_IMAGE_PATH(TEXT("Result.BMP")), FILE_BMP, 24, 0, NULL); 
   if(nRet !=SUCCESS) 
      return nRet; 
 
   pBITMAPHANDLE pBitmapHandle =  LeadBitmap.GetHandle(); 
 
   //free bitmap  
   if(pBitmapHandle->Flags.Allocated)   
      L_FreeBitmap(pBitmapHandle);   
 
   return SUCCESS; 
} 
Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.