UserFilter example for C++ 5.0 and later
ILEADRasterProcess* m_pRasterProc= NULL;
CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess, (void**)&m_pRasterProc);
m_pRasterProc->UserFilterWidth = 3;
m_pRasterProc->UserFilterHeight = 3;
m_pRasterProc->UserFilterXCenter = 1;
m_pRasterProc->UserFilterYCenter = 1;
m_pRasterProc->UserFilterDivisor = 1;
m_pRasterProc->UserFilterOffset = 0;
m_pRasterProc->UserFilterFlags = UD_SUM;
for (int i = 0; i<m_pRasterProc->UserFilterWidth;++i)
{
for (int j = 0; j< m_pRasterProc->UserFilterHeight;++j)
{
if (j == 1 || i == 1)
{
if (j == 1 && i == 1)
{
m_pRasterProc->PutUserFilterData(i, j,5);
}
else
{
m_pRasterProc->PutUserFilterData(i, j, -1);
}
}
else
{
m_pRasterProc->PutUserFilterData(i, j , 0);
}
}
}
m_pRasterProc->UserFilter(m_LeadRasterView.GetRaster());
m_pRasterProc->Release();