资源简介
中值滤波算法VC实现(代码),加了详细注释,而且保证程序能够运行通过,效果与Maltab实现相差无几

代码片段和文件信息
// dibapi.cpp
//
// Source file for Device-Independent Bitmap (DIB) API. Provides
// the following functions:
//
// PaintDIB() - Painting routine for a DIB
// CreateDIBPalette() - Creates a palette from a DIB
// FindDIBBits() - Returns a pointer to the DIB bits
// DIBWidth() - Gets the width of the DIB
// DIBHeight() - Gets the height of the DIB
// PaletteSize() - Gets the size required to store the DIB‘s palette
// DIBNumColors() - Calculates the number of colors
// in the DIB‘s color table
// CopyHandle() - Makes a copy of the given global memory block
//
// This is a part of the Microsoft Foundation Classes C++ library.
// Copyright (C) 1992-1997 Microsoft Corporation
// All rights reserved.
//
// This source code is only intended as a supplement to the
// Microsoft Foundation Classes Reference and related
// electronic documentation provided with the library.
// See these sources for detailed information regarding the
// Microsoft Foundation Classes product.
#include “stdafx.h“
#include “dibapi.h“
#include
#include
#include
#define DIB_HEADER_MARKER ((WORD) (‘M‘ << 8) | ‘B‘)
#ifdef _MAC
#define SWAPWORD(x) MAKEWORD(HIBYTE(x) LOBYTE(x))
#define SWAPLONG(x) MAKELONG(SWAPWORD(HIWORD(x)) SWAPWORD(LOWORD(x)))
void ByteSwapHeader(BITMAPFILEHEADER* bmiHeader);
void ByteSwapInfo(LPSTR lpHeader BOOL fWin30Header);
#endif
/*************************************************************************
*
* PaintDIB()
*
* Parameters:
*
* HDC hDC - DC to do output to
*
* LPRECT lpDCRect - rectangle on DC to do output to
*
* HDIB hDIB - handle to global memory with a DIB spec
* in it followed by the DIB bits
*
* LPRECT lpDIBRect - rectangle of DIB to output into lpDCRect
*
* CPalette* pPal - pointer to CPalette containing DIB‘s palette
*
* Return Value:
*
* BOOL - TRUE if DIB was drawn FALSE otherwise
*
* Description:
* Painting routine for a DIB. Calls StretchDIBits() or
* SetDIBitsToDevice() to paint the DIB. The DIB is
* output to the specified DC at the coordinates given
* in lpDCRect. The area of the DIB to be output is
* given by lpDIBRect.
*
************************************************************************/
BOOL WINAPI PaintDIB(HDC hDC
LPRECT lpDCRect
HDIB hDIB
LPRECT lpDIBRect
CPalette* pPal)
{
LPSTR lpDIBHdr; // Pointer to BITMAPINFOHEADER
LPSTR lpDIBBits; // Pointer to DIB bits
BOOL bSuccess=FALSE; // Success/fail flag
HPALETTE hPal=NULL; // Our DIB‘s palette
HPALETTE hOldPal=NULL; // Previous palette
/* Check for valid DIB handle */
if (hDIB == NULL)
return FALSE;
/* Lock down the DIB and get a pointer to the beginning of the bit
* buffer
*/
l
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
..A.SH. 12288 2006-01-01 21:01 fiterVC051002116\中值滤波051002116\中值滤波\测试图片\Thumbs.db
文件 66614 2001-01-16 23:55 fiterVC051002116\中值滤波051002116\中值滤波\测试图片\原始lena图像(含椒盐噪声).bmp
文件 18972 2011-04-23 15:49 fiterVC051002116\中值滤波051002116\中值滤波\源代码\Debug\dibapi.obj
文件 11650 2011-04-23 15:49 fiterVC051002116\中值滤波051002116\中值滤波\源代码\Debug\dibapi.sbr
文件 20237 2011-04-25 15:39 fiterVC051002116\中值滤波051002116\中值滤波\源代码\Debug\MainFrm.obj
文件 3668 2011-04-25 15:39 fiterVC051002116\中值滤波051002116\中值滤波\源代码\Debug\MainFrm.sbr
文件 6034 2011-04-25 09:14 fiterVC051002116\中值滤波051002116\中值滤波\源代码\Debug\mydib.obj
文件 1897 2011-04-25 09:14 fiterVC051002116\中值滤波051002116\中值滤波\源代码\Debug\mydib.sbr
文件 23270 2011-04-23 15:49 fiterVC051002116\中值滤波051002116\中值滤波\源代码\Debug\MyDIP.obj
文件 6885168 2011-04-23 15:49 fiterVC051002116\中值滤波051002116\中值滤波\源代码\Debug\MyDIP.pch
文件 459776 2011-04-25 15:39 fiterVC051002116\中值滤波051002116\中值滤波\源代码\Debug\MyDIP.pdb
文件 9336 2011-04-25 09:16 fiterVC051002116\中值滤波051002116\中值滤波\源代码\Debug\MyDIP.res
文件 6746 2011-04-23 15:49 fiterVC051002116\中值滤波051002116\中值滤波\源代码\Debug\MyDIP.sbr
文件 24868 2011-04-25 09:17 fiterVC051002116\中值滤波051002116\中值滤波\源代码\Debug\MyDIPDoc.obj
文件 4605 2011-04-25 09:17 fiterVC051002116\中值滤波051002116\中值滤波\源代码\Debug\MyDIPDoc.sbr
文件 25671 2011-04-23 15:49 fiterVC051002116\中值滤波051002116\中值滤波\源代码\Debug\MyDIPView.obj
文件 7183 2011-04-23 15:49 fiterVC051002116\中值滤波051002116\中值滤波\源代码\Debug\MyDIPView.sbr
文件 106148 2011-04-23 15:49 fiterVC051002116\中值滤波051002116\中值滤波\源代码\Debug\StdAfx.obj
文件 1377775 2011-04-23 15:49 fiterVC051002116\中值滤波051002116\中值滤波\源代码\Debug\StdAfx.sbr
文件 230400 2011-04-25 15:39 fiterVC051002116\中值滤波051002116\中值滤波\源代码\Debug\vc60.idb
文件 364544 2011-04-25 15:39 fiterVC051002116\中值滤波051002116\中值滤波\源代码\Debug\vc60.pdb
文件 23782 2004-03-07 17:05 fiterVC051002116\中值滤波051002116\中值滤波\源代码\dibapi.cpp
文件 1876 2000-02-03 07:29 fiterVC051002116\中值滤波051002116\中值滤波\源代码\dibapi.h
文件 2414 2011-04-25 15:39 fiterVC051002116\中值滤波051002116\中值滤波\源代码\MainFrm.cpp
文件 1474 2011-04-25 09:18 fiterVC051002116\中值滤波051002116\中值滤波\源代码\MainFrm.h
文件 3157 2004-05-20 17:49 fiterVC051002116\中值滤波051002116\中值滤波\源代码\mydib.cpp
文件 72 2004-05-20 17:26 fiterVC051002116\中值滤波051002116\中值滤波\源代码\mydib.h
文件 30992 2011-04-25 15:39 fiterVC051002116\中值滤波051002116\中值滤波\源代码\MyDIP.aps
文件 2684 2011-04-25 15:39 fiterVC051002116\中值滤波051002116\中值滤波\源代码\MyDIP.clw
文件 4158 2004-05-20 14:25 fiterVC051002116\中值滤波051002116\中值滤波\源代码\MyDIP.cpp
............此处省略31个文件信息
相关资源
- Windows异步套接字网络编程
- VC 获得文件属性 获取文件的创建时
- 基于MVC模式的会员管理系统
- silicon lab公司的收音IC SI47XX全套开发工
- 读者写者问题(读者优先,写者优先
- MFC程序-碰撞的小球
- vc 柱形图 CBarChart
- 用vc 写的导线测量,针对刚学测绘的
- 用VC 编写的仿QQ聊天室程序源代码
- 栅栏填充算法源码(VC)
- 简单的房屋租赁系统
- .net网站服装销售系统(MVC)
-
ob
jectARX给Auto CAD加工具条 - blowfish的vc2008工程.rar
- 画图程序MFC/VC/VC CRectTracker 串行化
- capon波束形成算法-VC实现
- 读取串口数据并画实时曲线的VC 程序
- VC 游戏编程—附源代码
- IpHlpApi.h&IpHlpApi.lib
- vc 6.0开发的流程图编辑器
- VC 天空盒(skyBox)实现(附源代码)
- c MFC 画多边形
- keil vcom windows 7 64bit 驱动
- vc URL编解码类
- vc编写中国象棋详细源码注释并附有视
- VC 围棋源代码
- 用VC 编写的基于SNMP的路由器拓扑程序
- vc利用MFC底层开发的二维GIS管理软件,
- 兰勃托地图投影VC源码
- 清华大学郑莉C 语言程序设计课件
评论
共有 条评论