home *** CD-ROM | disk | FTP | other *** search
/ Encyclopedia of Graphics File Formats Companion / GFF_CD.ISO / software / unix / saoimage / sao1_07.tar / defs / color.def < prev    next >
Text File  |  1991-01-02  |  10KB  |  190 lines

  1. #ifndef lint
  2. static char SccsColdefId[] = "%W%  %G%";
  3. #endif
  4.  
  5. /* Module:    Color.def
  6.  * Purpose:    Declare and initialize color parameters
  7.  * Modified:    {0} Michael VanHilst    initial version          19 May 1989
  8.  *        {n} <who> -- <does what> -- <when>
  9.  */
  10.  
  11. struct colorRec color = {
  12.  NULL,        /* Display *display;        display server */
  13.  -1,        /* int screen;            screen id for display server */
  14.  0,        /* int screen_depth;        number of hardware planes */
  15.  NULL,        /* Visual *visual;        visual of the colormap */
  16.  0,        /* int monochrome;        one color with fixed values */
  17.  0,        /* int single_plane;        one plane dither or diffuse */
  18.  0,        /* Colormap colormap;        server colormap being used */
  19.  0,        /* int cursor_overlay;        overlay plane in use flag */
  20.  0,        /* int ncolors;            num of reserved image colors */
  21.  0,        /* int inverse;            forward or inverse values */
  22.         /* int colormap_mode;        halftone, pseudo, fixed */
  23.  VOP_PseudoColor,
  24.  MOP_GrayScale,    /* int color_tableID;        id of predefined colorset */
  25.  VOP_ContBias,    /* int control_mode;        ContBias, ThreshSat, gamma */
  26.  0,        /* int control_mode_ext;    R_G_B -R|G|B, or RGB -R&G&B */
  27.  0,        /* int colors_alloced;        if colors were alloc'ed */
  28.  0,        /* int old_mode;        previous mode (when change) */
  29.  0,        /* int image_plane_mask;    mask for image planes only */
  30.  0,        /* unsigned long overlay_mask;    mask bit for overlay cursor */
  31.  {        /* struct scalemodeRec scale;    for image scaling modes */
  32.    SOP_Linear,    /*   int mode; */
  33.    10,        /*   int wrap_cnt; */
  34.    2.0,        /*   double root_power; */
  35.    10.0 },    /*   double log_expo; */
  36.  {        /* struct colmapRec map;    describe colormaps to use */
  37.    0,        /*   int private_used;        flag using private colormap */
  38.    0,        /*   int private_installed;    if private map is installed */
  39.    1,        /*   int default_permit;    user permit to use default */
  40.    0,        /*   int default_enable;    possible to use default */
  41.    0,        /*   int private_permit;    user permit to use private */
  42.    0,        /*   int private_enable;    possible to use private */
  43.    0,        /*   Colormap default_colormap;    default colormap of root */
  44.    0,        /*   Colormap private_colormap;    private created colormap */
  45.    NULL,    /*   XVisualInfo *default_vinfo;    default visual info */
  46.    NULL },    /*   XVisualInfo *private_vinfo;    private visual info */
  47.  {        /* struct cellspecRec cells;    request for cells */
  48.    0,        /*   int overlay;        request for overlay plane */
  49.    200,        /*   int wanted;        desired number of cells */
  50.    20,        /*   int min;            minimum number of cells */
  51.    0 },        /*   int got;            actual number of cells */
  52.  {        /* struct palletteRec hard;    read-only basic colors */
  53.    0,        /*   int std_black;        from BlackPixel */
  54.    0,        /*   int std_white;        from WhitePixel */
  55.    0,        /*   int true_black;        true 0,0,0 black */
  56.    0,        /*   int true_white;        true max,max,max white */
  57.    0,        /*   int red; */
  58.    0,        /*   int green; */
  59.    0,        /*   int blue; */
  60.    0 },        /*   int yellow; */
  61.  {        /* struct halftoneRec halftone;    halftoning stuff */
  62.    BOP_Dither,    /*   int mode;            dither, diffuse */
  63.    BOP_Matrix1,    /*   int matrixID;        Matrix1, Matrix2 */
  64.    0,        /*   int inverse;        halftone's own flag */
  65.    0,        /*   int pad; */
  66.    NULL,    /*   short *matrix;        dithering weight matrix */
  67.    NULL },    /*   short *errbuf;        error diffusion error buffer */
  68.  {        /* struct curcolorRec cur;    cursor drawing stuff */
  69.    0,        /*   int disp_one;        color map slots for graphics */
  70.    0,        /*   int disp_two; */
  71.    "green",    /*   char *default_cur;        default cursor color name */
  72.    "yellow",    /*   char *default_one;        default graphics color names */
  73.    "red",    /*   char *default_two; */
  74.    NULL,    /*   char *desired_cur;        user's cursor color name */
  75.    NULL,    /*   char *desired_one;        user's graphics colors names */
  76.    NULL,    /*   char *desired_two; */
  77.    { 0 },    /*   XColor color_cur;        cursor color description */
  78.    { 0 },    /*   XColor color_one;        graphics color description */
  79.    { 0 } },    /*   XColor color_two; */
  80.  {        /* struct gcsetRec gcset;    specifications of gc's used */
  81.    {          /* GCspec disp;        image display parameters */
  82.      U_DONT_CARE,   /* unsigned long foreground; */
  83.      U_DONT_CARE,   /* unsigned long background; */
  84.      GXcopy,        /* int func; */
  85.      AllPlanes },   /* unsigned long mask; */
  86.    {          /* Cspec draw;        cursor drawing parameters */
  87.      0,            /* unsigned long foreground; */
  88.      U_DONT_CARE,   /* unsigned long background; */
  89.      GXcopy,        /* int func; */
  90.      AllPlanes },   /* unsigned long mask; */
  91.    {          /* Cspec track;        cursor tracking parameters */
  92.      0,            /* unsigned long foreground; */
  93.      U_DONT_CARE,   /* unsigned long background; */
  94.      GXcopy,        /* int func; */
  95.      AllPlanes },   /* unsigned long mask; */
  96.    {          /* Cspec undraw;        cursor erasing parameters */
  97.      0,            /* unsigned long foreground; */
  98.      U_DONT_CARE,   /* unsigned long background; */
  99.      GXcopy,        /* int func; */
  100.      AllPlanes },   /* unsigned long mask; */
  101.    {          /* Cspec incl;        include region parameters */
  102.      0,            /* unsigned long foreground; */
  103.      U_DONT_CARE,   /* unsigned long background; */
  104.      GXcopy,        /* int func; */
  105.      AllPlanes },   /* unsigned long mask; */
  106.    {          /* Cspec excl;        exclude region parameters */
  107.      0,            /* unsigned long foreground; */
  108.      U_DONT_CARE,   /* unsigned long background; */
  109.      GXcopy,        /* int func; */
  110.      AllPlanes },   /* unsigned long mask; */
  111.    {          /* Cspec menu;        std_black on white */
  112.      0,            /* unsigned long foreground; */
  113.      0,            /* unsigned long background; */
  114.      GXcopy,        /* int func; */
  115.      AllPlanes },   /* unsigned long mask; */
  116.    {          /* GCspec red;        for drawing red lines */
  117.      0,            /* unsigned long foreground; */
  118.      U_DONT_CARE,   /* unsigned long background; */
  119.      GXcopy,        /* int func; */
  120.      AllPlanes },   /* unsigned long mask; */
  121.    {          /* GCspec green;        for drawing green lines */
  122.      0,            /* unsigned long foreground; */
  123.      U_DONT_CARE,   /* unsigned long background; */
  124.      GXcopy,        /* int func; */
  125.      AllPlanes },   /* unsigned long mask; */
  126.    {          /* GCspec blue;        for drawing blue lines */
  127.      0,            /* unsigned long foreground; */
  128.      U_DONT_CARE,   /* unsigned long background; */
  129.      GXcopy,        /* int func; */
  130.      AllPlanes },   /* unsigned long mask; */
  131.    {          /* GCspec black;        for drawing black lines */
  132.      0,            /* unsigned long foreground; */
  133.      U_DONT_CARE,   /* unsigned long background; */
  134.      GXcopy,        /* int func; */
  135.      AllPlanes },   /* unsigned long mask; */
  136.    {          /* GCspec white;        for drawing white lines */
  137.      0,            /* unsigned long foreground; */
  138.      U_DONT_CARE,   /* unsigned long background; */
  139.      GXcopy,        /* int func; */
  140.      AllPlanes } }, /* unsigned long mask; */
  141.  {        /* struct colorTable ctable;    pseudocolor vertex table */
  142.    {          /* struct subtableRec red; */
  143.      0,            /* int fixed_cells;        direct cellmap (no table) */
  144.      2,            /* int vertex_cnt;        number of vertices defined */
  145.      0,            /* int map_sz;        number of cells in map */
  146.      0,            /* int do_gamma;        if gamma correction != 1 */
  147.      0,            /* int invert_order;    order inverted */
  148.      0,            /* int pad;            space for allignment */
  149.      1.0,        /* double contrast;        cell=(base*contrast)+bias */
  150.      0.5,        /* double bias;        base=(cell-bias)/contrast */
  151.      1.0,        /* double gamma;        gamma correction factor */
  152.      { 0.0, 1.0 },  /* double cell_level[PSEUDOSZ];    cell levels */
  153.      {-0.5, 0.5 },  /* double base_level[PSEUDOSZ];    original levels */
  154.      { 0.0, 1.0 },  /* double intensity[PSEUDOSZ];    intensity by level */
  155.      { 0.0 },        /* double cellmap[COLMAPSZ];    intensity by cell */
  156.      { 0.0 } },        /* double gammamap[COLMAPSZ];    gamma corrected map */
  157.    {          /* struct subtableRec green; */
  158.      0,            /* int fixed_cells;        direct cellmap (no table) */
  159.      2,            /* int vertex_cnt;        number of vertices defined */
  160.      0,            /* int map_sz;        number of cells in map */
  161.      0,            /* int do_gamma;        if gamma correction != 1 */
  162.      0,            /* int invert_order;    order inverted */
  163.      0,            /* int pad;            space for allignment */
  164.      1.0,        /* double contrast;        cell=(base*contrast)+bias */
  165.      0.5,        /* double bias;        base=(cell-bias)/contrast */
  166.      1.0,        /* double gamma;        gamma correction factor */
  167.      { 0.0, 1.0 },  /* double cell_level[PSEUDOSZ];    cell levels */
  168.      {-0.5, 0.5 },  /* double base_level[PSEUDOSZ];    original levels */
  169.      { 0.0, 1.0 },  /* double intensity[PSEUDOSZ];    intensity by level */
  170.      { 0.0 },        /* double cellmap[COLMAPSZ];    intensity by cell */
  171.      { 0.0 } },        /* double gammamap[COLMAPSZ];    gamma corrected map */
  172.    {          /* struct subtableRec blue; */
  173.      0,            /* int fixed_cells;        direct cellmap (no table) */
  174.      2,            /* int vertex_cnt;        number of vertices defined */
  175.      0,            /* int map_sz;        number of cells in map */
  176.      0,            /* int do_gamma;        if gamma correction != 1 */
  177.      0,            /* int invert_order;    order inverted */
  178.      0,            /* int pad;            space for allignment */
  179.      1.0,        /* double contrast;        cell=(base*contrast)+bias */
  180.      0.5,        /* double bias;        base=(cell-bias)/contrast */
  181.      1.0,        /* double gamma;        gamma correction factor */
  182.      { 0.0, 1.0 },  /* double cell_level[PSEUDOSZ];    cell levels */
  183.      {-0.5, 0.5 },  /* double base_level[PSEUDOSZ];    original levels */
  184.      { 0.0, 1.0 },  /* double intensity[PSEUDOSZ];    intensity by level */
  185.      { 0.0 },        /* double cellmap[COLMAPSZ];    intensity by cell */
  186.      { 0.0 } } },   /* double gammamap[COLMAPSZ];    gamma corrected map */
  187.  { 0 },        /* unsigned long pixvalmap[COLMAPSZ];    byte to hardware val */
  188.  { 0 }        /* XColor cellstore[COLMAPSZ];        for setting colors */
  189. };
  190.