Seperated grayscale conversion type

BT601, BT709, and average.
This commit is contained in:
basic2004
2017-07-19 15:08:40 +09:00
committed by GitHub
parent 021befa12c
commit 7f978f5a30
7 changed files with 45 additions and 4 deletions

View File

@@ -26,6 +26,7 @@
int invert_display = 0;
int video_grayscale = 0;
int video_graytype = 0;
uint32_t shade[5][256] =
{
@@ -92,7 +93,15 @@ uint32_t svga_color_transform(uint32_t color)
uint32_t temp = 0;
if (video_grayscale != 0)
{
temp = ((76 * (color & 0xff0000)) >> 24) + ((150 * (color & 0xff00)) >> 16) + ((29 * (color & 0xff)) >> 8);
if (video_graytype)
{
if (video_graytype == 1)
temp = ((54 * ((color & 0xff0000) >> 16)) + (183 * ((color & 0xff00) >> 8)) + (18 * (color & 0xff))) / 255;
else
temp = (((color & 0xff0000) >> 16) + ((color & 0xff00) >> 8) + (color & 0xff)) / 3;
}
else
temp = ((76 * ((color & 0xff0000) >> 16)) + (150 * ((color & 0xff00) >> 8)) + (29 * (color & 0xff))) / 255;
switch (video_grayscale)
{
case 2:

View File

@@ -113,6 +113,9 @@ void ddraw_fs_take_screenshot(wchar_t *fn);
extern int cga_palette;
extern int vid_cga_contrast;
extern int video_grayscale;
extern int video_graytype;
void loadfont(wchar_t *s, int format);
void initvideo();
void video_init();