www.pudn.com > spline_c++.rar > low.cpp
#include "low.h" #include "stdafx.h" #include "DIBAPI.h" #include#include #include using namespace std; // 常数π #define PI 3.1415926535 BOOL WINAPI LOWPASS(LPSTR lpDIBBits, LONG lWidth, LONG lHeight) { // 指向源图像的指针 unsigned char* lpSrc; // 中间变量 double dTemp; // 循环变量 LONG i; LONG j; int wp; int hp; // 图像每行的字节数 LONG lLineBytes; // 计算图像每行的字节数 lLineBytes = WIDTHBYTES(lWidth * 8); // 行 for(i = 0; i < lWidth; i++) { // 列 for(j = 0; j < lHeight; j++) { // 指向DIB第i行,第j个象素的指针 lpSrc = (unsigned char*)lpDIBBits + lLineBytes * (lHeight - 1 - i) + j; // 判断滤过条件 // if((pow(i-(lWidth/2),2)+pow(j-(lHeight/2),2))<49) // *lpSrc=0; } } return TRUE; }