Logo Search packages:      
Sourcecode: libcaca version File versions  Download package

static uint8_t clip_bits ( int  x,
int  y 
) [static]

Helper function for clip_line().

Parameters:
x X coordinate of the point.
y Y coordinate of the point.
Returns:
The clipping bits for the given point.

Definition at line 225 of file line.c.

Referenced by clip_line().

{
    uint8_t b = 0;

    if(x < 0)
        b |= (1<<0);
    else if(x >= (int)_caca_width)
        b |= (1<<1);

    if(y < 0)
        b |= (1<<2);
    else if(y >= (int)_caca_height)
        b |= (1<<3);

    return b;
}


Generated by  Doxygen 1.6.0   Back to index