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

Method decompressRGB

common/Frame.cpp:279–300  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

277
278
279void Frame::decompressRGB(Frame &f, int width, int height, bool rightEye)
280{
281 if(!f.bits || f.hdr.size < 1 || !bits || !hdr.size)
282 THROW("Frame not initialized");
283 if(pf->bpc < 8)
284 throw(Error("RGB decompressor",
285 "Destination frame has the wrong pixel format"));
286
287 bool dstbu = (flags & FRAME_BOTTOMUP);
288 int srcStride = f.pitch, dstStride = pitch;
289 int startLine = dstbu ? max(0, hdr.frameh - f.hdr.y - height) : f.hdr.y;
290 unsigned char *srcptr = rightEye ? f.rbits : f.bits,
291 *dstptr = rightEye ? &rbits[pitch * startLine + f.hdr.x * pf->size] :
292 &bits[pitch * startLine + f.hdr.x * pf->size];
293
294 if(!dstbu)
295 {
296 srcptr = &srcptr[(height - 1) * f.pitch]; srcStride = -srcStride;
297 }
298 pf_get(PF_RGB)->convert(srcptr, width, srcStride, height, dstptr, dstStride,
299 pf);
300}
301
302
303#define DRAWLOGO() \

Callers 1

rgbBenchFunction · 0.80

Calls 3

pf_getFunction · 0.85
ErrorClass · 0.50
maxFunction · 0.50

Tested by

no test coverage detected