Esempio n. 1
0
static void
cmap1_init( int gray )
{
    PLFLT i[2], h[2], l[2], s[2];

    i[0] = 0.0;         // left boundary
    i[1] = 1.0;         // right boundary

    if ( gray )
    {
        h[0] = 0.0;     // hue -- low: red (arbitrary if s=0)
        h[1] = 0.0;     // hue -- high: red (arbitrary if s=0)

        l[0] = 0.5;     // lightness -- low: half-dark
        l[1] = 1.0;     // lightness -- high: light

        s[0] = 0.0;     // minimum saturation
        s[1] = 0.0;     // minimum saturation
    }
    else
    {
        h[0] = 240; // blue -> green -> yellow ->
        h[1] = 0;   // -> red

        l[0] = 0.6;
        l[1] = 0.6;

        s[0] = 0.8;
        s[1] = 0.8;
    }

    plscmap1n( 256 );
    c_plscmap1l( 0, 2, i, h, l, s, NULL );
}
Esempio n. 2
0
static void
cmap1_init1( void )
{
    PLFLT i[4], h[4], l[4], s[4];

    i[0] = 0;           /* left boundary */
    i[1] = 0.45;        /* just before center */
    i[2] = 0.55;        /* just after center */
    i[3] = 1;           /* right boundary */

    h[0] = 260;         /* hue -- low: blue-violet */
    h[1] = 260;         /* only change as we go over vertex */
    h[2] = 20;          /* hue -- high: red */
    h[3] = 20;          /* keep fixed */

#if 1
    l[0] = 0.5;         /* lightness -- low */
    l[1] = 0.0;         /* lightness -- center */
    l[2] = 0.0;         /* lightness -- center */
    l[3] = 0.5;         /* lightness -- high */
#else
    plscolbg( 255, 255, 255 );
    l[0] = 0.5;         /* lightness -- low */
    l[1] = 1.0;         /* lightness -- center */
    l[2] = 1.0;         /* lightness -- center */
    l[3] = 0.5;         /* lightness -- high */
#endif
    s[0] = 1;           /* maximum saturation */
    s[1] = 1;           /* maximum saturation */
    s[2] = 1;           /* maximum saturation */
    s[3] = 1;           /* maximum saturation */

    c_plscmap1l( 0, 4, i, h, l, s, NULL );
}
Esempio n. 3
0
static void
plcmap1_def(void)
{
    PLFLT i[6], h[6], l[6], s[6], midpt = 0., vertex = 0.;

/* Positions of control points */

    i[0] = 0;		/* left boundary */
    i[1] = 0.44;	/* a little left of center */
    i[2] = 0.50;	/* at center */
    i[3] = 0.50;	/* at center */
    i[4] = 0.56;	/* a little right of center */
    i[5] = 1;		/* right boundary */

/* For center control points, pick black or white, whichever is closer to bg */
/* Be carefult to pick just short of top or bottom else hue info is lost */

    if (plsc->cmap0 != NULL)
	vertex = ((PLFLT) plsc->cmap0[0].r +
		  (PLFLT) plsc->cmap0[0].g +
		  (PLFLT) plsc->cmap0[0].b) / 3. / 255.;

    if (vertex < 0.5) {
	vertex = 0.01;
	midpt  = 0.10;
    } else {
	vertex = 0.99;
	midpt  = 0.90;
    }

/* Set hue */

    h[0] = 260;		/* low: blue-violet */
    h[1] = 260;		/* only change as we go over vertex */
    h[2] = 260;		/* only change as we go over vertex */
    h[3] = 0;		/* high: red */
    h[4] = 0;		/* high: red */
    h[5] = 0;		/* keep fixed */

/* Set lightness */

    l[0] = 0.5;		/* low */
    l[1] = midpt;	/* midpoint value */
    l[2] = vertex;	/* bg */
    l[3] = vertex;	/* bg */
    l[4] = midpt;	/* midpoint value */
    l[5] = 0.5;		/* high */

/* Set saturation -- keep at maximum */

    s[0] = 1;
    s[1] = 1;
    s[2] = 1;
    s[3] = 1;
    s[4] = 1;
    s[5] = 1;

    c_plscmap1l(0, 6, i, h, l, s, NULL);
}
Esempio n. 4
0
static void
cmap1_init()
{
  PLFLT i[2], h[2], l[2], s[2];

  i[0] = 0.0;		/* left boundary */
  i[1] = 1.0;		/* right boundary */

  h[0] = 240; /* blue -> green -> yellow -> */
  h[1] = 0;   /* -> red */

  l[0] = 0.6;
  l[1] = 0.6;

  s[0] = 0.8;
  s[1] = 0.8;

  plscmap1n(256);
  c_plscmap1l(0, 2, i, h, l, s, NULL);
}
Esempio n. 5
0
void WINAPI
plscmap1l(PLINT itype, PLINT npts, PLFLT *intensity,
	    PLFLT *coord1, PLFLT *coord2, PLFLT *coord3, PLINT *rev) {
	c_plscmap1l(itype,npts,intensity,coord1,coord2,coord3,rev);
}