evas_common: rgba32 to Y8 (Enhance Conversion)
authorali <ali198724@gmail.com>
Fri, 13 Mar 2020 08:54:54 +0000 (09:54 +0100)
committerJongmin Lee <jm105.lee@samsung.com>
Sun, 15 Mar 2020 21:11:24 +0000 (06:11 +0900)
commit6d3b23fa83f9275b28a15c398e0d49e70873de87
treecd62cc67381c81dae81118e34605487a23dbb127
parent89ecc1aebb6722d5544b8e663d72043cecfbb551
evas_common: rgba32 to Y8 (Enhance Conversion)

Summary:
Made small change to expand mapping range by using celling values.
Now : rgb(255,255,255)   ->  y(255)
Now : rgb(1  , 1 ,1  )   ->  y(1)

Old : rgb(255,255,255)   ->  y(254)
Old : rgb(1  ,  1,  1)   ->  y(0)

It is important for white point convert to not loss any value

Test Plan:
```
#include <stdio.h>

int main()
{
    unsigned char r =255, g =255,b =255;
    unsigned int gry8_old = ((r * 19595) + (g * 38469) + (b * 7471)) >> 16;
    unsigned int gry8_new = ((r * 19596) + (g * 38470) + (b * 7472)) >> 16;

    printf("gry_old=%i\n",gry8_old);
    printf("gry_new=%i\n",gry8_new);

    return 0;
}

```

Reviewers: cedric, raster, zmike, vtorri, Hermet, woohyun, bu5hm4n, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: segfaultxavi, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9490
src/lib/evas/common/evas_convert_gry_8.c