当前位置: 首页>>代码示例>>C++>>正文


C++ CDib::CopyDib方法代码示例

本文整理汇总了C++中CDib::CopyDib方法的典型用法代码示例。如果您正苦于以下问题:C++ CDib::CopyDib方法的具体用法?C++ CDib::CopyDib怎么用?C++ CDib::CopyDib使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CDib的用法示例。


在下文中一共展示了CDib::CopyDib方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Subtract

VOID CDibUtil::Subtract(CDib& imgA, CDib& imgB, CDib& dest)
{
	dest.CopyDib(&imgA);
	CSize imageSize = imgA.GetDimensions();

	for (LONG y = 0; y != imageSize.cy; ++y)
		for (LONG x = 0; x != imageSize.cx; ++x)
		{
			dest.WritePixel(x, y, RGBSUB(imgA.GetPixel(x, y), imgB.GetPixel(x, y)));
		}
}
开发者ID:microdog,项目名称:DigitalImageProcessingCourseProject,代码行数:11,代码来源:DibUtil.cpp

示例2: Graying

VOID CDibUtil::Graying(CDib& src, CDib& dest)
{
	dest.CopyDib(&src);
	CSize imageSize = src.GetDimensions();

	RGBQUAD color;
	for (LONG y = 0; y != imageSize.cy; ++y)
		for (LONG x = 0; x != imageSize.cx; ++x)
		{
			color = src.GetPixel(x, y);
			color.rgbRed = color.rgbGreen = color.rgbBlue
				= GRAYING(color.rgbRed, color.rgbGreen, color.rgbBlue);
			dest.WritePixel(x, y, color);
		}
}
开发者ID:microdog,项目名称:DigitalImageProcessingCourseProject,代码行数:15,代码来源:DibUtil.cpp

示例3: Binaryzation

VOID CDibUtil::Binaryzation(CDib& src, CDib& dest, BYTE threshold)
{
	dest.CopyDib(&src);
	CSize imageSize = src.GetDimensions();
	
	RGBQUAD color;
	for (LONG y = 0; y != imageSize.cy; ++y)
		for (LONG x = 0; x != imageSize.cx; ++x)
		{
			color = src.GetPixel(x, y);
			color.rgbRed = color.rgbGreen = color.rgbBlue
				= (GRAYING(color.rgbRed, color.rgbGreen, color.rgbBlue) < threshold) ? 0x00 : 0xFF;
			dest.WritePixel(x, y, color);
		}
}
开发者ID:microdog,项目名称:DigitalImageProcessingCourseProject,代码行数:15,代码来源:DibUtil.cpp

示例4: RandomPixels

VOID CDibUtil::RandomPixels(CDib& src, CDib& dest, LONG count)
{
	dest.CopyDib(&src);
	CSize imageSize = src.GetDimensions();
	
	srand( (UINT)time( NULL ) );
	
	RGBQUAD color;
	LONG x, y;
	for (LONG i = 0; i != count; ++i)
	{
		// Random color
		color.rgbRed = (BYTE)((DOUBLE)rand() / (RAND_MAX + 1) * 255);
		color.rgbGreen = (BYTE)((DOUBLE)rand() / (RAND_MAX + 1) * 255);
		color.rgbBlue = (BYTE)((DOUBLE)rand() / (RAND_MAX + 1) * 255);
		
		// Random position
		x = (LONG)((DOUBLE)rand() / (RAND_MAX + 1) * imageSize.cx);
		y = (LONG)((DOUBLE)rand() / (RAND_MAX + 1) * imageSize.cy);
		
		// Write
		dest.WritePixel(x, y, color);
	}
}
开发者ID:microdog,项目名称:DigitalImageProcessingCourseProject,代码行数:24,代码来源:DibUtil.cpp


注:本文中的CDib::CopyDib方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。