資源簡介
圖像復原代碼。運動模糊圖像復原、非約束復原、逆濾波復原、維納濾波復原等

代碼片段和文件信息
//?cdib.cpp
#include?“stdafx.h“
#include?“math.h“
#include?“process.h“
#include?“cdib.h“
#include?“GlobalApi.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
//?聲明串行化過程
IMPLEMENT_SERIAL(CDib?Cobject?0);
/*************************************************************************
?*
?*?\函數名稱:
?*???CDib()
?*
?*?\輸入參數:
?*?無
?*
?*?\返回值:
?*???無
?*
?*?\說明:
?*???構造函數
?*
?************************************************************************
?*/
CDib::CDib()
{
m_hFile??????=?NULL;
m_hBitmap????=?NULL;
m_hPalette???=?NULL;
m_nBmihAlloc?=?m_nImageAlloc?=?noAlloc;
Empty();
}
/*************************************************************************
?*
?*?\函數名稱:
?*???CDib()
?*
?*?\輸入參數:
?*?CSize size -?位圖尺寸
?*?int nBitCount -?象素位數
?*
?*?\返回值:
?*???無
?*
?*?\說明:
?*???構造函數
?*???根據給定的位圖尺寸和象素位數構造CDib對象,并對信息頭和調色板分配內存
?*???但并沒有給位圖數據分配內存
?*
?************************************************************************
?*/
CDib::CDib(CSize?size?int?nBitCount)
{
m_hFile??????=?NULL;
m_hBitmap????=?NULL;
m_hPalette???=?NULL;
m_nBmihAlloc?=?m_nImageAlloc?=?noAlloc;
Empty();
//?根據象素位數計算調色板尺寸
ComputePaletteSize(nBitCount);
//?分配DIB信息頭和調色板的內存
m_lpBMIH?=?(LPBITMAPINFOHEADER)?new?
char[sizeof(BITMAPINFOHEADER)?+?sizeof(RGBQUAD)?*?m_nColorTableEntries];
//?設置信息頭內存分配狀態
m_nBmihAlloc?=?crtAlloc;
//?設置信息頭中的信息
m_lpBMIH->biSize =?sizeof(BITMAPINFOHEADER);
m_lpBMIH->biWidth =?size.cx;
m_lpBMIH->biHeight =?size.cy;
m_lpBMIH->biPlanes =?1;
m_lpBMIH->biBitCount =?nBitCount;
m_lpBMIH->biCompression?=?BI_RGB;
m_lpBMIH->biSizeImage =?0;
m_lpBMIH->biXPelsPerMeter?=?0;
m_lpBMIH->biYPelsPerMeter?=?0;
m_lpBMIH->biClrUsed =?m_nColorTableEntries;
m_lpBMIH->biClrImportant=?m_nColorTableEntries;
//?計算圖象數據內存的大小,并設置此DIB的調色板的指針
ComputeMetrics();
//?將此DIB的調色板初始化為0
memset(m_lpvColorTable?0?sizeof(RGBQUAD)?*?m_nColorTableEntries);
//?暫時不分配圖象數據內存
m_lpImage?=?NULL;?
}
/*************************************************************************
?*
?*?\函數名稱:
?*???~CDib()
?*
?*?\輸入參數:
?*?無
?*
?*?\返回值:
?*???無
?*
?*?\說明:
?*???析構函數,并釋放所有分配的DIB內存
?*
?************************************************************************
?*/
CDib::~CDib()
{
Empty();
}
/*************************************************************************
?*
?*?\函數名稱:
?*???GetDimensions()
?*
?*?\輸入參數:
?*???無
?*
?*?\返回值:
?*???CSize -?DIB的寬度和高度
?*
?*?\說明:
?*???返回以象素表示的DIB的寬度和高度
?*
?************************************************************************
?*/
CSize?CDib::GetDimensions()
{
if(m_lpBMIH?==?NULL)?return?CSize(0?0);
return?CSize((int)?m_lpBMIH->biWidth?(int)?m_lpBMIH->biHeight);
}
/*************************************************************************
?*
?*?\函數名稱:
?*???AttachMapFile()
?*
?*?\輸入參數:
?*???const char*?strPathname -?映射文件的路徑名
?*???BOOL bShare -
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????38635??2006-05-29?17:09??ImageRestore\cdib.cpp
?????文件???????3645??2006-05-29?17:09??ImageRestore\cdib.h
?????文件???????1542??2006-05-29?17:09??ImageRestore\ChildFrm.cpp
?????文件???????1397??2006-05-29?17:09??ImageRestore\ChildFrm.h
?????文件??????65095??2006-05-29?17:09??ImageRestore\ColorTable.h
?????文件?????????57??2006-05-29?17:09??ImageRestore\Default.SUP
?????文件??????17030??2006-05-29?17:09??ImageRestore\DIBPrcs.cpp
?????文件??????35187??2006-05-29?17:09??ImageRestore\FreTrans.cpp
?????文件???????9174??2006-05-29?17:09??ImageRestore\GlobalApi.h
?????文件??????60204??2006-05-29?17:09??ImageRestore\ImageProcessing.aps
?????文件???????6013??2006-05-29?17:09??ImageRestore\ImageProcessing.clw
?????文件???????4918??2006-05-29?17:09??ImageRestore\ImageProcessing.cpp
?????文件???????1342??2006-05-29?17:09??ImageRestore\ImageProcessing.h
?????文件????1328128??2006-05-29?17:09??ImageRestore\ImageProcessing.ncb
?????文件??????58880??2006-05-29?17:09??ImageRestore\ImageProcessing.opt
?????文件???????1930??2006-05-29?17:09??ImageRestore\ImageProcessing.plg
?????文件??????16593??2006-05-29?17:09??ImageRestore\ImageProcessing.rc
?????文件???????4363??2006-05-29?17:09??ImageRestore\ImageProcessingDoc.cpp
?????文件???????1643??2006-05-29?17:09??ImageRestore\ImageProcessingDoc.h
?????文件???????8258??2006-05-29?17:09??ImageRestore\ImageProcessingView.cpp
?????文件???????2291??2006-05-29?17:09??ImageRestore\ImageProcessingView.h
?????文件???????4685??2006-05-29?17:09??ImageRestore\ImageView.cpp
?????文件???????5429??2006-05-29?17:09??ImageRestore\IMBRestore.dsp
?????文件????????550??2006-05-29?17:09??ImageRestore\IMBRestore.dsw
?????文件??????82944??2006-05-29?17:09??ImageRestore\IMBRestore.ncb
?????文件??????53760??2006-05-29?17:09??ImageRestore\IMBRestore.opt
?????文件???????2844??2006-05-29?17:09??ImageRestore\IMBRestore.plg
?????文件????????555??2006-05-29?17:09??ImageRestore\IMGRestore.dsw
?????文件??????82944??2006-05-29?17:09??ImageRestore\IMGRestore.ncb
?????文件??????43520??2006-05-29?17:09??ImageRestore\IMGRestore.opt
............此處省略19個文件信息
- 上一篇:SSD1答案
- 下一篇:傳奇脫機掛VC源碼.rar
評論
共有 條評論