資源簡介
這是一個用Visual C++實現的FFT變換,大家可以拿來參考一下,對學習有一定的幫助!

代碼片段和文件信息
//??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
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
????.......??????2506??2004-05-20?14:25??傅立葉變換-VC++\源代碼\MainFrm.cpp
????.......??????1581??2004-05-20?14:25??傅立葉變換-VC++\源代碼\MainFrm.h
????.......?????46320??2004-06-30?00:58??傅立葉變換-VC++\源代碼\MyDIP.aps
????.......??????2615??2004-06-30?00:56??傅立葉變換-VC++\源代碼\MyDIP.clw
????.......??????4158??2004-05-20?14:25??傅立葉變換-VC++\源代碼\MyDIP.cpp
????.......??????4781??2004-05-20?17:54??傅立葉變換-VC++\源代碼\MyDIP.dsp
????.......???????533??2004-05-20?14:25??傅立葉變換-VC++\源代碼\MyDIP.dsw
????.......??????1345??2004-05-20?14:25??傅立葉變換-VC++\源代碼\MyDIP.h
????.......?????12279??2004-06-30?00:58??傅立葉變換-VC++\源代碼\MyDIP.rc
????.......??????4007??2004-05-20?17:10??傅立葉變換-VC++\源代碼\MyDIPDoc.cpp
????.......??????1830??2004-05-20?15:17??傅立葉變換-VC++\源代碼\MyDIPDoc.h
????.......?????10272??2004-06-30?00:58??傅立葉變換-VC++\源代碼\MyDIPView.cpp
????.......??????1852??2004-06-30?00:56??傅立葉變換-VC++\源代碼\MyDIPView.h
????.......??????4287??2004-05-20?14:25??傅立葉變換-VC++\源代碼\ReadMe.txt
????.......???????874??2004-06-30?00:58??傅立葉變換-VC++\源代碼\Resource.h
????.......???????207??2004-05-20?14:25??傅立葉變換-VC++\源代碼\StdAfx.cpp
????.......??????1040??2004-05-20?17:21??傅立葉變換-VC++\源代碼\StdAfx.h
????.......?????23782??2004-03-07?17:05??傅立葉變換-VC++\源代碼\dibapi.cpp
????.......??????1876??2000-02-03?07:29??傅立葉變換-VC++\源代碼\dibapi.h
????.......??????3157??2004-05-20?17:49??傅立葉變換-VC++\源代碼\mydib.cpp
????.......????????72??2004-05-20?17:26??傅立葉變換-VC++\源代碼\mydib.h
????.......??????1078??2004-05-20?14:25??傅立葉變換-VC++\源代碼\res\MyDIP.ico
????.......???????397??2004-05-20?14:25??傅立葉變換-VC++\源代碼\res\MyDIP.rc2
????.......??????1078??2004-05-20?14:25??傅立葉變換-VC++\源代碼\res\MyDIPDoc.ico
????.......??????1078??2004-05-20?14:25??傅立葉變換-VC++\源代碼\res\Toolbar.bmp
?????目錄??????????0??2005-12-03?18:38??傅立葉變換-VC++\源代碼\res
?????目錄??????????0??2005-12-03?18:38??傅立葉變換-VC++\源代碼\Release
?????目錄??????????0??2005-12-03?18:38??傅立葉變換-VC++\源代碼
????.......?????66614??2004-06-30?00:58??傅立葉變換-VC++\測試圖片\傅立葉變換結果.bmp
????.......?????66614??2004-06-29?22:59??傅立葉變換-VC++\測試圖片\原始lena圖像.bmp
............此處省略6個文件信息
評論
共有 條評論