Code snippet for colorspace converting

How to convert colorspace and save converted image into file. Here ad->fileList[ad->curIndex] is some char string with path to file. Privilege http://tizen.org/privilege/mediastorage should be added in manifest