资源简介
通过VC实现拉普拉斯边缘检测算法(图象锐化)

代码片段和文件信息
// 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
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
----------- --------- ---------- ----- ----
131047 29
相关资源
- soble 算子的 边缘检测 VisualC++
- 基于MFC的界面设计,包括灰度化、边
- VS平台 图像边缘检测
- opencv prewitt边缘检测
- C++实现图像边缘检测
- 在vc下开发的canny边缘检测 MFC
- VC++实现灰度图像的6种边缘检测算子
- 图像处理基本的算法边缘,梯度,均
- 虹膜定位方法实现
- 边缘检测 LOG算子 实现
- canny边缘检测的c语言实现
- sobel边缘检测的c/c++代码
- 基于C++的边缘检测算法
- log算子的边缘检测算法
- 图像分割和边缘检测完全C语言源代码
- C++实现灰度图像的边缘检测、提取及
- Canny边缘检测C++代码
- C语言实现canny边缘检测
- OpenCV边缘检测程序 by浅墨
- 边缘检测多尺度opencv
- 图像边缘检测7种算子代码
- canny边缘检测自适应
- OpenCV自己实现的高斯滤波,sobel边缘检
评论
共有 条评论