// 3_11.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <cv.h>
#include <cvcam.h>
#include <cxcore.h>
#include <highgui.h>
#pragma comment(lib,"cv.lib")
#pragma comment(lib,"cvcam.lib")
#pragma comment(lib,"cxcore.lib")
#pragma comment(lib,"highgui.lib")
void Saturate_SV(IplImage *pSourceImage)
{
assert(pSourceImage != NULL);
for (int nHeight= 0; nHeight < pSourceImage->height; nHeight++ )
{
uchar *ptr = (uchar*)(pSourceImage->imageData + nHeight *pSourceImage->widthStep);
for (int nRow = 0; nRow < pSourceImage->width; nRow++)
{
ptr[nRow*3 +0] = 155;
ptr[nRow*3 +1] = 155;
}
}
}
int main(int argc, char* argv[])
{
IplImage *pSourceImage = cvLoadImage(argv[1]);
assert(pSourceImage != NULL);
IplImage *pDestImage = cvCloneImage(pSourceImage);
assert(pDestImage);
Saturate_SV(pDestImage);
cvNamedWindow("Show_Src");
cvNamedWindow("Show_Dst");
cvShowImage("Show_Src",pSourceImage);
cvShowImage("Show_Dst",pDestImage);
cvWaitKey();
cvReleaseImage(&pSourceImage);
cvReleaseImage(&pDestImage);
cvDestroyAllWindows();
return 0;
}