Index: trunk/Ohana/src/opihi/dvo/images.c
===================================================================
--- trunk/Ohana/src/opihi/dvo/images.c	(revision 12728)
+++ trunk/Ohana/src/opihi/dvo/images.c	(revision 12750)
@@ -2,8 +2,15 @@
 # define BETA 0.41421
 
+int wordhash (char *word) {
+  int value;
+
+  value = *(int *)word;
+  return value;
+}
+
 int images (int argc, char **argv) {
 
   int i, j, Nimage, status, InPic, leftside, *plist, TimeSelect, ByName;
-  int WITH_MOSAIC, SOLO_MOSAIC;
+  int WITH_MOSAIC, SOLO_MOSAIC, HIDDEN;
   time_t tzero, tend;
   int N, NPTS, n, npts, Npts;
@@ -13,4 +20,5 @@
   Graphdata graphmode;
   char name[256];
+  int typehash;
 
   if (!style_args (&graphmode, &argc, argv, 0)) return FALSE;
@@ -26,4 +34,11 @@
     remove_argument (N, &argc, argv);
     SOLO_MOSAIC = TRUE;
+    WITH_MOSAIC = TRUE;
+  }
+
+  HIDDEN = FALSE;
+  if ((N = get_argument (argc, argv, "-hidden"))) {
+    remove_argument (N, &argc, argv);
+    HIDDEN = TRUE;
   }
 
@@ -96,4 +111,8 @@
   Rmid = 0.5*(Rmin + Rmax);
   
+  int DistortImage = wordhash ("-DIS");
+  int TriangleUp   = wordhash ("TRP-");
+  int TriangleDn   = wordhash ("TRM-");
+
   npts = NPTS = 200;
   ALLOCATE (Xvec.elements, float, NPTS);
@@ -106,15 +125,39 @@
     if (!FindMosaicForImage (image, Nimage, i)) continue;
 
-    if (!strcmp(&image[i].coords.ctype[4], "-DIS") && !WITH_MOSAIC) continue;
-    if ( strcmp(&image[i].coords.ctype[4], "-DIS") &&  SOLO_MOSAIC) continue;
-
-    /* project this image to screen display coords */
+    Npts = 4;
+    status = TRUE;
+    leftside = FALSE;
+
+    typehash = wordhash (&image[i].coords.ctype[4]);
+
     /* DIS images represent a field, not a chip */
-    if (!strcmp(&image[i].coords.ctype[4], "-DIS")) {
+    if ((typehash == DistortImage) && !WITH_MOSAIC) continue;
+    if ((typehash != DistortImage) &&  SOLO_MOSAIC) continue;
+    if (typehash == DistortImage) {
       x[0] = -0.5*image[i].NX; y[0] = -0.5*image[i].NY;
       x[1] = +0.5*image[i].NX; y[1] = -0.5*image[i].NY;
       x[2] = +0.5*image[i].NX; y[2] = +0.5*image[i].NY;
       x[3] = -0.5*image[i].NX; y[3] = +0.5*image[i].NY;
-    } else {
+      goto got_type;
+    }
+
+    typehash = wordhash (image[i].coords.ctype);
+    if (typehash == TriangleUp) {
+      Npts = 3;
+      x[0] =                0; y[0] = +0.5*image[i].NY;
+      x[1] = +0.5*image[i].NX; y[1] = -0.5*image[i].NY;
+      x[2] = -0.5*image[i].NX; y[2] = -0.5*image[i].NY;
+      goto got_type;
+    }
+    if (typehash == TriangleDn) {
+      Npts = 3;
+      x[0] =                0; y[0] = -0.5*image[i].NY;
+      x[1] = +0.5*image[i].NX; y[1] = +0.5*image[i].NY;
+      x[2] = -0.5*image[i].NX; y[2] = +0.5*image[i].NY;
+      goto got_type;
+    }
+
+    // default layout
+    {
       x[0] = 0;           y[0] = 0;
       x[1] = image[i].NX; y[1] = 0;
@@ -123,8 +166,9 @@
     }
 
-    Npts = 4;
-    status = TRUE;
-    leftside = FALSE;
-    for (j = 0; j < 4; j++) {
+  got_type:
+
+    /* project this image to screen display coords */
+    // check for boundary overlap?
+    for (j = 0; j < Npts; j++) {
       status = XY_to_RD (&r[j], &d[j], x[j], y[j], &image[i].coords);
       if (!status) break;
@@ -203,4 +247,5 @@
 	InPic = TRUE;
     }
+    if (!status && HIDDEN) status = TRUE;
     if (InPic && status) {
       plist[n] = i;
