diff options
author | Kristian Høgsberg <krh@bitplanet.net> | 2012-05-29 12:15:47 -0400 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2012-05-29 12:15:47 -0400 |
commit | 053be42a4ed4910e5d1f4c89c94a8d04da4842b9 (patch) | |
tree | bb0546b0e6a80643c93dc2eaaba7be2b66919ab0 /wcap | |
parent | db0623a5f054324b27aa9cf40474aa9f283e6723 (diff) | |
download | weston-053be42a4ed4910e5d1f4c89c94a8d04da4842b9.tar.gz weston-053be42a4ed4910e5d1f4c89c94a8d04da4842b9.tar.bz2 weston-053be42a4ed4910e5d1f4c89c94a8d04da4842b9.zip |
wcap: Compute per-component deltas
Diffstat (limited to 'wcap')
-rw-r--r-- | wcap/wcap-decode.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/wcap/wcap-decode.c b/wcap/wcap-decode.c index 3ce7a196..425ccff1 100644 --- a/wcap/wcap-decode.c +++ b/wcap/wcap-decode.c @@ -42,7 +42,8 @@ wcap_decoder_decode_rectangle(struct wcap_decoder *decoder, uint32_t v, *p = decoder->p, *d; int width = rect->x2 - rect->x1, height = rect->y2 - rect->y1; int x, i, j, k, l, count = width * height; - + unsigned char r, g, b, dr, dg, db; + d = decoder->frame + (rect->y2 - 1) * decoder->width; x = rect->x1; i = 0; @@ -55,8 +56,14 @@ wcap_decoder_decode_rectangle(struct wcap_decoder *decoder, j = 1 << (l - 0xe0 + 7); } + dr = (v >> 16); + dg = (v >> 8); + db = (v >> 0); for (k = 0; k < j; k++) { - d[x] = (d[x] + v) | 0xff000000; + r = (d[x] >> 16) + dr; + g = (d[x] >> 8) + dg; + b = (d[x] >> 0) + db; + d[x] = 0xff000000 | (r << 16) | (g << 8) | b; x++; if (x == rect->x2) { x = rect->x1; |