| 277 | |
| 278 | |
| 279 | void 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() \ |