|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
for(unsigned int y = 0; y < pOutput->Height; y++)
{
unsigned int xMin = 0, xMax = pOutput->Width-1;
unsigned char pixelVal = 0;
pixelVal = pInput->getValue( xMin, y );
pOutput->setValue( pixelVal, xMin, y );
pixelVal = pInput->getValue( xMax, y );
pOutput->setValue( pixelVal, xMax, y );
}
for(unsigned int x = 1; x < pOutput->Width-1; x++)
{
unsigned int yMin = 0, yMax = pOutput->Height-1;
unsigned char pixelVal = 0;
pixelVal = pInput->getValue(x, yMin );
pOutput->setValue( pixelVal, x, yMin );
pixelVal = pInput->getValue( x, yMax );
pOutput->setValue( pixelVal, x, yMax );
}
这是对图像的边界做什么处理?
把pInput的四条边复制到pOutput的四条边,而且pInput和pOutput长宽必须相等,要不越界
|
|