Logo Search packages:      
Sourcecode: chromium-browser version File versions  Download package

static int op ( uint8_t **  dst,
const uint8_t *  dst_end,
const uint8_t **  buf,
const uint8_t *  buf_end,
int  pixel,
int  count,
int *  x,
int  width,
int  linesize 
) [inline, static]

Perform decode operation

Parameters:
dst,dst_end Destination image buffer
buf,buf_end Source buffer (optional, see below)
pixel Fill color (optional, see below)
count Pixel count
x Pointer to x-axis counter
width Image width
linesize Destination image buffer linesize
Returns:
non-zero if destination buffer is exhausted
a copy operation is achieved when 'buf' is set a fill operation is acheived when 'buf' is null and pixel is >= 0 a skip operation is acheived when 'buf' is null and pixel is < 0

Definition at line 74 of file anm.c.

Referenced by UnicodeSet::applyPattern(), SkAnimator::setArrayInt(), SkAnimator::setArrayString(), yasm_insn_finalize(), and yasm_insn_print().

{
    int remaining = width - *x;
    while(count > 0) {
        int striplen = FFMIN(count, remaining);
        if (buf) {
            striplen = FFMIN(striplen, buf_end - *buf);
            memcpy(*dst, *buf, striplen);
            *buf += striplen;
        } else if (pixel >= 0)
            memset(*dst, pixel, striplen);
        *dst      += striplen;
        remaining -= striplen;
        count     -= striplen;
        if (remaining <= 0) {
            *dst      += linesize - width;
            remaining  = width;
        }
        if (linesize > 0) {
            if (*dst >= dst_end) goto exhausted;
        } else {
            if (*dst <= dst_end) goto exhausted;
        }
    }
    *x = width - remaining;
    return 0;

exhausted:
    *x = width - remaining;
    return 1;
}


Generated by  Doxygen 1.6.0   Back to index