⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 imageprocessview.cpp

📁 《精通 vc++ 图像编程》的源代码
💻 CPP
📖 第 1 页 / 共 2 页
字号:
	if (FD.DoModal() == IDOK)
	{
		CImageProcessDoc* pDoc = GetDocument();
		pDoc->m_pDib->LowPass(FD.m_nStreng, FILTER3);
		pDoc->SetModifiedFlag(TRUE);
		OnRealizePal((WPARAM)m_hWnd,0);  // realize the new palette
		pDoc->UpdateAllViews(NULL);
	}
}

void CImageProcessView::OnUpdateLf3(CCmdUI* pCmdUI) 
{
	pCmdUI->Enable(! GetDocument()->m_pDib->IsEmpty());
}

void CImageProcessView::OnEast() 
{
	EdgeEnhance(EAST);
}

void CImageProcessView::OnUpdateEast(CCmdUI* pCmdUI) 
{
	pCmdUI->Enable(! GetDocument()->m_pDib->IsEmpty());
}

void CImageProcessView::OnNorth() 
{
	EdgeEnhance(NORTH);
}

void CImageProcessView::OnUpdateNorth(CCmdUI* pCmdUI) 
{
	pCmdUI->Enable(! GetDocument()->m_pDib->IsEmpty());
}

void CImageProcessView::OnNortheast() 
{
	EdgeEnhance(NORTHEAST);
}

void CImageProcessView::OnUpdateNortheast(CCmdUI* pCmdUI) 
{
	pCmdUI->Enable(! GetDocument()->m_pDib->IsEmpty());
}

void CImageProcessView::OnNorthwest() 
{
	EdgeEnhance(NORTHWEST);
}

void CImageProcessView::OnUpdateNorthwest(CCmdUI* pCmdUI) 
{
	pCmdUI->Enable(! GetDocument()->m_pDib->IsEmpty());
}

void CImageProcessView::OnSouth() 
{
	EdgeEnhance(SOUTH);
}

void CImageProcessView::OnUpdateSouth(CCmdUI* pCmdUI) 
{
	pCmdUI->Enable(! GetDocument()->m_pDib->IsEmpty());
}

void CImageProcessView::OnSoutheast() 
{
	EdgeEnhance(SOUTHEAST);
}

void CImageProcessView::OnUpdateSoutheast(CCmdUI* pCmdUI) 
{
	pCmdUI->Enable(! GetDocument()->m_pDib->IsEmpty());
}

void CImageProcessView::OnSouthwest() 
{
	EdgeEnhance(SOUTHWEST);
}

void CImageProcessView::OnUpdateSouthwest(CCmdUI* pCmdUI) 
{
	pCmdUI->Enable(! GetDocument()->m_pDib->IsEmpty());
}

void CImageProcessView::OnWest() 
{
	EdgeEnhance(WEST);
}

void CImageProcessView::OnUpdateWest(CCmdUI* pCmdUI) 
{
	pCmdUI->Enable(! GetDocument()->m_pDib->IsEmpty());
}

void CImageProcessView::OnSobel() 
{
	EdgeEnhance(SOBEL);
}

void CImageProcessView::OnUpdateSobel(CCmdUI* pCmdUI) 
{
	pCmdUI->Enable(! GetDocument()->m_pDib->IsEmpty());
}

void CImageProcessView::OnHough() 
{
	EdgeEnhance(HOUGH);
}

void CImageProcessView::OnUpdateHough(CCmdUI* pCmdUI) 
{
	pCmdUI->Enable(! GetDocument()->m_pDib->IsEmpty());
}

void CImageProcessView::EdgeEnhance(int nAlgorithm) 
{
	CConvoluteDlg FD(1,10,3,this);
	if (FD.DoModal() == IDOK)
	{
		CImageProcessDoc* pDoc = GetDocument();
		pDoc->m_pDib->EdgeEnhance(FD.m_nStreng, nAlgorithm);
		pDoc->SetModifiedFlag(TRUE);
		OnRealizePal((WPARAM)m_hWnd,0);  // realize the new palette
		pDoc->UpdateAllViews(NULL);
	}
}


void CImageProcessView::OnMedianfilter() 
{
	CImageProcessDoc* pDoc = GetDocument();
	pDoc->m_pDib->MedianFilter();
	pDoc->SetModifiedFlag(TRUE);
	OnRealizePal((WPARAM)m_hWnd,0);  // realize the new palette
	pDoc->UpdateAllViews(NULL);
}

void CImageProcessView::OnUpdateMedianfilter(CCmdUI* pCmdUI) 
{
	pCmdUI->Enable(! GetDocument()->m_pDib->IsEmpty());
}



void CImageProcessView::OnErosionH() 
{
	CImageProcessDoc* pDoc = GetDocument();
	pDoc->m_pDib->Erosion(TRUE);
	pDoc->SetModifiedFlag(TRUE);
	OnRealizePal((WPARAM)m_hWnd,0);  // realize the new palette
	pDoc->UpdateAllViews(NULL);
}

void CImageProcessView::OnErosionV() 
{
	CImageProcessDoc* pDoc = GetDocument();
	pDoc->m_pDib->Erosion(FALSE);
	pDoc->SetModifiedFlag(TRUE);
	OnRealizePal((WPARAM)m_hWnd,0);  // realize the new palette
	pDoc->UpdateAllViews(NULL);
}

void CImageProcessView::OnUpdateErosionH(CCmdUI* pCmdUI) 
{
	pCmdUI->Enable(! GetDocument()->m_pDib->IsEmpty());
}

void CImageProcessView::OnUpdateErosionV(CCmdUI* pCmdUI) 
{
	pCmdUI->Enable(! GetDocument()->m_pDib->IsEmpty());
}

void CImageProcessView::OnDilationH() 
{
	CImageProcessDoc* pDoc = GetDocument();
	pDoc->m_pDib->Erosion(TRUE);
	pDoc->SetModifiedFlag(TRUE);
	OnRealizePal((WPARAM)m_hWnd,0);  // realize the new palette
	pDoc->UpdateAllViews(NULL);
}

void CImageProcessView::OnUpdateDilationH(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->Enable(! GetDocument()->m_pDib->IsEmpty());
	
}

void CImageProcessView::OnDilationV() 
{
	CImageProcessDoc* pDoc = GetDocument();
	pDoc->m_pDib->Dilation(FALSE);
	pDoc->SetModifiedFlag(TRUE);
	OnRealizePal((WPARAM)m_hWnd,0);  // realize the new palette
	pDoc->UpdateAllViews(NULL);
}

void CImageProcessView::OnUpdateDilationV(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->Enable(! GetDocument()->m_pDib->IsEmpty());
	
}

void CImageProcessView::OnCloseH() 
{
	// TODO: Add your command handler code here
	CImageProcessDoc* pDoc = GetDocument();
	pDoc->m_pDib->MorphClose(TRUE);
	pDoc->SetModifiedFlag(TRUE);
	OnRealizePal((WPARAM)m_hWnd,0);  // realize the new palette
	pDoc->UpdateAllViews(NULL);
	
}

void CImageProcessView::OnUpdateCloseH(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->Enable(! GetDocument()->m_pDib->IsEmpty());
	
}

void CImageProcessView::OnCloseV() 
{
	// TODO: Add your command handler code here
	CImageProcessDoc* pDoc = GetDocument();
	pDoc->m_pDib->MorphClose(FALSE);
	pDoc->SetModifiedFlag(TRUE);
	OnRealizePal((WPARAM)m_hWnd,0);  // realize the new palette
	pDoc->UpdateAllViews(NULL);
	
}

void CImageProcessView::OnUpdateCloseV(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->Enable(! GetDocument()->m_pDib->IsEmpty());
	
}

void CImageProcessView::OnOpenH() 
{
	// TODO: Add your command handler code here
	CImageProcessDoc* pDoc = GetDocument();
	pDoc->m_pDib->MorphOpen(TRUE);
	pDoc->SetModifiedFlag(TRUE);
	OnRealizePal((WPARAM)m_hWnd,0);  // realize the new palette
	pDoc->UpdateAllViews(NULL);
	
}

void CImageProcessView::OnUpdateOpenH(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->Enable(! GetDocument()->m_pDib->IsEmpty());
	
}

void CImageProcessView::OnOpenV() 
{
	// TODO: Add your command handler code here
	CImageProcessDoc* pDoc = GetDocument();
	pDoc->m_pDib->MorphOpen(FALSE);
	pDoc->SetModifiedFlag(TRUE);
	OnRealizePal((WPARAM)m_hWnd,0);  // realize the new palette
	pDoc->UpdateAllViews(NULL);
	
}

void CImageProcessView::OnUpdateOpenV(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->Enable(! GetDocument()->m_pDib->IsEmpty());
	
}

void CImageProcessView::OnThin() 
{
	// TODO: Add your command handler code here
	CImageProcessDoc* pDoc = GetDocument();
	pDoc->m_pDib->Thinning();
	pDoc->SetModifiedFlag(TRUE);
	OnRealizePal((WPARAM)m_hWnd,0);  // realize the new palette
	pDoc->UpdateAllViews(NULL);
	
}

void CImageProcessView::OnUpdateThin(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->Enable(! GetDocument()->m_pDib->IsEmpty());
	
}

void CImageProcessView::OnReverse() 
{
	// TODO: Add your command handler code here
	CImageProcessDoc* pDoc = GetDocument();
	pDoc->m_pDib->Reverse();
	pDoc->SetModifiedFlag(TRUE);
	OnRealizePal((WPARAM)m_hWnd,0);  // realize the new palette
	pDoc->UpdateAllViews(NULL);
	
}

void CImageProcessView::OnUpdateReverse(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->Enable(! GetDocument()->m_pDib->IsEmpty());
	
}

void CImageProcessView::OnFft() 
{
	// TODO: Add your command handler code here
	CImageProcessDoc* pDoc = GetDocument();
	pDoc->m_pDib->FFT();
	pDoc->SetModifiedFlag(TRUE);
	OnRealizePal((WPARAM)m_hWnd,0);  // realize the new palette
	pDoc->UpdateAllViews(NULL);
	
}

void CImageProcessView::OnUpdateFft(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->Enable(! GetDocument()->m_pDib->IsEmpty());
	
}

void CImageProcessView::OnDct() 
{
	// TODO: Add your command handler code here
	CImageProcessDoc* pDoc = GetDocument();
	pDoc->m_pDib->DCT();
	pDoc->SetModifiedFlag(TRUE);
	OnRealizePal((WPARAM)m_hWnd,0);  // realize the new palette
	pDoc->UpdateAllViews(NULL);
	
}

void CImageProcessView::OnUpdateDct(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->Enable(! GetDocument()->m_pDib->IsEmpty());
	
}

void CImageProcessView::OnWalh() 
{
	// TODO: Add your command handler code here
	CImageProcessDoc* pDoc = GetDocument();
	pDoc->m_pDib->WALh();
	pDoc->SetModifiedFlag(TRUE);
	OnRealizePal((WPARAM)m_hWnd,0);  // realize the new palette
	pDoc->UpdateAllViews(NULL);
	
}

void CImageProcessView::OnUpdateWalh(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->Enable(! GetDocument()->m_pDib->IsEmpty());
	
}

void CImageProcessView::OnContourH() 
{
	// TODO: Add your command handler code here
	CImageProcessDoc* pDoc = GetDocument();
	pDoc->m_pDib->Contour(TRUE);
	pDoc->SetModifiedFlag(TRUE);
	OnRealizePal((WPARAM)m_hWnd,0);  // realize the new palette
	pDoc->UpdateAllViews(NULL);
	
}

void CImageProcessView::OnUpdateContourH(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->Enable(! GetDocument()->m_pDib->IsEmpty());
	
}

void CImageProcessView::OnContourV() 
{
	// TODO: Add your command handler code here
	CImageProcessDoc* pDoc = GetDocument();
	pDoc->m_pDib->Contour(FALSE);
	pDoc->SetModifiedFlag(TRUE);
	OnRealizePal((WPARAM)m_hWnd,0);  // realize the new palette
	pDoc->UpdateAllViews(NULL);
	
}

void CImageProcessView::OnUpdateContourV(CCmdUI* pCmdUI) 
{
	// TODO: Add your command update UI handler code here
	pCmdUI->Enable(! GetDocument()->m_pDib->IsEmpty());
	
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -