Fix rounding error on RGB to L conversion

This commit is contained in:
Alexander 2019-12-31 03:35:47 +03:00
parent 302b86591e
commit d68147ce89

View File

@ -44,7 +44,8 @@
#define L(rgb)\
((INT32) (rgb)[0]*299 + (INT32) (rgb)[1]*587 + (INT32) (rgb)[2]*114)
#define L24(rgb)\
((rgb)[0]*19595 + (rgb)[1]*38470 + (rgb)[2]*7471)
((rgb)[0]*19595 + (rgb)[1]*38470 + (rgb)[2]*7471 + 0x8000)
#ifndef round
double round(double x) {