Available in the LEADTOOLS Imaging toolkit.
SwapColors example for C++ 5.0 and later
m_Lead1.SwapColors(SWAP_RG);