?? graytrans.h
字號(hào):
#ifndef _INSIDE_VISUAL_CPP_GRAYTRANS
#define _INSIDE_VISUAL_CPP_GRAYTRANS
#include "ImageCenterDib.h"
//灰度變換類
class GrayTrans:public ImgCenterDib
{
public:
//輸出圖像每像素位數(shù)
int m_nBitCountOut;
//輸出圖像位圖數(shù)據(jù)指針
unsigned char * m_pImgDataOut;
//輸出圖像顏色表
LPRGBQUAD m_lpColorTableOut;
private:
//輸出圖像的寬,像素為單位
int m_imgWidthOut;
//輸出圖像的高,像素為單位
int m_imgHeightOut;
//輸出圖像顏色表長(zhǎng)度
int m_nColorTableLengthOut;
public:
//不帶參數(shù)的構(gòu)造函數(shù)
GrayTrans();
//帶參數(shù)的構(gòu)造函數(shù)
GrayTrans(CSize size, int nBitCount, LPRGBQUAD lpColorTable,
unsigned char *pImgData);
//析構(gòu)函數(shù)
~GrayTrans();
//以像素為單位返回輸出圖像的寬和高
CSize GetDimensions();
//負(fù)相
void ReverseImg();
//彩色變灰度格式
void ColorToGray();
//灰度變彩色格式
void GrayToColor();
//二值化
void Binary(int threshold=128);
//線性拉伸
void LinearStrech(CPoint point[2]);
//對(duì)數(shù)非線性拉伸
void DuiShuStrech(float a, float b, float c);
//指數(shù)非線性拉伸
void ZhiShuStrech(float a, float b, float c);
private:
//單通道數(shù)據(jù)線性拉伸
void LinearStrechForSnglChannel(unsigned char *pImgDataIn,
unsigned char *pImgDataOut,int imgWidth,int imgHeight,CPoint point[2]);
//單通道數(shù)據(jù)對(duì)數(shù)函數(shù)非線性拉伸
void DuiShuStrechForSnglChannel(unsigned char *pImgDataIn,
unsigned char *pImgDataOut,int imgWidth,int imgHeight,
float a, float b, float c);
//單通道數(shù)據(jù)指數(shù)函數(shù)非線性拉伸
void ZhiShuStrechForSnglChannel(unsigned char *pImgDataIn,
unsigned char *pImgDataOut,int imgWidth,int imgHeight,
float a, float b, float c);
};
#endif // _INSIDE_VISUAL_CPP_GRAYTRANS
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -