SetMinMaxBits Example for C++ 5.0 and later
ILEADRasterProcess *pRasterProcess;
CoCreateInstance(CLSID_LEADRasterProcess,
NULL,
CLSCTX_ALL,
IID_ILEADRasterProcess,
(void**)&pRasterProcess);
// set the grayscale LUT
if((m_LEADRasterView1.GetRaster().GetIsGrayscale() != GRAY_NO) && (m_LEADRasterView1.GetRaster().GetBitmapBits() > 8))
{
m_LEADRasterView1.GetRaster().GetMinMaxBits();
m_LEADRasterView1.GetRaster().SetMinMaxBits(m_LEADRasterView1.GetRaster().GetMinBit(), m_LEADRasterView1.GetRaster().GetMaxBit());
m_LEADRasterView1.GetRaster().GetMinMaxVal();
float window;
float center;
window = (float)(m_LEADRasterView1.GetRaster().GetMaxVal() - m_LEADRasterView1.GetRaster().GetMinVal());
center = window / 2.0f;
pRasterProcess->ApplyLinearVOILUT(m_LEADRasterView1.GetRaster(), window, center, (VOILUTConstants)0);
}
pRasterProcess->Release();