Index: /branches/eam_branch_20071222/Ohana/src/kapa2/include/structures.h
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/include/structures.h	(revision 15905)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/include/structures.h	(revision 15906)
@@ -14,10 +14,10 @@
   int            x,  y;
   unsigned int   dx, dy;
-  XColor         cmap[256];
+  XColor         cmap[1024];
   Colormap       colormap;
   unsigned long  fore;
   unsigned long  back;
   unsigned long  *color;
-  unsigned long  pixels[256];
+  unsigned long  pixels[1024];
   unsigned long  overlay_color[NOVERLAYS];
   int Npixels;
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/CheckVisual.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/CheckVisual.c	(revision 15905)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/CheckVisual.c	(revision 15906)
@@ -177,5 +177,5 @@
 
   if (!dyn) {
-    graphic[0].Npixels = 256;
+    graphic[0].Npixels = 1024;
     // fprintf (stderr, "can't use dynamic colors, color scrollbar inactive\n");
     // fprintf (stderr, " this can be avoided by using a dynamic visual class\n");
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/InterpretKeys.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/InterpretKeys.c	(revision 15905)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/InterpretKeys.c	(revision 15906)
@@ -132,4 +132,13 @@
       break;
 
+    case XK_KP_Add:
+      image[0].zero += 0.1*image[0].range;
+      Reorient (graphic, image, image[0].X, image[0].Y, 0);
+      break;
+    case XK_KP_Subtract:
+      image[0].zero -= 0.1*image[0].range;
+      Reorient (graphic, image, image[0].X, image[0].Y, 0);
+      break;
+
     case XK_Tab:
       image[0].MovePointer = image[0].MovePointer ^ TRUE;
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/Remap32.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/Remap32.c	(revision 15905)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/Remap32.c	(revision 15906)
@@ -6,4 +6,7 @@
 
 // XXX inline this if needed
+# define PixelLookup(VALUE) (int)(MIN (MAX (slope * VALUE - start, 0), MaxValue))
+
+# if  (0)
 static int PixelLookup(float value) {
   int out;
@@ -11,4 +14,5 @@
   return (out);
 }
+# endif
 
 void Remap32 (Graphic *graphic, KapaImageWidget *image, Matrix *matrix) {
@@ -22,9 +26,11 @@
   unsigned int *out_pix, *out_pix2;
   float *imdata, *in_pix, *in_pix2;
-  unsigned long pixel[256], pixvalue;
+  unsigned long *pixel, pixvalue;
   unsigned long back;
 
+  ALLOCATE (pixel, unsigned long, graphic[0].Npixels);
+
   // local array for pixel values
-  for (i = 0; i < 256; i++) { 
+  for (i = 0; i < graphic[0].Npixels; i++) { 
     pixel[i] = graphic[0].cmap[i].pixel;
   }
@@ -154,4 +160,6 @@
   image[0].picture.pix = XCreateImage (graphic[0].display, graphic[0].visual, graphic[0].depth, ZPixmap, 0, 
 					image[0].picture.data, image[0].picture.dx, image[0].picture.dy, 32, 0);
+
+  free (pixel);
 }
 
Index: /branches/eam_branch_20071222/Ohana/src/kapa2/src/SetColormap.c
===================================================================
--- /branches/eam_branch_20071222/Ohana/src/kapa2/src/SetColormap.c	(revision 15905)
+++ /branches/eam_branch_20071222/Ohana/src/kapa2/src/SetColormap.c	(revision 15906)
@@ -4,7 +4,10 @@
      first to get better control over the smooth greyscales ***/
 
+/** red,green,blue are values in range 0x0000 to 0xffff **/
+
 int SetColormap (char *name) {
 
   int i;
+  float scale;
   Graphic *graphic;
 
@@ -13,8 +16,21 @@
   /* greyscale */
   if ((!strcmp (name, "grayscale")) || (!strcmp (name, "greyscale"))) {
+
+    scale = 0xffff / graphic[0].Npixels;
+
     for (i = 0; i < graphic[0].Npixels; i++) {  
-      graphic[0].cmap[i].red = 256*(255 - 255*i/graphic[0].Npixels);
-      graphic[0].cmap[i].green = 256*(255 - 255*i/graphic[0].Npixels);
-      graphic[0].cmap[i].blue = 256*(255 - 255*i/graphic[0].Npixels);
+      graphic[0].cmap[i].red   = 0xffff - i*scale;
+      graphic[0].cmap[i].green = 0xffff - i*scale;
+      graphic[0].cmap[i].blue  = 0xffff - i*scale;
+      graphic[0].cmap[i].flags = DoRed | DoGreen | DoBlue;
+    }
+    goto store_colors;
+  }
+  /* -grayscale */
+  if ((!strcmp (name, "-grayscale")) || (!strcmp (name, "-greyscale"))) {
+    for (i = 0; i < graphic[0].Npixels; i++) {  
+      graphic[0].cmap[i].red = 256*(255*i/graphic[0].Npixels);
+      graphic[0].cmap[i].green = 256*(255*i/graphic[0].Npixels);
+      graphic[0].cmap[i].blue = 256*(255*i/graphic[0].Npixels);
       graphic[0].cmap[i].flags = DoRed | DoGreen | DoBlue;
     }
@@ -45,14 +61,4 @@
       graphic[0].cmap[i].green = 256*255;
       graphic[0].cmap[i].blue = MIN (256*255, 256*255*2*(i/(1.0*graphic[0].Npixels) - 0.50));
-      graphic[0].cmap[i].flags = DoRed | DoGreen | DoBlue;
-    }
-    goto store_colors;
-  }
-  /* -grayscale */
-  if ((!strcmp (name, "-grayscale")) || (!strcmp (name, "-greyscale"))) {
-    for (i = 0; i < graphic[0].Npixels; i++) {  
-      graphic[0].cmap[i].red = 256*(255*i/graphic[0].Npixels);
-      graphic[0].cmap[i].green = 256*(255*i/graphic[0].Npixels);
-      graphic[0].cmap[i].blue = 256*(255*i/graphic[0].Npixels);
       graphic[0].cmap[i].flags = DoRed | DoGreen | DoBlue;
     }
