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


C++ Pixel::GetGreen方法代码示例

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


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

示例1:

void Pixel::operator = (Pixel &pxArg)
{
	this->iR = pxArg.GetRed();
	this->iG = pxArg.GetGreen();
	this->iB = pxArg.GetBlue();

	this->iBW = pxArg.GetBW();
	this->iX = pxArg.GetPixelX();
	this->iY = pxArg.GetPixelY();
}
开发者ID:JuannyWang,项目名称:ImageProcessing-2,代码行数:10,代码来源:Pixel.cpp

示例2: SetPixel

void Image::SetPixel(int X,int Y, Pixel pxP)
{
	if(this->GetImageColorFormat() == 3)
	{
		this->pImageDate[X][Y*3] = pxP.GetRed();
		this->pImageDate[X][Y*3+1] = pxP.GetGreen();
		this->pImageDate[X][Y*3+2] = pxP.GetBlue();
	}
	else if(this->GetImageColorFormat() == 1)
	{
		this->pImageDate[X][Y] = pxP.GetBW();
	}
}
开发者ID:ShreyanshDaga,项目名称:ImageProcessing-3,代码行数:13,代码来源:Image.cpp

示例3: pxTemp

Pixel Pixel::operator + (Pixel &pxArg)
{
	Pixel pxTemp(this->GetRed() + pxArg.GetRed(),this->GetGreen() + pxArg.GetGreen(),this->GetBlue() + pxArg.GetBlue());

	return pxTemp;
}
开发者ID:JuannyWang,项目名称:ImageProcessing-2,代码行数:6,代码来源:Pixel.cpp

示例4: GetPixel

Pixel* Image::GetPixel(double dX, double dY)
{
	int X1,Y1;
	double diffA, diffB;
	Pixel *pxP;
	Pixel *pxPout;

	int cRx = 0,cGx = 0,cBx = 0,cBWx = 0;

	X1 = dX;	
	Y1 = dY;	

	diffA = dX - X1;
	diffB = dY - Y1;

	if(diffA == 0.000 && diffB == 0.000)
	{
		return this->GetPixel(X1,Y1);
	}

	if(diffA < 0 || diffB < 0)
	{
		return this->GetPixel(X1,Y1);
	}	

	pxP = this->GetPixel(X1,Y1);
		cBWx = (1.00 - diffA)*(1.00 - diffB)*pxP->GetBW();
		cRx = (1.00 - diffA)*(1.00 - diffB)*pxP->GetRed();
		cGx = (1.00 - diffA)*(1.00 - diffB)*pxP->GetGreen();
		cBx = (1.00 - diffA)*(1.00 - diffB)*pxP->GetBlue();
		//RGB
	delete pxP;
	pxP = this->GetPixel(X1,Y1+1);
		cBWx += (1.00 - diffA)*(diffB)*pxP->GetBW();
		cRx += (1.00 - diffA)*(diffB)*pxP->GetRed();
		cGx += (1.00 - diffA)*(diffB)*pxP->GetGreen();
		cBx += (1.00 - diffA)*(diffB)*pxP->GetBlue();
		//RGB
	delete pxP;
	pxP = this->GetPixel(X1+1,Y1);
		cBWx += (diffA)*(1.00 - diffB)*pxP->GetBW();
		cRx += (diffA)*(1.00 - diffB)*pxP->GetRed();
		cGx += (diffA)*(1.00 - diffB)*pxP->GetGreen();
		cBx += (diffA)*(1.00 - diffB)*pxP->GetBlue();
		//RGB
	delete pxP;
	pxP = this->GetPixel(X1+1,Y1+1);
		cBWx += (diffA)*(diffB)*pxP->GetBW();
		cRx += (diffA)*(diffB)*pxP->GetRed();
		cGx += (diffA)*(diffB)*pxP->GetGreen();
		cBx += (diffA)*(diffB)*pxP->GetBlue();
		//RGB
	delete pxP;

	if(this->iColorFormat == 1)
	{
		pxPout = new Pixel(cBWx);
	}
	else if(this->iColorFormat == 3)
	{
		pxPout = new Pixel(cRx,cGx,cBx);
	}

	return pxPout;
}
开发者ID:ShreyanshDaga,项目名称:ImageProcessing-3,代码行数:65,代码来源:Image.cpp


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