[cairo] Adding 565 16bpp to Cairo

Zimman, Chris czimman at bloomberg.com
Fri Jun 2 09:19:52 PDT 2006


I need to add 565 16 bit RGB support to Cairo.  Once obvious things like
adding new enum definitions to Cairo are done, I guess there has to be
some support added to a few places in pixman.

What would be a suggested naming convention for the CAIRO_FORMAT_ enum
for something like this?  CAIRO_FORMAT_RGB16_565?

As an example, does the following make sense:

In icformat.c:

pixman_format_t *
pixman_format_create (pixman_format_name_t name)
{
    switch (name) {
    case PIXMAN_FORMAT_NAME_ARGB32:
        return pixman_format_create_masks (32,
                                    0xff000000,
                                    0x00ff0000,
                                    0x0000ff00,
                                    0x000000ff);
    case PIXMAN_FORMAT_NAME_RGB24:
        return pixman_format_create_masks (32,
                                    0x0,
                                    0xff0000,
                                    0x00ff00,
                                    0x0000ff);
    case PIXMAN_FORMAT_NAME_RGB16_565:
         return pixman_format_create_masks (16,
						0x0,
						0xf800,
						0x07e0,
						0x00ff);
    case PIXMAN_FORMAT_NAME_A8:
        return pixman_format_create_masks (8, 0xff,
                                    0, 0, 0);
    case PIXMAN_FORMAT_NAME_A1:
        return pixman_format_create_masks (1, 0x1,
                                    0, 0, 0);
    }

    return NULL;
}

What other places in pixman need to be updated?

Thanks

--Chris


More information about the cairo mailing list