#include <extUtil.h>
#include <unistd.h>


extern Display       *dpy;
extern int           dpycells;
extern Colormap      cmap;
extern XColor        *xcolor;
extern unsigned long *pixels_return;
extern unsigned int  npixels;
extern int   basCol[3];

extern int offset, steps;

void calcOffset()
{
  offset = offset; 
}


void getColormap()
{
  register int i;
  double  r, g, b;

  if ( (pixels_return = (unsigned long *)malloc( 256 * sizeof(unsigned long))) == NULL )
    printf("\n\n ERROR: malloc failed in getColormap\n\n") ;
  if ( (xcolor = (XColor *)malloc( 256 * sizeof(XColor))) == NULL )
    printf("\n\n ERROR: malloc failed in getColormap\n\n") ;

  dpycells=256;
  npixels=100;
  offset = 10;
  for (i=0; i<npixels; i++) pixels_return[i]=i+offset;

    r = 0.;
    g = 0.;
    b = 0.;
    xcolor[0].red =   0;
    xcolor[0].green = 0;
    xcolor[0].blue =  0;
    glutSetColor( 0, r, g, b );
    r = 1.;
    g = 1.;
    b = 1.;
    xcolor[1].red =   65535;
    xcolor[1].green = 65535;
    xcolor[1].blue =  65535;
    glutSetColor( 1, r, g, b );
    r = .7;
    g = .7;
    b = .7;
    xcolor[2].red =   45875;
    xcolor[2].green = 45875;
    xcolor[2].blue =  45875;
    glutSetColor( 2, r, g, b );
    basCol[0]=0; /* black */
    basCol[1]=1; /* white */
    basCol[2]=2;

  for (i=3; i<256; i++)
    {
    xcolor[i].red = 65535;
    xcolor[i].green = 65535;
    xcolor[i].blue = 65535;
    }
}


void storeColors(int anz_col, int pix )
{
  return;
}
