summaryrefslogtreecommitdiff
path: root/src/lib/evas/common/evas_convert_grypal_6.c
blob: 243bf000e6dce24f9d36e2204e1c22d497d33ee5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "evas_common.h"
#include "evas_convert_grypal_6.h"

void evas_common_convert_rgba_to_8bpp_pal_gray64(DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x EINA_UNUSED, int dith_y EINA_UNUSED, DATA8 *pal)
{
    DATA32 *src_ptr;
    DATA8 *dst_ptr;
    int x, y;
    DATA8 Y;

    dst_ptr = dst;
    CONVERT_LOOP_START_ROT_0();

    /* RGB -> YUV conversion */
    Y = ((R_VAL(src_ptr) * 76) + 
         (G_VAL(src_ptr) * 151) + 
         (B_VAL(src_ptr) * 29)) >> 10;
    *dst_ptr = pal[Y];

    CONVERT_LOOP_END_ROT_0();
}