Back to index

lightning-sunbird  0.9+nobinonly
Functions
iccolor.c File Reference
#include "icint.h"

Go to the source code of this file.

Functions

int _FbOnes (unsigned long mask)
void pixman_color_to_pixel (const pixman_format_t *format, const pixman_color_t *color, pixman_bits_t *pixel)
 slim_hidden_def (pixman_color_to_pixel)
static uint16_t FbFillColor (uint32_t pixel, int bits)
void pixman_pixel_to_color (const pixman_format_t *format, const pixman_bits_t pixel, pixman_color_t *color)

Function Documentation

int _FbOnes ( unsigned long  mask)

Definition at line 29 of file iccolor.c.

{
    register unsigned long y;

    y = (mask >> 1) &033333333333;
    y = mask - y - ((y >>1) & 033333333333);
    return (((y + (y >> 3)) & 030707070707) % 077);
}

Here is the caller graph for this function:

static uint16_t FbFillColor ( uint32_t  pixel,
int  bits 
) [static]

Definition at line 59 of file iccolor.c.

{
    while (bits < 16)
    {
       pixel |= pixel << bits;
       bits <<= 1;
    }
    return (uint16_t) pixel;
}

Here is the caller graph for this function:

void pixman_color_to_pixel ( const pixman_format_t *  format,
const pixman_color_t color,
pixman_bits_t pixel 
)

Definition at line 40 of file iccolor.c.

{
    uint32_t      r, g, b, a;

    r = color->red >> (16 - _FbOnes (format->redMask));
    g = color->green >> (16 - _FbOnes (format->greenMask));
    b = color->blue >> (16 - _FbOnes (format->blueMask));
    a = color->alpha >> (16 - _FbOnes (format->alphaMask));
    r = r << format->red;
    g = g << format->green;
    b = b << format->blue;
    a = a << format->alpha;
    *pixel = r|g|b|a;
}

Here is the call graph for this function:

void pixman_pixel_to_color ( const pixman_format_t *  format,
const pixman_bits_t  pixel,
pixman_color_t color 
)

Definition at line 70 of file iccolor.c.

{
    uint32_t      r, g, b, a;

    r = (pixel >> format->red) & format->redMask;
    g = (pixel >> format->green) & format->greenMask;
    b = (pixel >> format->blue) & format->blueMask;
    a = (pixel >> format->alpha) & format->alphaMask;
    color->red = FbFillColor (r, _FbOnes (format->redMask));
    color->green = FbFillColor (r, _FbOnes (format->greenMask));
    color->blue = FbFillColor (r, _FbOnes (format->blueMask));
    color->alpha = FbFillColor (r, _FbOnes (format->alphaMask));
}

Here is the call graph for this function: