Skip to content

Commit

Permalink
feat(rpict, rvu): added Sharp RGB primary rendering ability with -DSH…
Browse files Browse the repository at this point in the history
…ARP_RGB
  • Loading branch information
Gregungory committed Nov 14, 2021
1 parent 7e853da commit 5083fc0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
19 changes: 14 additions & 5 deletions src/common/color.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* RCSid $Id: color.h,v 2.34 2015/03/26 15:40:32 greg Exp $ */
/* RCSid $Id: color.h,v 2.35 2021/11/14 17:30:02 greg Exp $ */
/*
* color.h - header for routines using pixel color values.
*
Expand Down Expand Up @@ -55,14 +55,23 @@ typedef float COLORMAT[3][3]; /* color coordinate conversion matrix */

#define multcolor(c1,c2) ((c1)[0]*=(c2)[0],(c1)[1]*=(c2)[1],(c1)[2]*=(c2)[2])

#ifdef NTSC
#if defined(NTSC_RGB)
#define CIE_x_r 0.670 /* standard NTSC primaries */
#define CIE_y_r 0.330
#define CIE_x_g 0.210
#define CIE_y_g 0.710
#define CIE_x_b 0.140
#define CIE_y_b 0.080
#define CIE_x_w (1./3.) /* use true white */
#define CIE_x_w (1./3.) /* use EE white */
#define CIE_y_w (1./3.)
#elif defined(SHARP_RGB)
#define CIE_x_r 0.6898 /* "sharp" RGB primaries */
#define CIE_y_r 0.3206
#define CIE_x_g 0.0736
#define CIE_y_g 0.9003
#define CIE_x_b 0.1166
#define CIE_y_b 0.0374
#define CIE_x_w (1./3.) /* use EE white */
#define CIE_y_w (1./3.)
#else
#define CIE_x_r 0.640 /* nominal CRT primaries */
Expand All @@ -71,7 +80,7 @@ typedef float COLORMAT[3][3]; /* color coordinate conversion matrix */
#define CIE_y_g 0.600
#define CIE_x_b 0.150
#define CIE_y_b 0.060
#define CIE_x_w (1./3.) /* use true white */
#define CIE_x_w (1./3.) /* use EE white */
#define CIE_y_w (1./3.)
#endif

Expand All @@ -98,7 +107,7 @@ typedef float COLORMAT[3][3]; /* color coordinate conversion matrix */
#define CIE_gf (CIE_y_g*CIE_C_gD/CIE_D)
#define CIE_bf (CIE_y_b*CIE_C_bD/CIE_D)

/* As of 9-94, CIE_rf=.265074126, CIE_gf=.670114631 and CIE_bf=.064811243 */
/* Default CIE_rf=.265074126, CIE_gf=.670114631 and CIE_bf=.064811243 */

/***** The following definitions are valid for RGB colors only... *****/

Expand Down
3 changes: 2 additions & 1 deletion src/rt/rpict.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef lint
static const char RCSid[] = "$Id: rpict.c,v 2.94 2020/07/20 15:52:30 greg Exp $";
static const char RCSid[] = "$Id: rpict.c,v 2.95 2021/11/14 17:30:02 greg Exp $";
#endif
/*
* rpict.c - routines and variables for picture generation.
Expand Down Expand Up @@ -340,6 +340,7 @@ rpict( /* generate image(s) */
if ((pa < .99) | (pa > 1.01))
fputaspect(pa, stdout);
fputnow(stdout);
fputprims(stdprims, stdout);
fputformat(COLRFMT, stdout);
putchar('\n');
if (zout != NULL)
Expand Down
3 changes: 2 additions & 1 deletion src/rt/rv2.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef lint
static const char RCSid[] = "$Id: rv2.c,v 2.72 2021/02/12 00:41:19 greg Exp $";
static const char RCSid[] = "$Id: rv2.c,v 2.73 2021/11/14 17:30:02 greg Exp $";
#endif
/*
* rv2.c - command routines used in tracing a view.
Expand Down Expand Up @@ -870,6 +870,7 @@ writepict( /* write the picture to a file */
fputexpos(exposure, fp);
if (dev->pixaspect != 1.0)
fputaspect(dev->pixaspect, fp);
fputprims(stdprims, fp);
fputformat(COLRFMT, fp);
putc('\n', fp);
fprtresolu(hresolu, vresolu, fp);
Expand Down

0 comments on commit 5083fc0

Please sign in to comment.