C++ source code for image enhancement without 3rd party library