亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
日韩精品一级二级| 北条麻妃一区二区三区| 免费人成黄页网站在线一区二区| 日韩电影在线看| 日韩成人一级片| 国产成人免费高清| 欧美无人高清视频在线观看| 日韩欧美的一区| 亚洲欧美偷拍卡通变态| 天天操天天综合网| 粉嫩高潮美女一区二区三区| 91网站视频在线观看| 日韩一区二区精品| 亚洲欧美一区二区三区孕妇| 水野朝阳av一区二区三区| 国产一区二区三区免费看| 国产麻豆一精品一av一免费| 在线免费一区三区| 久久久精品tv| 午夜电影久久久| 99国产精品久久久久久久久久久 | 欧美久久久久久蜜桃| 日韩三级在线观看| 亚洲最色的网站| av电影在线观看完整版一区二区| 91精品国产综合久久精品图片| 中文字幕欧美区| 久色婷婷小香蕉久久| 欧美综合视频在线观看| 国产清纯白嫩初高生在线观看91 | 国产精品1区2区3区在线观看| 欧美性做爰猛烈叫床潮| 欧美激情在线一区二区三区| 天天综合网 天天综合色| 91色porny在线视频| 国产亚洲成aⅴ人片在线观看 | 欧美系列一区二区| 亚洲三级久久久| 福利一区在线观看| 久久久青草青青国产亚洲免观| 五月婷婷综合在线| 欧美在线观看视频一区二区| 国产精品久久久久久久久快鸭| 国产一区二区三区四区在线观看| 日韩一二三四区| 日本一不卡视频| 欧美精品在线一区二区| 日韩在线一区二区三区| 欧美中文字幕一二三区视频| 亚洲免费观看高清完整版在线观看熊 | 91美女片黄在线观看91美女| 欧美一级爆毛片| 日本人妖一区二区| 欧美一区二区在线看| 亚洲午夜久久久久| 色综合久久中文字幕| 久久久99精品久久| 久久av中文字幕片| 久久久久国产精品人| 国产福利精品一区| 国产精品高潮久久久久无| 99国产精品视频免费观看| 亚洲日本韩国一区| 欧美性猛片xxxx免费看久爱| 亚洲一区二区3| 欧美日韩一本到| 亚洲国产欧美日韩另类综合| 精品视频在线免费| 看电影不卡的网站| 亚洲国产精品国自产拍av| 色综合色综合色综合色综合色综合 | 精品99999| 国产福利一区二区三区视频在线 | 亚洲丝袜美腿综合| 欧美三级韩国三级日本一级| 日韩av一二三| 久久久午夜电影| 91在线视频网址| 亚洲一二三四区不卡| 91精选在线观看| 国产成人精品一区二区三区四区 | 国产欧美精品日韩区二区麻豆天美| 成人性生交大片免费看在线播放| 日韩久久一区二区| 91搞黄在线观看| 国内精品免费在线观看| 亚洲人xxxx| 久久综合狠狠综合久久综合88| jizz一区二区| 免费看日韩精品| 久久精品欧美日韩| 欧美三级电影一区| 国产成人夜色高潮福利影视| 亚洲资源在线观看| 国产三级精品三级| 51精品视频一区二区三区| 岛国精品在线播放| 麻豆一区二区三| 依依成人精品视频| 欧美精品一区二区三区在线| av网站一区二区三区| 五月综合激情网| 综合分类小说区另类春色亚洲小说欧美 | 从欧美一区二区三区| 午夜亚洲福利老司机| 国产精品福利电影一区二区三区四区| 欧美日韩精品欧美日韩精品| 大白屁股一区二区视频| 亚洲成人一区在线| 中文字幕一区二区三区不卡| 精品电影一区二区三区| 欧美日韩精品免费观看视频| 99在线精品视频| 国产在线麻豆精品观看| 婷婷成人综合网| 久久精品人人做人人综合| 欧美高清视频一二三区 | 日韩成人一区二区三区在线观看| 国产精品看片你懂得| 久久久久久久国产精品影院| 在线观看一区不卡| 成人综合婷婷国产精品久久| 久久精品国产免费看久久精品| 亚洲综合区在线| ㊣最新国产の精品bt伙计久久| 久久精品欧美日韩| 久久久夜色精品亚洲| 欧美人妖巨大在线| 欧美日韩卡一卡二| 欧美剧在线免费观看网站| 在线欧美日韩精品| 在线这里只有精品| 欧洲一区二区三区免费视频| 自拍偷拍国产亚洲| 91色porny| 欧美三区在线观看| 欧美一区二区三区电影| 精品999久久久| 国产精品久久久久久久久久久免费看 | 欧美一区二区播放| 2020国产精品自拍| 国产精品久99| 天天综合天天做天天综合| 激情综合网天天干| gogogo免费视频观看亚洲一| 一本到不卡精品视频在线观看| 欧美亚洲动漫精品| 精品久久久久一区二区国产| 国产免费久久精品| 亚洲制服欧美中文字幕中文字幕| 日韩不卡一二三区| 99久久婷婷国产精品综合| 在线成人小视频| 国产日韩欧美一区二区三区综合 | 日韩**一区毛片| 国产69精品久久99不卡| 日本乱人伦一区| 精品国产区一区| 一区二区三区四区亚洲| 韩国av一区二区三区在线观看| 不卡一区二区三区四区| 欧美一区二区在线视频| 国产精品成人一区二区艾草| 免费在线观看一区| fc2成人免费人成在线观看播放| 9191国产精品| 亚洲色图都市小说| 国产麻豆日韩欧美久久| 欧美午夜精品久久久久久超碰| 久久久久久免费| 青青草国产精品亚洲专区无| 99re66热这里只有精品3直播| 精品欧美一区二区在线观看| 亚洲一区二区不卡免费| 99久久综合狠狠综合久久| 欧美电影免费观看高清完整版| 亚洲码国产岛国毛片在线| 国产综合久久久久久久久久久久| 欧美日韩国产大片| 亚洲黄一区二区三区| www.亚洲色图.com| 久久人人超碰精品| 久久99久久精品| 欧美一区二区久久久| 亚洲小说春色综合另类电影| 97se亚洲国产综合自在线| 久久久久久亚洲综合影院红桃| 美女国产一区二区三区| 欧美三区免费完整视频在线观看| 最近中文字幕一区二区三区| 成人激情视频网站| 日本一区二区视频在线| 国产精品系列在线播放| 精品国产亚洲在线| 九九热在线视频观看这里只有精品| 5566中文字幕一区二区电影| 亚洲电影视频在线| 欧美日韩中文字幕一区二区| 一区二区三区影院| 欧美视频一二三区|