本文整理汇总了C++中VideoBuffer::SetPixel方法的典型用法代码示例。如果您正苦于以下问题:C++ VideoBuffer::SetPixel方法的具体用法?C++ VideoBuffer::SetPixel怎么用?C++ VideoBuffer::SetPixel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VideoBuffer
的用法示例。
在下文中一共展示了VideoBuffer::SetPixel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
VideoBuffer *DecorationTool::GetIcon(int toolID, int width, int height)
{
VideoBuffer * newTexture = new VideoBuffer(width, height);
for (int y=0; y<height; y++)
{
for (int x=0; x<width; x++)
{
//if (toolID == DECO_LIGH)
// vid_buf[WINDOWW*(y+j)+(x+i)] = PIXRGB(PIXR(pc)-10*j, PIXG(pc)-10*j, PIXB(pc)-10*j);
//else if (toolID == DECO_DARK)
// vid_buf[WINDOWW*(y+j)+(x+i)] = PIXRGB(PIXR(pc)+10*j, PIXG(pc)+10*j, PIXB(pc)+10*j);
if (toolID == DECO_SMUDGE)
newTexture->SetPixel(x, y, 0, 255-5*x, 5*x, 255);
else if (toolID == DECO_DRAW || toolID == DECO_CLEAR)
newTexture->SetPixel(x, y, Red, Green, Blue, Alpha);
else
newTexture->SetPixel(x, y, 50, 50, 50, 255);
}
}
if (toolID == DECO_CLEAR)
{
int reverseRed = (Red+127)%256;
int reverseGreen = (Green+127)%256;
int reverseBlue = (Blue+127)%256;
for (int y=4; y<12; y++)
{
newTexture->SetPixel(y+5, y-1, reverseRed, reverseGreen, reverseBlue, 255);
newTexture->SetPixel(y+6, y-1, reverseRed, reverseGreen, reverseBlue, 255);
newTexture->SetPixel(20-y, y-1, reverseRed, reverseGreen, reverseBlue, 255);
newTexture->SetPixel(21-y, y-1, reverseRed, reverseGreen, reverseBlue, 255);
}
}
else if (toolID == DECO_ADD)
newTexture->AddCharacter(11, 4, '+', Red, Green, Blue, 255);
else if (toolID == DECO_SUBTRACT)
newTexture->AddCharacter(11, 4, '-', Red, Green, Blue, 255);
else if (toolID == DECO_MULTIPLY)
newTexture->AddCharacter(11, 3, 'x', Red, Green, Blue, 255);
else if (toolID == DECO_DIVIDE)
newTexture->AddCharacter(11, 4, '/', Red, Green, Blue, 255);
return newTexture;
}
示例2: VideoBuffer
VideoBuffer * SignTool::GetIcon(int toolID, int width, int height)
{
VideoBuffer * newTexture = new VideoBuffer(width, height);
for (int y=0; y<height; y++)
{
for (int x=0; x<width; x++)
{
pixel pc = x==0||x==width-1||y==0||y==height-1 ? PIXPACK(0xA0A0A0) : PIXPACK(0x000000);
newTexture->SetPixel(x, y, PIXR(pc), PIXG(pc), PIXB(pc), 255);
}
}
newTexture->AddCharacter((width/2)-5, (height/2)-5, 0xE021, 32, 64, 128, 255);
newTexture->BlendCharacter((width/2)-5, (height/2)-5, 0xE020, 255, 255, 255, 255);
return newTexture;
}