예제 #1
0
/* Convert an RGB palette to YCbCr. */
static void video_palette_to_ycbcr(const palette_t *p,
                                   video_ycbcr_palette_t* ycbcr)
{
    unsigned int i;

    for (i = 0; i < p->num_entries; i++) {
        video_convert_rgb_to_ycbcr(&p->entries[i], &ycbcr->entries[i]);
    }
}
예제 #2
0
static void video_convert_rgb_to_renderer(const palette_entry_t *src,
                                       video_ycbcr_color_t *dst, int video)
{
    /* DBG(("video_convert_rgb_to_renderer")); */

    if (video) {
        /* PAL */
        video_convert_rgb_to_ycbcr(src, dst);
    } else {
        /* NTSC */
        video_convert_rgb_to_yiq(src, dst);
    }
}
예제 #3
0
/* Convert the internal videochip palette to YCbCr. */
static void video_cbm_palette_to_ycbcr(const video_cbm_palette_t *p, video_ycbcr_palette_t* ycbcr)
{
    unsigned int i;

    if (p->type == CBM_PALETTE_RGB) {
        /* special case for handling chips that output RGB (such as the VDC),
           admittedly slightly ugly but simple and effective :) */
        palette_entry_t src;
        for (i = 0; i < p->num_entries; i++) {
            src.red = (BYTE)p->entries[i].luminance;
            src.green = (BYTE)p->entries[i].angle;
            src.blue = p->entries[i].direction;
            video_convert_rgb_to_ycbcr(&src, &ycbcr->entries[i]);
        }
    } else {
        for (i = 0; i < p->num_entries; i++) {
            video_convert_cbm_to_ycbcr(&p->entries[i], p->saturation, p->phase, &ycbcr->entries[i]);
        }
    }
}