📄 vlmask.cpp
字号:
// vlMask.cpp: implementation of the CvlMask class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "airImg.h"
#include "vlMask.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CvlMask::CvlMask()
{
kernel = NULL;
}
CvlMask::~CvlMask()
{
if (kernel)
{
delete kernel;
}
}
void CvlMask::vlMaskCreate(int w, int h, float* k)
{
int r,c,index;
if (kernel=new float[w*h*sizeof(float)])
{
width = w;
height = h;
}
if (k)
{
for (r=0;r<h;r++)
for (c=0;c<w;c++)
{
index = r*width + c;
kernel[index] = k[index];
}
}
else
{
MessageBox(NULL,"malloc failed","warnning!",MB_OK);
}
return;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -