MCPcopy Create free account
hub / github.com/VirtualGL/virtualgl / initBuf

Function initBuf

util/glreadtest.cpp:264–281  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

262
263
264void initBuf(int x, int y, int width, int height, PF *pf, unsigned char *buf)
265{
266 int i, j, maxRGB = (1 << pf->bpc);
267 for(j = 0; j < height; j++)
268 {
269 for(i = 0; i < width; i++)
270 {
271 if(pf->id == PF_COMP)
272 buf[j * width + i] = ((j + y) * (i + x)) % maxRGB;
273 else
274 {
275 pf->setRGB(&buf[(j * width + i) * pf->size],
276 ((j + y) * (i + x)) % maxRGB,
277 ((j + y) * (i + x) * 2) % maxRGB, ((j + y) * (i + x) * 3) % maxRGB);
278 }
279 }
280 }
281}
282
283
284int cmpBuf(int x, int y, int width, int height, PF *pf, unsigned char *buf,

Callers 1

writeTestFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected