亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? wvlttransdib2.cpp

?? VC++圖像處理程序設計課本和代碼.
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
// WvltTrans.cpp: implementation of the CWvltTrans class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "windowsx.h"
#include "math.h"

#include "MainFrm.h"
#include "DynSplitView2.h"
//#include "wavelets.h"
//#include "DIP_System.h"
#include "WvltTransDib.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CWvltTransDib::CWvltTransDib()
{
	layer1=FALSE;
	layer2=FALSE;
	layer3=FALSE;
}

CWvltTransDib::~CWvltTransDib()
{

}

void CWvltTransDib::Hangbianhuan()
{
	int i,j;
	LONG width,height;
	BYTE r, g, b;
	LPBYTE temp1, temp2;
	float tpBuffer;
	short maxVal,minVal,difVal;

	width=this->GetWidth();
	height=this->GetHeight();
	int nWidth=width/2;
	LONG lLineBytes = (width*3+3)/4 *4;
	//分配臨時數據空間
	temp1 = new BYTE[height*width];
	temp2 = new BYTE[height*width];

	//從設備緩存中獲得原始圖像數據
	for(j=0; j<(int)height; j++)
	{
		for( i=0; i<(int)width; i++)
		{
			b=m_pData[j*lLineBytes+3*i];
			g=m_pData[j*lLineBytes+3*i+1];
			r=m_pData[j*lLineBytes+3*i+2];
			temp1[(height-1-j)*width+i]=(BYTE)(0.3*r+0.59*g+0.11*b);  
		}
	}

    for(j = 0; j < height; j ++)            
	{
		for(i = 0; i < nWidth; i ++)           
		{
			int w = i *2;
			temp2[j*width+i] = temp1[j*width+w];		//偶
			temp2[j*width+nWidth+i] = temp1[j*width+w+1];	//奇
		}
	}
	//通過圖像的差分,完成小波變換
	for(j=0; j<height; j++)
	{
		for(i=0; i<nWidth-1; i++)
		{
			temp2[j*width+nWidth+i] = temp2[j*width+nWidth+i] -temp2[j*width+i]+128;	
		}
	}

	maxVal=temp2[0*width+0];
	minVal=temp2[0*width+0];
	//得到圖像小波系數的極大值與極小值
	for( j=0; j<(int)height; j++)
	{
		for( i=0; i<(int)width; i++)
		{
			if(maxVal<temp2[j*width+i])
				maxVal=temp2[j*width+i];
			if(minVal>temp2[j*width+i])
				minVal=temp2[j*width+i];
		}
	}
	//計算獲取圖像小波系數的極值差
	difVal=maxVal-minVal;
	//小波經過處理后,放入顯示緩存中
    for(j=0; j<(int)height; j++)
	{
		for(i=0; i<(int)width; i++)
		{
		//因為小波變換后的小波系數有可能超過255甚至更多,那么就將
		//小波系數的范圍映射到0~255區間內,以后出現類似的處理,目的都是一樣的
			tpBuffer=temp2[(height-1-j)*width+i];
			tpBuffer-=minVal;
			tpBuffer*=255;
			tpBuffer/=difVal;
			m_pData[j*lLineBytes+3*i]  = (BYTE)tpBuffer;
			m_pData[j*lLineBytes+3*i+1]= (BYTE)tpBuffer;
			m_pData[j*lLineBytes+3*i+2]= (BYTE)tpBuffer;
		}
	}
	//刪除臨時的數據空間
	delete temp1;
	delete temp2;	

}

void CWvltTransDib::Liebianhuan()
{
	int i,j;
	LONG width,height;
	BYTE r, g, b;
	LPBYTE temp1, temp2;
	float tpBuffer;
	short maxVal,minVal,difVal;

	width=this->GetWidth();
	height=this->GetHeight();
	int nHeight=height/2;
	LONG lLineBytes = (width*3+3)/4 *4;
	//分配臨時數據空間
	temp1 = new BYTE[height*width];
	temp2 = new BYTE[height*width];

	//從設備緩存中獲得原始圖像數據
	for(j=0; j<(int)height; j++)
	{
		for( i=0; i<(int)width; i++)
		{
			b=m_pData[j*lLineBytes+3*i];
			g=m_pData[j*lLineBytes+3*i+1];
			r=m_pData[j*lLineBytes+3*i+2];
			temp1[(height-1-j)*width+i]=(BYTE)(0.3*r+0.59*g+0.11*b);  
		}
	}
	
	for(i = 0; i < width; i ++)            
	{
		for(j = 0; j < nHeight; j ++)           
		{
			int h = j *2 ;
			temp2[j*width+i] = temp1[h*width+i];		//even
			temp2[(nHeight + j)*width+i] = temp1[(h+1)*width+i];	//odd
		}
	}
	
	//通過圖像的差分,完成小波變換
	for(i=0; i<width; i++)
	{
		for(j=0; j<nHeight-1; j++)
		{
			temp2[(nHeight + j)*width+i] -= temp2[j*width+i]+128;
		}
	}

	maxVal=temp2[0*width+0];
	minVal=temp2[0*width+0];
	//得到圖像小波系數的極大值與極小值
	for( j=0; j<(int)height; j++)
	{
		for( i=0; i<(int)width; i++)
		{
			if(maxVal<temp2[j*width+i])
				maxVal=temp2[j*width+i];
			if(minVal>temp2[j*width+i])
				minVal=temp2[j*width+i];
		}
	}
	//計算獲取圖像小波系數的極值差
	difVal=maxVal-minVal;
	//小波經過處理后,放入顯示緩存中
    for(j=0; j<(int)height; j++)
	{
		for(i=0; i<(int)width; i++)
		{
		//因為小波變換后的小波系數有可能超過255甚至更多,那么就將
		//小波系數的范圍映射到0~255區間內,以后出現類似的處理,目的都是一樣的
			tpBuffer=temp2[(height-1-j)*width+i];
			tpBuffer-=minVal;
			tpBuffer*=255;
			tpBuffer/=difVal;
			m_pData[j*lLineBytes+3*i]  = (BYTE)tpBuffer;
			m_pData[j*lLineBytes+3*i+1]= (BYTE)tpBuffer;
			m_pData[j*lLineBytes+3*i+2]= (BYTE)tpBuffer;
		}
	}
	//刪除臨時的數據空間
	delete temp1;
	delete temp2;	
}

void CWvltTransDib::Once()
{
//	Hangbianhuan();
//	Liebianhuan();
	int i,j;
	LONG width,height,nWidth,nHeight;
	BYTE r, g, b;
	LPBYTE temp1, temp2,temp3;
	float tpBuffer;
	short maxVal,minVal,difVal;

	width=this->GetWidth();
	height=this->GetHeight();
	nWidth=width/2;
	nHeight=height/2;
	LONG lLineBytes = (width*3+3)/4 *4;
	//分配臨時數據空間
	temp1 = new BYTE[height*width];
	temp2 = new BYTE[height*width];
	temp3 = new BYTE[height*width];

	//從設備緩存中獲得原始圖像數據
	for(j=0; j<(int)height; j++)
	{
		for( i=0; i<(int)width; i++)
		{
			b=m_pData[j*lLineBytes+3*i];
			g=m_pData[j*lLineBytes+3*i+1];
			r=m_pData[j*lLineBytes+3*i+2];
			temp1[(height-1-j)*width+i]=(BYTE)(0.3*r+0.59*g+0.11*b);  
		}
	}
	
    for(j = 0; j < height; j ++)            
	{
		for(i = 0; i < nWidth; i ++)           
		{
			int w = i *2;
			temp2[j*width+i] = temp1[j*width+w];		//偶
			temp2[j*width+nWidth+i] = temp1[j*width+w+1];	//奇
		}
	}
	//通過圖像的差分,完成小波變換
	for(j=0; j<height; j++)
	{
		for(i=0; i<nWidth-1; i++)
		{
			temp2[j*width+nWidth+i] -= temp2[j*width+i]+128;	
		}
	}

	for(i=0;i<nWidth;i++)
	{
		for(j=0;j<nHeight;j++)
		{
			int h=j*2;
			temp3[j*width+i]=temp2[h*width+i];//左上
			temp3[(j+nHeight)*width+i]=temp2[(h+1)*width+i];//左下
			temp3[j*width+nWidth+i]=temp2[h*width+nWidth+i];//右上
			temp3[(j+nWidth)*width+nWidth+i]=temp2[(h+1)*width+nWidth+i];//右下
		}
		for(j=0;j<nHeight;j++)
		{
			temp3[(j+nHeight)*width+i]-= temp3[j*width+i]+128;
			temp3[(j+nHeight)*width+nWidth+i]-= temp3[j*width+nWidth+i]+128;
		}
	}

	maxVal=temp3[0*width+0];
	minVal=temp3[0*width+0];
	//得到圖像小波系數的極大值與極小值
	for( j=0; j<(int)height; j++)
	{
		for( i=0; i<(int)width; i++)
		{
			if(maxVal<temp3[j*width+i])
				maxVal=temp3[j*width+i];
			if(minVal>temp3[j*width+i])
				minVal=temp3[j*width+i];
		}
	}
	//計算獲取圖像小波系數的極值差
	difVal=maxVal-minVal;
	//小波經過處理后,放入顯示緩存中
    for(j=0; j<(int)height; j++)
	{
		for(i=0; i<(int)width; i++)
		{
		//因為小波變換后的小波系數有可能超過255甚至更多,那么就將
		//小波系數的范圍映射到0~255區間內,以后出現類似的處理,目的都是一樣的
			tpBuffer=temp3[(height-1-j)*width+i];
			tpBuffer-=minVal;
			tpBuffer*=255;
			tpBuffer/=difVal;
			m_pData[j*lLineBytes+3*i]  = (BYTE)tpBuffer;
			m_pData[j*lLineBytes+3*i+1]= (BYTE)tpBuffer;
			m_pData[j*lLineBytes+3*i+2]= (BYTE)tpBuffer;
		}
	}
	//刪除臨時的數據空間
	delete temp1;
	delete temp2;
	delete temp3;
	layer1=TRUE;
}

void CWvltTransDib::Twice()
{
	Once();
	int i,j;
	LONG width,height,nWidth,nHeight;
	BYTE r, g, b;
	LPBYTE temp1, temp2,temp3;
	float tpBuffer;
	short maxVal,minVal,difVal;

	width=this->GetWidth()/2;
	height=this->GetHeight()/2;
	nWidth=width/2;
	nHeight=height/2;
	LONG lLineBytes = (this->GetWidth()*3+3)/4 *4;
	//分配臨時數據空間
	temp1 = new BYTE[height*width];
	temp2 = new BYTE[height*width];
	temp3 = new BYTE[height*width];

	//從設備緩存中獲得原始圖像數據
	for(j=0; j<(int)height; j++)
	{
		for( i=0; i<(int)width; i++)
		{
			b=m_pData[(j+height)*lLineBytes+3*i];
			g=m_pData[(j+height)*lLineBytes+3*i+1];
			r=m_pData[(j+height)*lLineBytes+3*i+2];
			temp1[(height-1-j)*width+i]=(BYTE)(0.3*r+0.59*g+0.11*b);  
		}
	}
	
    for(j = 0; j < height; j ++)            
	{
		for(i = 0; i < nWidth; i ++)           
		{
			int w = i *2;
			temp2[j*width+i] = (temp1[j*width+w]);		//偶
			temp2[j*width+nWidth+i] = (temp1[j*width+w+1]);	//奇
		}
	}
	//通過圖像的差分,完成小波變換
	for(j=0; j<height; j++)
	{
		for(i=0; i<nWidth-1; i++)
		{
			temp2[j*width+nWidth+i] -= temp2[j*width+i]+128;	
		}
	}

	for(i=0;i<nWidth;i++)
	{
		for(j=0;j<nHeight;j++)
		{
			int h=j*2;
			temp3[j*width+i]=temp2[h*width+i];//左上
			temp3[(j+nHeight)*width+i]=temp2[(h+1)*width+i];//左下
			temp3[j*width+nWidth+i]=temp2[h*width+nWidth+i];//右上
			temp3[(j+nWidth)*width+nWidth+i]=temp2[(h+1)*width+nWidth+i];//右下
		}
		for(j=0;j<nHeight;j++)
		{
			temp3[(j+nHeight)*width+i]-= temp3[j*width+i]+128;
			temp3[(j+nHeight)*width+nWidth+i]-= temp3[j*width+nWidth+i]+128;
		}
	}

	maxVal=temp3[0*width+0];
	minVal=temp3[0*width+0];
	//得到圖像小波系數的極大值與極小值
	for( j=0; j<(int)height; j++)
	{
		for( i=0; i<(int)width; i++)
		{
			if(maxVal<temp3[j*width+i])
				maxVal=temp3[j*width+i];
			if(minVal>temp3[j*width+i])
				minVal=temp3[j*width+i];
		}
	}
	//計算獲取圖像小波系數的極值差
	difVal=maxVal-minVal;
	//小波經過處理后,放入顯示緩存中
    for(j=0; j<(int)height; j++)
	{
		for(i=0; i<(int)width; i++)
		{
		//因為小波變換后的小波系數有可能超過255甚至更多,那么就將
		//小波系數的范圍映射到0~255區間內,以后出現類似的處理,目的都是一樣的
			tpBuffer=temp3[(height-1-j)*width+i];
			tpBuffer-=minVal;
			tpBuffer*=255;
			tpBuffer/=difVal;
			m_pData[(j+height)*lLineBytes+3*i]  = (BYTE)tpBuffer;
			m_pData[(j+height)*lLineBytes+3*i+1]= (BYTE)tpBuffer;
			m_pData[(j+height)*lLineBytes+3*i+2]= (BYTE)tpBuffer;
		}
	}
	//刪除臨時的數據空間
	delete temp1;
	delete temp2;
	delete temp3;	
	layer2=TRUE;
}

void CWvltTransDib::Thrice()
{
	Twice();
	int i,j;
	LONG width,height,nWidth,nHeight;
	BYTE r, g, b;
	LPBYTE temp1, temp2,temp3;
	float tpBuffer;
	short maxVal,minVal,difVal;

	width=this->GetWidth()/4;
	height=this->GetHeight()/4;
	nWidth=width/2;
	nHeight=height/2;
	LONG lLineBytes = (this->GetWidth()*3+3)/4 *4;
	//分配臨時數據空間
	temp1 = new BYTE[height*width];
	temp2 = new BYTE[height*width];
	temp3 = new BYTE[height*width];

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美极品xxx| 欧美日韩在线三级| 国产欧美一区二区精品性色| 国产美女在线精品| 国产精品免费久久久久| av色综合久久天堂av综合| 亚洲夂夂婷婷色拍ww47| 欧美片在线播放| 韩国v欧美v亚洲v日本v| 欧美国产激情二区三区| 欧洲视频一区二区| 免费在线看一区| 国产精品免费久久| 欧美日韩1区2区| 国内成+人亚洲+欧美+综合在线| 国产欧美日韩在线| 欧美午夜不卡在线观看免费| 日本不卡免费在线视频| 国产精品美女久久久久aⅴ国产馆| 色中色一区二区| 美日韩一区二区三区| 欧美韩国一区二区| 欧美日韩一区二区电影| 国产自产高清不卡| 亚洲乱码中文字幕综合| 欧美一区二区久久| 91免费观看国产| 免费观看30秒视频久久| 亚洲色图欧美激情| 日韩免费观看高清完整版在线观看| 国产99久久久国产精品潘金网站| 亚洲综合在线免费观看| 26uuuu精品一区二区| 在线观看亚洲专区| 高清不卡一区二区在线| 亚洲成人7777| 国产精品入口麻豆原神| 日韩三级免费观看| 91麻豆免费观看| 激情综合色播五月| 午夜成人在线视频| 亚洲欧美一区二区三区国产精品| 精品剧情在线观看| 欧美日韩在线直播| www.在线欧美| 国产精品66部| 久久99国产精品麻豆| 午夜视频一区二区| 亚洲欧美韩国综合色| 国产欧美日韩精品在线| 日韩欧美高清dvd碟片| 91国内精品野花午夜精品| 国产成人精品一区二区三区四区| 日韩在线a电影| 亚洲免费在线观看| 国产精品美女久久久久aⅴ国产馆| 日韩精品一区在线观看| 欧美日韩一区二区欧美激情| 色一区在线观看| 99天天综合性| 成人黄色a**站在线观看| 激情综合色播激情啊| 经典三级一区二区| 日韩国产精品大片| 亚洲成av人片一区二区梦乃| 一区在线观看免费| 国产精品你懂的在线欣赏| 国产色产综合色产在线视频| 日韩精品在线一区二区| 欧美一二三区在线观看| 制服丝袜亚洲网站| 日韩亚洲电影在线| 欧美一区二区免费观在线| 欧美一区二区三区免费视频| 欧美日韩另类国产亚洲欧美一级| 色嗨嗨av一区二区三区| 97精品久久久久中文字幕 | 91免费视频观看| av一区二区三区在线| av在线这里只有精品| 99久久精品99国产精品| 99久久国产综合色|国产精品| 成人网男人的天堂| 色婷婷亚洲精品| 色猫猫国产区一区二在线视频| 色婷婷综合五月| 欧美猛男男办公室激情| 欧美一级夜夜爽| 久久免费午夜影院| 国产精品丝袜一区| 伊人性伊人情综合网| 夜夜嗨av一区二区三区| 日韩高清在线电影| 久久成人久久鬼色| 成人午夜av影视| 91极品美女在线| 欧美一区二区在线观看| 精品国产髙清在线看国产毛片| 久久综合九色欧美综合狠狠| 国产精品美女久久久久aⅴ国产馆| 亚洲精品欧美激情| 五月天国产精品| 国产伦精品一区二区三区视频青涩| 国产盗摄精品一区二区三区在线 | 欧美videossexotv100| 国产亚洲人成网站| 亚洲美女免费在线| 日韩精品一二区| 国产精品白丝jk黑袜喷水| 色综合网站在线| 日韩视频国产视频| 亚洲欧美日韩久久| 免费一级片91| 91免费版在线| 精品国产免费人成电影在线观看四季| 国产网站一区二区| 舔着乳尖日韩一区| 丰满少妇久久久久久久| 欧美日韩亚洲另类| 中国色在线观看另类| 天堂影院一区二区| 成人国产精品免费观看视频| 欧美日本韩国一区| 中文字幕一区二区三区在线观看 | 成人av资源下载| 在线播放中文一区| 国产精品久久久久国产精品日日 | 久久免费国产精品| 久久99精品一区二区三区| 成人a级免费电影| 欧美成人精品二区三区99精品| 亚洲三级免费电影| 国产一区二区三区四| 4438x成人网最大色成网站| 一区在线观看免费| 国产成人亚洲综合a∨婷婷图片| 在线电影院国产精品| 国产精品久久久久久久久搜平片| 久久狠狠亚洲综合| 欧美老肥妇做.爰bbww视频| 中文字幕在线免费不卡| 国产乱国产乱300精品| 日韩一级黄色片| 香蕉成人伊视频在线观看| a级精品国产片在线观看| 久久天天做天天爱综合色| 日本不卡视频在线| 欧美人与z0zoxxxx视频| 夜夜嗨av一区二区三区网页 | 欧美日韩国产天堂| 亚洲码国产岛国毛片在线| 国产成人精品午夜视频免费| 在线成人av网站| 亚洲高清在线精品| 91色综合久久久久婷婷| 国产欧美日韩精品一区| 国产成人精品免费网站| 久久日韩精品一区二区五区| 麻豆高清免费国产一区| 日韩欧美一级精品久久| 美女在线视频一区| 欧美成人福利视频| 伦理电影国产精品| 26uuu色噜噜精品一区二区| 久久99久久99小草精品免视看| 欧美一区二区三区男人的天堂| 午夜精品久久久久影视| 欧美日韩三级视频| 亚洲成av人影院在线观看网| 欧美日韩专区在线| 日韩av中文字幕一区二区 | 日韩免费高清视频| 日本亚洲电影天堂| 日韩精品一区二区三区在线播放| 久久精品国产亚洲高清剧情介绍 | 欧美中文一区二区三区| 一区二区三区 在线观看视频| 欧洲一区二区三区在线| 亚洲v中文字幕| 欧美日韩日日摸| 韩国中文字幕2020精品| 欧美激情一区二区三区在线| aaa亚洲精品一二三区| 一区二区三区四区激情| 正在播放亚洲一区| 国产在线视频一区二区| 中文字幕精品在线不卡| 色综合久久综合中文综合网| 一区二区三区精品在线| 欧美福利电影网| 国模套图日韩精品一区二区| 国产精品国产三级国产aⅴ入口| 91久久国产最好的精华液| 日韩av中文字幕一区二区三区| 欧美v日韩v国产v| 91在线码无精品| 视频在线在亚洲| 国产精品婷婷午夜在线观看| 91福利区一区二区三区| 日韩二区在线观看|