Rel*_*lla 1 c c# c++ creation frame
// Create test video frame
void CreateFrame(char * buffer, int w, int h, int bytespan)
{
int wxh = w * h;
static float seed = 1.0;
for (int i = 0; i < h; i ++)
{
char* line = buffer + i * bytespan;
for (int j = 0; j < w; j ++)
{
// RGB
line[0] = 255 * sin(((float)i / wxh * seed) * 3.14);
line[1] = 255 * cos(((float)j / wxh * seed) * 3.14);
line[2] = 255 * sin(((float)(i + j) / wxh * seed) * 3.14);
line += 3;
}
}
seed = seed + 2.2;
}
Run Code Online (Sandbox Code Playgroud)
任何人都可以高举我的意思line += 3;吗?
以及如何在C#中创建这样的函数模拟?