Available in the LEADTOOLS Imaging toolkit.
GrayscaleExt example for C++ 5.0 and later
m_Lead1.GrayscaleExt(300, 590, 110);