Main Page   Data Structures   File List   Data Fields   Globals  

Sadie_Contrast.c

Go to the documentation of this file.
00001 /*
00002 ##########################################
00003 # Sadie_Contrast.c -
00004 #   Set of routines for linking SADIE contrast routines to tcl/tk.
00005 #
00006 # RCS: $Id: Sadie_Contrast.c,v 2.4 1999/02/11 14:33:03 conner Exp $ 
00007 # 
00008 # Digital Image Analysis Lab
00009 # Dept. of Electrical and Computer Engineering
00010 # University of Arizona
00011 ##########################################
00012 */
00013 
00014 #include <tcl.h>
00015 #include <tk.h>
00016 #include "sadie.h"
00017 
00018 /* RCS Indentification information */
00019 static char rcsid[] =
00020   "$Id: Sadie_Contrast.c,v 2.4 1999/02/11 14:33:03 conner Exp $";
00021 
00022 /*-------------------------------------------------------------*/
00023 /* Global Sadie variables that must be set from within Tcl/Tk  */
00024 /*-------------------------------------------------------------*/
00025 extern short nlev;
00026 extern short csize;
00027 extern double weight;
00028 extern double *count;
00029 extern PIXEL gain;
00030 extern PIXEL bias;
00031 extern PIXEL gmin;
00032 extern PIXEL gmax;
00033 extern PIXEL thresh;
00034 extern PIXEL gbrk[2][4];
00035 extern PIXEL *table;
00036 /* -------------------------------------------------------------------------- */
00037 
00038 /*-Copyright Information------------------------------------------------------*/
00039 /* Copyright (c) 1999 by the University of Arizona Digital Image Analysis Lab */
00040 /*----------------------------------------------------------------------------*/
00041 /*-General Information--------------------------------------------------------*/
00042 /*                                                                            */
00043 /*   This procedure provides an interface to the SADIE function               */
00044 /*   CONTNORM from Tcl/Tk.  It expects a tcl global array                     */
00045 /*   with these indices to exist:                                             */
00046 /*      array(inimg,addr)         --  SADIE image address                     */
00047 /*      array(incr)               --  int                                     */
00048 /*      array(sigma)              --  double                                  */
00049 /*      array(mean)               --  PIXEL                                   */
00050 /*      array(outname)            --  char*                                   */
00051 /*                                                                            */
00052 /*----------------------------------------------------------------------------*/
00053 /*-Interface Information------------------------------------------------------*/
00054 int
00055 Sadie_Contrast_NormStretchCmd (ClientData client_data, Tcl_Interp * interp,
00056                                int argc, char *argv[])
00057 {
00058   Tcl_Obj *tclobj = NULL;
00059   Tcl_Obj *tclarrayname = NULL;
00060   Tcl_Obj *tclindexname = NULL;
00061   char msg[SLEN];
00062   char *array = NULL;
00063   char *tempstr = NULL;
00064   int strlen;
00065   int inimgaddr;
00066   IMAGE *inimg = NULL;
00067   int outimgaddr;
00068   IMAGE *outimg = NULL;
00069   char *outname = NULL;
00070   int incr;
00071   double sigma;
00072   PIXEL mean;
00073   double tempdouble;
00074 
00075   if (argc != 2)
00076     {
00077       Tcl_AppendResult (interp, "wrong # args: should be \"",
00078                         argv[0], " arrayname\"", (char *) NULL);
00079       return TCL_ERROR;
00080     }
00081   array = argv[1];
00082 
00083   /* Read input image array(inimg,addr) */
00084   tclarrayname = Tcl_NewStringObj (array, -1);
00085   tclindexname = Tcl_NewStringObj ("inimg,addr", -1);
00086   if (tclobj =
00087       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
00088                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
00089     {
00090 
00091       tempstr = Tcl_GetStringFromObj (tclobj, &strlen);
00092       if (strlen <= 0)
00093         return TCL_ERROR;
00094       sscanf (tempstr, "%x", &inimgaddr);
00095       inimg = (IMAGE *) inimgaddr;
00096     }
00097   else
00098     {
00099       return TCL_ERROR;
00100     }
00101   Tcl_DecrRefCount (tclarrayname);
00102   Tcl_DecrRefCount (tclindexname);
00103 
00104   /* Read the input integer array(incr) */
00105   tclarrayname = Tcl_NewStringObj (array, -1);
00106   tclindexname = Tcl_NewStringObj ("incr", -1);
00107   if (tclobj =
00108       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
00109                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
00110     {
00111 
00112       if (Tcl_GetIntFromObj (interp, tclobj, &incr) == TCL_ERROR)
00113         return TCL_ERROR;
00114     }
00115   else
00116     {
00117       return TCL_ERROR;
00118     }
00119   Tcl_DecrRefCount (tclarrayname);
00120   Tcl_DecrRefCount (tclindexname);
00121 
00122   /* Read the input double array(sigma) */
00123   tclarrayname = Tcl_NewStringObj (array, -1);
00124   tclindexname = Tcl_NewStringObj ("sigma", -1);
00125   if (tclobj =
00126       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
00127                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
00128     {
00129 
00130       if (Tcl_GetDoubleFromObj (interp, tclobj, &sigma) == TCL_ERROR)
00131         return TCL_ERROR;
00132     }
00133   else
00134     {
00135       return TCL_ERROR;
00136     }
00137   Tcl_DecrRefCount (tclarrayname);
00138   Tcl_DecrRefCount (tclindexname);
00139 
00140   /* Read the input PIXEL array(mean) */
00141   tclarrayname = Tcl_NewStringObj (array, -1);
00142   tclindexname = Tcl_NewStringObj ("mean", -1);
00143   if (tclobj =
00144       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
00145                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
00146     {
00147 
00148       if (Tcl_GetDoubleFromObj (interp, tclobj, &tempdouble) == TCL_ERROR)
00149         return TCL_ERROR;
00150       mean = (PIXEL) tempdouble;
00151     }
00152   else
00153     {
00154       return TCL_ERROR;
00155     }
00156   Tcl_DecrRefCount (tclarrayname);
00157   Tcl_DecrRefCount (tclindexname);
00158 
00159   /* Read the output image 1 name */
00160   tclarrayname = Tcl_NewStringObj (array, -1);
00161   tclindexname = Tcl_NewStringObj ("outname", -1);
00162   if (tclobj =
00163       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
00164                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
00165     {
00166 
00167       outname = Tcl_GetStringFromObj (tclobj, &strlen);
00168       if (strlen <= 0)
00169         return TCL_ERROR;
00170     }
00171   else
00172     {
00173       return TCL_ERROR;
00174     }
00175   Tcl_DecrRefCount (tclarrayname);
00176   Tcl_DecrRefCount (tclindexname);
00177 
00178   CONTNORM (inimg, mean, sigma, incr, &outimg);
00179 
00180   if (CHECKIMG (outimg))
00181     sprintf (outimg->text, "%s", outname);
00182   outimgaddr = (int) outimg;
00183 
00184   sprintf (msg, "%x", outimgaddr);
00185   Tcl_SetResult (interp, msg, TCL_VOLATILE);
00186 
00187   return TCL_OK;
00188 }
00189 
00190 /*-Copyright Information------------------------------------------------------*/
00191 /* Copyright (c) 1999 by the University of Arizona Digital Image Analysis Lab */
00192 /*----------------------------------------------------------------------------*/
00193 /*-General Information--------------------------------------------------------*/
00194 /*                                                                            */
00195 /*   This procedure provides an interface to the SADIE function               */
00196 /*   HISTEQ from Tcl/Tk.  It expects a tcl global array                       */
00197 /*   with these indices to exist:                                             */
00198 /*      array(inimg,addr)         --  SADIE image address                     */
00199 /*      array(res)                --  int                                     */
00200 /*      array(incr)               --  int                                     */
00201 /*      array(outname)            --  char*                                   */
00202 /*                                                                            */
00203 /*----------------------------------------------------------------------------*/
00204 /*-Interface Information------------------------------------------------------*/
00205 int
00206 Sadie_Contrast_HisteqStretchCmd (ClientData client_data, Tcl_Interp * interp,
00207                                  int argc, char *argv[])
00208 {
00209   Tcl_Obj *tclobj = NULL;
00210   Tcl_Obj *tclarrayname = NULL;
00211   Tcl_Obj *tclindexname = NULL;
00212   char msg[SLEN];
00213   char *array = NULL;
00214   char *tempstr = NULL;
00215   int strlen;
00216   int inimgaddr;
00217   IMAGE *inimg = NULL;
00218   int outimgaddr;
00219   IMAGE *outimg = NULL;
00220   char *outname = NULL;
00221   int res, incr;
00222 
00223   if (argc != 2)
00224     {
00225       Tcl_AppendResult (interp, "wrong # args: should be \"",
00226                         argv[0], " arrayname\"", (char *) NULL);
00227       return TCL_ERROR;
00228     }
00229   array = argv[1];
00230 
00231   /* Read input image array(inimg,addr) */
00232   tclarrayname = Tcl_NewStringObj (array, -1);
00233   tclindexname = Tcl_NewStringObj ("inimg,addr", -1);
00234   if (tclobj =
00235       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
00236                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
00237     {
00238 
00239       tempstr = Tcl_GetStringFromObj (tclobj, &strlen);
00240       if (strlen <= 0)
00241         return TCL_ERROR;
00242       sscanf (tempstr, "%x", &inimgaddr);
00243       inimg = (IMAGE *) inimgaddr;
00244     }
00245   else
00246     {
00247       return TCL_ERROR;
00248     }
00249   Tcl_DecrRefCount (tclarrayname);
00250   Tcl_DecrRefCount (tclindexname);
00251 
00252   /* Read the input integer array(res) */
00253   tclarrayname = Tcl_NewStringObj (array, -1);
00254   tclindexname = Tcl_NewStringObj ("res", -1);
00255   if (tclobj =
00256       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
00257                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
00258     {
00259 
00260       if (Tcl_GetIntFromObj (interp, tclobj, &res) == TCL_ERROR)
00261         return TCL_ERROR;
00262     }
00263   else
00264     {
00265       return TCL_ERROR;
00266     }
00267   Tcl_DecrRefCount (tclarrayname);
00268   Tcl_DecrRefCount (tclindexname);
00269 
00270   /* Read the input integer array(incr) */
00271   tclarrayname = Tcl_NewStringObj (array, -1);
00272   tclindexname = Tcl_NewStringObj ("incr", -1);
00273   if (tclobj =
00274       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
00275                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
00276     {
00277 
00278       if (Tcl_GetIntFromObj (interp, tclobj, &incr) == TCL_ERROR)
00279         return TCL_ERROR;
00280     }
00281   else
00282     {
00283       return TCL_ERROR;
00284     }
00285   Tcl_DecrRefCount (tclarrayname);
00286   Tcl_DecrRefCount (tclindexname);
00287 
00288   /* Read the output image 1 name */
00289   tclarrayname = Tcl_NewStringObj (array, -1);
00290   tclindexname = Tcl_NewStringObj ("outname", -1);
00291   if (tclobj =
00292       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
00293                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
00294     {
00295 
00296       outname = Tcl_GetStringFromObj (tclobj, &strlen);
00297       if (strlen <= 0)
00298         return TCL_ERROR;
00299     }
00300   else
00301     {
00302       return TCL_ERROR;
00303     }
00304   Tcl_DecrRefCount (tclarrayname);
00305   Tcl_DecrRefCount (tclindexname);
00306 
00307   HISTEQ (inimg, res, incr, &outimg);
00308 
00309   if (CHECKIMG (outimg))
00310     sprintf (outimg->text, "%s", outname);
00311   outimgaddr = (int) outimg;
00312 
00313   sprintf (msg, "%x", outimgaddr);
00314   Tcl_SetResult (interp, msg, TCL_VOLATILE);
00315 
00316   return TCL_OK;
00317 }
00318 
00319 /*-Copyright Information------------------------------------------------------*/
00320 /* Copyright (c) 1999 by the University of Arizona Digital Image Analysis Lab */
00321 /*----------------------------------------------------------------------------*/
00322 /*-General Information--------------------------------------------------------*/
00323 /*                                                                            */
00324 /*   This procedure provides an interface to the SADIE function               */
00325 /*   STRETCH from Tcl/Tk.  It expects a tcl global array                      */
00326 /*   with these indices to exist:                                             */
00327 /*      array(inimg,addr)         --  SADIE image address                     */
00328 /*      array(minorbias)          --  PIXEL                                   */
00329 /*      array(maxorgain)          --  PIXEL                                   */
00330 /*      array(type)               --  int                                     */
00331 /*      array(outname)            --  char*                                   */
00332 /*                                                                            */
00333 /*----------------------------------------------------------------------------*/
00334 /*-Interface Information------------------------------------------------------*/
00335 int
00336 Sadie_Contrast_LinearStretchCmd (ClientData client_data, Tcl_Interp * interp,
00337                                  int argc, char *argv[])
00338 {
00339   Tcl_Obj *tclobj = NULL;
00340   Tcl_Obj *tclarrayname = NULL;
00341   Tcl_Obj *tclindexname = NULL;
00342   char msg[SLEN];
00343   char *array = NULL;
00344   char *tempstr = NULL;
00345   int strlen;
00346   int inimgaddr;
00347   IMAGE *inimg = NULL;
00348   int outimgaddr;
00349   IMAGE *outimg = NULL;
00350   char *outname = NULL;
00351   double minorbias, maxorgain;
00352   int type;
00353 
00354   if (argc != 2)
00355     {
00356       Tcl_AppendResult (interp, "wrong # args: should be \"",
00357                         argv[0], " arrayname\"", (char *) NULL);
00358       return TCL_ERROR;
00359     }
00360   array = argv[1];
00361 
00362   /* Read input image array(inimg,addr) */
00363   tclarrayname = Tcl_NewStringObj (array, -1);
00364   tclindexname = Tcl_NewStringObj ("inimg,addr", -1);
00365   if (tclobj =
00366       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
00367                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
00368     {
00369 
00370       tempstr = Tcl_GetStringFromObj (tclobj, &strlen);
00371       if (strlen <= 0)
00372         return TCL_ERROR;
00373       sscanf (tempstr, "%x", &inimgaddr);
00374       inimg = (IMAGE *) inimgaddr;
00375     }
00376   else
00377     {
00378       return TCL_ERROR;
00379     }
00380   Tcl_DecrRefCount (tclarrayname);
00381   Tcl_DecrRefCount (tclindexname);
00382 
00383   /* Read the input integer array(minorbias) */
00384   tclarrayname = Tcl_NewStringObj (array, -1);
00385   tclindexname = Tcl_NewStringObj ("minorbias", -1);
00386   if (tclobj =
00387       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
00388                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
00389     {
00390 
00391       if (Tcl_GetDoubleFromObj (interp, tclobj, &minorbias) == TCL_ERROR)
00392         return TCL_ERROR;
00393     }
00394   else
00395     {
00396       return TCL_ERROR;
00397     }
00398   Tcl_DecrRefCount (tclarrayname);
00399   Tcl_DecrRefCount (tclindexname);
00400 
00401   /* Read the input integer array(maxorgain) */
00402   tclarrayname = Tcl_NewStringObj (array, -1);
00403   tclindexname = Tcl_NewStringObj ("maxorgain", -1);
00404   if (tclobj =
00405       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
00406                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
00407     {
00408 
00409       if (Tcl_GetDoubleFromObj (interp, tclobj, &maxorgain) == TCL_ERROR)
00410         return TCL_ERROR;
00411     }
00412   else
00413     {
00414       return TCL_ERROR;
00415     }
00416   Tcl_DecrRefCount (tclarrayname);
00417   Tcl_DecrRefCount (tclindexname);
00418 
00419   /* Read the input integer array(type) */
00420   tclarrayname = Tcl_NewStringObj (array, -1);
00421   tclindexname = Tcl_NewStringObj ("type", -1);
00422   if (tclobj =
00423       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
00424                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
00425     {
00426 
00427       if (Tcl_GetIntFromObj (interp, tclobj, &type) == TCL_ERROR)
00428         return TCL_ERROR;
00429     }
00430   else
00431     {
00432       return TCL_ERROR;
00433     }
00434   Tcl_DecrRefCount (tclarrayname);
00435   Tcl_DecrRefCount (tclindexname);
00436 
00437   /* Read the output image 1 name */
00438   tclarrayname = Tcl_NewStringObj (array, -1);
00439   tclindexname = Tcl_NewStringObj ("outname", -1);
00440   if (tclobj =
00441       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
00442                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
00443     {
00444 
00445       outname = Tcl_GetStringFromObj (tclobj, &strlen);
00446       if (strlen <= 0)
00447         return TCL_ERROR;
00448     }
00449   else
00450     {
00451       return TCL_ERROR;
00452     }
00453   Tcl_DecrRefCount (tclarrayname);
00454   Tcl_DecrRefCount (tclindexname);
00455 
00456   if (type == 0)
00457     {
00458       gmin = (PIXEL) minorbias;
00459       gmax = (PIXEL) maxorgain;
00460       STRETCH (inimg, TFSCALE, &outimg);
00461     }
00462   else
00463     {
00464       bias = (PIXEL) minorbias;
00465       gain = (PIXEL) maxorgain;
00466       STRETCH (inimg, TFLINEAR, &outimg);
00467     }
00468 
00469   if (CHECKIMG (outimg))
00470     sprintf (outimg->text, "%s", outname);
00471   outimgaddr = (int) outimg;
00472 
00473   sprintf (msg, "%x", outimgaddr);
00474   Tcl_SetResult (interp, msg, TCL_VOLATILE);
00475 
00476   return TCL_OK;
00477 }
00478 
00479 /*-Copyright Information------------------------------------------------------*/
00480 /* Copyright (c) 1999 by the University of Arizona Digital Image Analysis Lab */
00481 /*----------------------------------------------------------------------------*/
00482 /*-General Information--------------------------------------------------------*/
00483 /*                                                                            */
00484 /*   This procedure provides an interface to the SADIE function               */
00485 /*   STRETCH from Tcl/Tk.  It expects a tcl global array                      */
00486 /*   with these indices to exist:                                             */
00487 /*      array(inimg,addr)         --  SADIE image address                     */
00488 /*      array(outname)            --  char*                                   */
00489 /*                                                                            */
00490 /*----------------------------------------------------------------------------*/
00491 /*-Interface Information------------------------------------------------------*/
00492 int
00493 Sadie_Contrast_LogStretchCmd (ClientData client_data, Tcl_Interp * interp,
00494                               int argc, char *argv[])
00495 {
00496   Tcl_Obj *tclobj = NULL;
00497   Tcl_Obj *tclarrayname = NULL;
00498   Tcl_Obj *tclindexname = NULL;
00499   char msg[SLEN];
00500   char *array = NULL;
00501   char *tempstr = NULL;
00502   int strlen;
00503   int inimgaddr;
00504   IMAGE *inimg = NULL;
00505   int outimgaddr;
00506   IMAGE *outimg = NULL;
00507   char *outname = NULL;
00508 
00509   if (argc != 2)
00510     {
00511       Tcl_AppendResult (interp, "wrong # args: should be \"",
00512                         argv[0], " arrayname\"", (char *) NULL);
00513       return TCL_ERROR;
00514     }
00515   array = argv[1];
00516 
00517   /* Read input image array(inimg,addr) */
00518   tclarrayname = Tcl_NewStringObj (array, -1);
00519   tclindexname = Tcl_NewStringObj ("inimg,addr", -1);
00520   if (tclobj =
00521       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
00522                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
00523     {
00524 
00525       tempstr = Tcl_GetStringFromObj (tclobj, &strlen);
00526       if (strlen <= 0)
00527         return TCL_ERROR;
00528       sscanf (tempstr, "%x", &inimgaddr);
00529       inimg = (IMAGE *) inimgaddr;
00530     }
00531   else
00532     {
00533       return TCL_ERROR;
00534     }
00535   Tcl_DecrRefCount (tclarrayname);
00536   Tcl_DecrRefCount (tclindexname);
00537 
00538   /* Read the output image 1 name */
00539   tclarrayname = Tcl_NewStringObj (array, -1);
00540   tclindexname = Tcl_NewStringObj ("outname", -1);
00541   if (tclobj =
00542       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
00543                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
00544     {
00545 
00546       outname = Tcl_GetStringFromObj (tclobj, &strlen);
00547       if (strlen <= 0)
00548         return TCL_ERROR;
00549     }
00550   else
00551     {
00552       return TCL_ERROR;
00553     }
00554   Tcl_DecrRefCount (tclarrayname);
00555   Tcl_DecrRefCount (tclindexname);
00556 
00557   STRETCH (inimg, TFLOG, &outimg);
00558 
00559   if (CHECKIMG (outimg))
00560     sprintf (outimg->text, "%s", outname);
00561   outimgaddr = (int) outimg;
00562 
00563   sprintf (msg, "%x", outimgaddr);
00564   Tcl_SetResult (interp, msg, TCL_VOLATILE);
00565 
00566   return TCL_OK;
00567 }
00568 
00569 /*-Copyright Information------------------------------------------------------*/
00570 /* Copyright (c) 1999 by the University of Arizona Digital Image Analysis Lab */
00571 /*----------------------------------------------------------------------------*/
00572 /*-General Information--------------------------------------------------------*/
00573 /*                                                                            */
00574 /*   This procedure provides an interface to the SADIE function               */
00575 /*   STRETCH from Tcl/Tk.  It expects a tcl global array                      */
00576 /*   with these indices to exist:                                             */
00577 /*      array(inimg,addr)         --  SADIE image address                     */
00578 /*      array(in1)                --  double                                  */
00579 /*      array(in2)                --  double                                  */
00580 /*      array(in3)                --  double                                  */
00581 /*      array(in4)                --  double                                  */
00582 /*      array(out1)               --  double                                  */
00583 /*      array(out2)               --  double                                  */
00584 /*      array(out3)               --  double                                  */
00585 /*      array(out4)               --  double                                  */
00586 /*      array(outname)            --  char*                                   */
00587 /*                                                                            */
00588 /*----------------------------------------------------------------------------*/
00589 /*-Interface Information------------------------------------------------------*/
00590 int
00591 Sadie_Contrast_PWLStretchCmd (ClientData client_data, Tcl_Interp * interp,
00592                               int argc, char *argv[])
00593 {
00594   Tcl_Obj *tclobj = NULL;
00595   Tcl_Obj *tclarrayname = NULL;
00596   Tcl_Obj *tclindexname = NULL;
00597   char msg[SLEN];
00598   char *array = NULL;
00599   char *tempstr = NULL;
00600   int strlen;
00601   int inimgaddr;
00602   IMAGE *inimg = NULL;
00603   int outimgaddr;
00604   IMAGE *outimg = NULL;
00605   char *outname = NULL;
00606   double in1, in2, in3, in4, out1, out2, out3, out4;
00607 
00608   if (argc != 2)
00609     {
00610       Tcl_AppendResult (interp, "wrong # args: should be \"",
00611                         argv[0], " arrayname\"", (char *) NULL);
00612       return TCL_ERROR;
00613     }
00614   array = argv[1];
00615 
00616   /* Read input image array(inimg,addr) */
00617   tclarrayname = Tcl_NewStringObj (array, -1);
00618   tclindexname = Tcl_NewStringObj ("inimg,addr", -1);
00619   if (tclobj =
00620       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
00621                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
00622     {
00623 
00624       tempstr = Tcl_GetStringFromObj (tclobj, &strlen);
00625       if (strlen <= 0)
00626         return TCL_ERROR;
00627       sscanf (tempstr, "%x", &inimgaddr);
00628       inimg = (IMAGE *) inimgaddr;
00629     }
00630   else
00631     {
00632       return TCL_ERROR;
00633     }
00634   Tcl_DecrRefCount (tclarrayname);
00635   Tcl_DecrRefCount (tclindexname);
00636 
00637   /* Read the input double array(in1) */
00638   tclarrayname = Tcl_NewStringObj (array, -1);
00639   tclindexname = Tcl_NewStringObj ("in1", -1);
00640   if (tclobj =
00641       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
00642                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
00643     {
00644 
00645       if (Tcl_GetDoubleFromObj (interp, tclobj, &in1) == TCL_ERROR)
00646         return TCL_ERROR;
00647     }
00648   else
00649     {
00650       return TCL_ERROR;
00651     }
00652   Tcl_DecrRefCount (tclarrayname);
00653   Tcl_DecrRefCount (tclindexname);
00654 
00655   /* Read the input double array(in2) */
00656   tclarrayname = Tcl_NewStringObj (array, -1);
00657   tclindexname = Tcl_NewStringObj ("in2", -1);
00658   if (tclobj =
00659       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
00660                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
00661     {
00662 
00663       if (Tcl_GetDoubleFromObj (interp, tclobj, &in2) == TCL_ERROR)
00664         return TCL_ERROR;
00665     }
00666   else
00667     {
00668       return TCL_ERROR;
00669     }
00670   Tcl_DecrRefCount (tclarrayname);
00671   Tcl_DecrRefCount (tclindexname);
00672 
00673   /* Read the input double array(in3) */
00674   tclarrayname = Tcl_NewStringObj (array, -1);
00675   tclindexname = Tcl_NewStringObj ("in3", -1);
00676   if (tclobj =
00677       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
00678                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
00679     {
00680 
00681       if (Tcl_GetDoubleFromObj (interp, tclobj, &in3) == TCL_ERROR)
00682         return TCL_ERROR;
00683     }
00684   else
00685     {
00686       return TCL_ERROR;
00687     }
00688   Tcl_DecrRefCount (tclarrayname);
00689   Tcl_DecrRefCount (tclindexname);
00690 
00691   /* Read the input double array(in4) */
00692   tclarrayname = Tcl_NewStringObj (array, -1);
00693   tclindexname = Tcl_NewStringObj ("in4", -1);
00694   if (tclobj =
00695       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
00696                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
00697     {
00698 
00699       if (Tcl_GetDoubleFromObj (interp, tclobj, &in4) == TCL_ERROR)
00700         return TCL_ERROR;
00701     }
00702   else
00703     {
00704       return TCL_ERROR;
00705     }
00706   Tcl_DecrRefCount (tclarrayname);
00707   Tcl_DecrRefCount (tclindexname);
00708 
00709   /* Read the input double array(out1) */
00710   tclarrayname = Tcl_NewStringObj (array, -1);
00711   tclindexname = Tcl_NewStringObj ("out1", -1);
00712   if (tclobj =
00713       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
00714                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
00715     {
00716 
00717       if (Tcl_GetDoubleFromObj (interp, tclobj, &out1) == TCL_ERROR)
00718         return TCL_ERROR;
00719     }
00720   else
00721     {
00722       return TCL_ERROR;
00723     }
00724   Tcl_DecrRefCount (tclarrayname);
00725   Tcl_DecrRefCount (tclindexname);
00726 
00727   /* Read the input double array(out2) */
00728   tclarrayname = Tcl_NewStringObj (array, -1);
00729   tclindexname = Tcl_NewStringObj ("out2", -1);
00730   if (tclobj =
00731       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
00732                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
00733     {
00734 
00735       if (Tcl_GetDoubleFromObj (interp, tclobj, &out2) == TCL_ERROR)
00736         return TCL_ERROR;
00737     }
00738   else
00739     {
00740       return TCL_ERROR;
00741     }
00742   Tcl_DecrRefCount (tclarrayname);
00743   Tcl_DecrRefCount (tclindexname);
00744 
00745   /* Read the input double array(out3) */
00746   tclarrayname = Tcl_NewStringObj (array, -1);
00747   tclindexname = Tcl_NewStringObj ("out3", -1);
00748   if (tclobj =
00749       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
00750                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
00751     {
00752 
00753       if (Tcl_GetDoubleFromObj (interp, tclobj, &out3) == TCL_ERROR)
00754         return TCL_ERROR;
00755     }
00756   else
00757     {
00758       return TCL_ERROR;
00759     }
00760   Tcl_DecrRefCount (tclarrayname);
00761   Tcl_DecrRefCount (tclindexname);
00762 
00763   /* Read the input double array(out4) */
00764   tclarrayname = Tcl_NewStringObj (array, -1);
00765   tclindexname = Tcl_NewStringObj ("out4", -1);
00766   if (tclobj =
00767       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
00768                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
00769     {
00770 
00771       if (Tcl_GetDoubleFromObj (interp, tclobj, &out4) == TCL_ERROR)
00772         return TCL_ERROR;
00773     }
00774   else
00775     {
00776       return TCL_ERROR;
00777     }
00778   Tcl_DecrRefCount (tclarrayname);
00779   Tcl_DecrRefCount (tclindexname);
00780 
00781   /* Read the output image 1 name */
00782   tclarrayname = Tcl_NewStringObj (array, -1);
00783   tclindexname = Tcl_NewStringObj ("outname", -1);
00784   if (tclobj =
00785       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
00786                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
00787     {
00788 
00789       outname = Tcl_GetStringFromObj (tclobj, &strlen);
00790       if (strlen <= 0)
00791         return TCL_ERROR;
00792     }
00793   else
00794     {
00795       return TCL_ERROR;
00796     }
00797   Tcl_DecrRefCount (tclarrayname);
00798   Tcl_DecrRefCount (tclindexname);
00799 
00800   /* Fill graylevel breakpoint matrix */
00801   gbrk[0][0] = (PIXEL) in1;
00802   gbrk[0][1] = (PIXEL) in2;
00803   gbrk[0][2] = (PIXEL) in3;
00804   gbrk[0][3] = (PIXEL) in4;
00805   gbrk[1][0] = (PIXEL) out1;
00806   gbrk[1][1] = (PIXEL) out2;
00807   gbrk[1][2] = (PIXEL) out3;
00808   gbrk[1][3] = (PIXEL) out4;
00809 
00810   STRETCH (inimg, TFPLT, &outimg);
00811 
00812   if (CHECKIMG (outimg))
00813     sprintf (outimg->text, "%s", outname);
00814   outimgaddr = (int) outimg;
00815 
00816   sprintf (msg, "%x", outimgaddr);
00817   Tcl_SetResult (interp, msg, TCL_VOLATILE);
00818 
00819   return TCL_OK;
00820 }
00821 
00822 /*-Copyright Information------------------------------------------------------*/
00823 /* Copyright (c) 1999 by the University of Arizona Digital Image Analysis Lab */
00824 /*----------------------------------------------------------------------------*/
00825 /*-General Information--------------------------------------------------------*/
00826 /*                                                                            */
00827 /*   This procedure provides an interface to the SADIE function               */
00828 /*   STRETCH from Tcl/Tk.  It expects a tcl global array                      */
00829 /*   with these indices to exist:                                             */
00830 /*      array(inimg,addr)         --  SADIE image address                     */
00831 /*      array(outname)            --  char*                                   */
00832 /*                                                                            */
00833 /*----------------------------------------------------------------------------*/
00834 /*-Interface Information------------------------------------------------------*/
00835 int
00836 Sadie_Contrast_RootStretchCmd (ClientData client_data, Tcl_Interp * interp,
00837                                int argc, char *argv[])
00838 {
00839   Tcl_Obj *tclobj = NULL;
00840   Tcl_Obj *tclarrayname = NULL;
00841   Tcl_Obj *tclindexname = NULL;
00842   char msg[SLEN];
00843   char *array = NULL;
00844   char *tempstr = NULL;
00845   int strlen;
00846   int inimgaddr;
00847   IMAGE *inimg = NULL;
00848   int outimgaddr;
00849   IMAGE *outimg = NULL;
00850   char *outname = NULL;
00851 
00852   if (argc != 2)
00853     {
00854       Tcl_AppendResult (interp, "wrong # args: should be \"",
00855                         argv[0], " arrayname\"", (char *) NULL);
00856       return TCL_ERROR;
00857     }
00858   array = argv[1];
00859 
00860   /* Read input image array(inimg,addr) */
00861   tclarrayname = Tcl_NewStringObj (array, -1);
00862   tclindexname = Tcl_NewStringObj ("inimg,addr", -1);
00863   if (tclobj =
00864       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
00865                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
00866     {
00867 
00868       tempstr = Tcl_GetStringFromObj (tclobj, &strlen);
00869       if (strlen <= 0)
00870         return TCL_ERROR;
00871       sscanf (tempstr, "%x", &inimgaddr);
00872       inimg = (IMAGE *) inimgaddr;
00873     }
00874   else
00875     {
00876       return TCL_ERROR;
00877     }
00878   Tcl_DecrRefCount (tclarrayname);
00879   Tcl_DecrRefCount (tclindexname);
00880 
00881   /* Read the output image 1 name */
00882   tclarrayname = Tcl_NewStringObj (array, -1);
00883   tclindexname = Tcl_NewStringObj ("outname", -1);
00884   if (tclobj =
00885       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
00886                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
00887     {
00888 
00889       outname = Tcl_GetStringFromObj (tclobj, &strlen);
00890       if (strlen <= 0)
00891         return TCL_ERROR;
00892     }
00893   else
00894     {
00895       return TCL_ERROR;
00896     }
00897   Tcl_DecrRefCount (tclarrayname);
00898   Tcl_DecrRefCount (tclindexname);
00899 
00900   STRETCH (inimg, TFROOT, &outimg);
00901 
00902   if (CHECKIMG (outimg))
00903     sprintf (outimg->text, "%s", outname);
00904   outimgaddr = (int) outimg;
00905 
00906   sprintf (msg, "%x", outimgaddr);
00907   Tcl_SetResult (interp, msg, TCL_VOLATILE);
00908 
00909   return TCL_OK;
00910 }
00911 
00912 /*-Copyright Information------------------------------------------------------*/
00913 /* Copyright (c) 1999 by the University of Arizona Digital Image Analysis Lab */
00914 /*----------------------------------------------------------------------------*/
00915 /*-General Information--------------------------------------------------------*/
00916 /*                                                                            */
00917 /*   This procedure provides an interface to the SADIE function               */
00918 /*   STRETCH from Tcl/Tk.  It expects a tcl global array                      */
00919 /*   with these indices to exist:                                             */
00920 /*      array(inimg,addr)         --  SADIE image address                     */
00921 /*      array(outname)            --  char*                                   */
00922 /*                                                                            */
00923 /*----------------------------------------------------------------------------*/
00924 /*-Interface Information------------------------------------------------------*/
00925 int
00926 Sadie_Contrast_SqrStretchCmd (ClientData client_data, Tcl_Interp * interp,
00927                               int argc, char *argv[])
00928 {
00929   Tcl_Obj *tclobj = NULL;
00930   Tcl_Obj *tclarrayname = NULL;
00931   Tcl_Obj *tclindexname = NULL;
00932   char msg[SLEN];
00933   char *array = NULL;
00934   char *tempstr = NULL;
00935   int strlen;
00936   int inimgaddr;
00937   IMAGE *inimg = NULL;
00938   int outimgaddr;
00939   IMAGE *outimg = NULL;
00940   char *outname = NULL;
00941 
00942   if (argc != 2)
00943     {
00944       Tcl_AppendResult (interp, "wrong # args: should be \"",
00945                         argv[0], " arrayname\"", (char *) NULL);
00946       return TCL_ERROR;
00947     }
00948   array = argv[1];
00949 
00950   /* Read input image array(inimg,addr) */
00951   tclarrayname = Tcl_NewStringObj (array, -1);
00952   tclindexname = Tcl_NewStringObj ("inimg,addr", -1);
00953   if (tclobj =
00954       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
00955                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
00956     {
00957 
00958       tempstr = Tcl_GetStringFromObj (tclobj, &strlen);
00959       if (strlen <= 0)
00960         return TCL_ERROR;
00961       sscanf (tempstr, "%x", &inimgaddr);
00962       inimg = (IMAGE *) inimgaddr;
00963     }
00964   else
00965     {
00966       return TCL_ERROR;
00967     }
00968   Tcl_DecrRefCount (tclarrayname);
00969   Tcl_DecrRefCount (tclindexname);
00970 
00971   /* Read the output image 1 name */
00972   tclarrayname = Tcl_NewStringObj (array, -1);
00973   tclindexname = Tcl_NewStringObj ("outname", -1);
00974   if (tclobj =
00975       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
00976                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
00977     {
00978 
00979       outname = Tcl_GetStringFromObj (tclobj, &strlen);
00980       if (strlen <= 0)
00981         return TCL_ERROR;
00982     }
00983   else
00984     {
00985       return TCL_ERROR;
00986     }
00987   Tcl_DecrRefCount (tclarrayname);
00988   Tcl_DecrRefCount (tclindexname);
00989 
00990   STRETCH (inimg, TFSQUARE, &outimg);
00991 
00992   if (CHECKIMG (outimg))
00993     sprintf (outimg->text, "%s", outname);
00994   outimgaddr = (int) outimg;
00995 
00996   sprintf (msg, "%x", outimgaddr);
00997   Tcl_SetResult (interp, msg, TCL_VOLATILE);
00998 
00999   return TCL_OK;
01000 }
01001 
01002 /*-Copyright Information------------------------------------------------------*/
01003 /* Copyright (c) 1999 by the University of Arizona Digital Image Analysis Lab */
01004 /*----------------------------------------------------------------------------*/
01005 /*-General Information--------------------------------------------------------*/
01006 /*                                                                            */
01007 /*   This procedure provides an interface to the SADIE function               */
01008 /*   STRETCH from Tcl/Tk.  It expects a tcl global array                      */
01009 /*   with these indices to exist:                                             */
01010 /*      array(inimg,addr)         --  SADIE image address                     */
01011 /*      array(index,0-(nlev-1))   --  double                                  */
01012 /*      array(outname)            --  char*                                   */
01013 /*                                                                            */
01014 /*----------------------------------------------------------------------------*/
01015 /*-Interface Information------------------------------------------------------*/
01016 int
01017 Sadie_Contrast_TblStretchCmd (ClientData client_data, Tcl_Interp * interp,
01018                               int argc, char *argv[])
01019 {
01020   int i;
01021   Tcl_Obj *tclobj = NULL;
01022   Tcl_Obj *tclarrayname = NULL;
01023   Tcl_Obj *tclindexname = NULL;
01024   char msg[SLEN];
01025   char *array = NULL;
01026   char *tempstr = NULL;
01027   int strlen;
01028   int inimgaddr;
01029   IMAGE *inimg = NULL;
01030   int outimgaddr;
01031   IMAGE *outimg = NULL;
01032   char *outname = NULL;
01033   double tempdouble;
01034   char indexname[20];
01035 
01036   if (argc != 2)
01037     {
01038       Tcl_AppendResult (interp, "wrong # args: should be \"",
01039                         argv[0], " arrayname\"", (char *) NULL);
01040       return TCL_ERROR;
01041     }
01042   array = argv[1];
01043 
01044   /* Read input image array(inimg,addr) */
01045   tclarrayname = Tcl_NewStringObj (array, -1);
01046   tclindexname = Tcl_NewStringObj ("inimg,addr", -1);
01047   if (tclobj =
01048       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
01049                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
01050     {
01051 
01052       tempstr = Tcl_GetStringFromObj (tclobj, &strlen);
01053       if (strlen <= 0)
01054         return TCL_ERROR;
01055       sscanf (tempstr, "%x", &inimgaddr);
01056       inimg = (IMAGE *) inimgaddr;
01057     }
01058   else
01059     {
01060       return TCL_ERROR;
01061     }
01062   Tcl_DecrRefCount (tclarrayname);
01063   Tcl_DecrRefCount (tclindexname);
01064 
01065   /* Read the output image 1 name */
01066   tclarrayname = Tcl_NewStringObj (array, -1);
01067   tclindexname = Tcl_NewStringObj ("outname", -1);
01068   if (tclobj =
01069       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
01070                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
01071     {
01072 
01073       outname = Tcl_GetStringFromObj (tclobj, &strlen);
01074       if (strlen <= 0)
01075         return TCL_ERROR;
01076     }
01077   else
01078     {
01079       return TCL_ERROR;
01080     }
01081   Tcl_DecrRefCount (tclarrayname);
01082   Tcl_DecrRefCount (tclindexname);
01083 
01084   if (!CHECKIMG (inimg))
01085     {
01086       Tcl_AppendResult (interp, "Cannot read input image!", (char *) NULL);
01087       return TCL_ERROR;
01088     }
01089 
01090   nlev =
01091     (short) floor (inimg->gmax) - (short) floor (inimg->gmin) + (short) 1;
01092 
01093   table = NULL;
01094   table = (PIXEL *) malloc (sizeof (PIXEL) * nlev);
01095 
01096   for (i = 0; i < nlev; i++)
01097     {
01098       /* Read the input double array(index,i) */
01099       sprintf (indexname, "index,%d", i);
01100       tclarrayname = Tcl_NewStringObj (array, -1);
01101       tclindexname = Tcl_NewStringObj (indexname, -1);
01102       if (tclobj =
01103           Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
01104                           TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
01105         {
01106 
01107           if (Tcl_GetDoubleFromObj (interp, tclobj, &tempdouble) == TCL_ERROR)
01108             return TCL_ERROR;
01109         }
01110       else
01111         {
01112           return TCL_ERROR;
01113         }
01114       Tcl_DecrRefCount (tclarrayname);
01115       Tcl_DecrRefCount (tclindexname);
01116       table[i] = (PIXEL) tempdouble;
01117     }
01118 
01119   STRETCH (inimg, TFTABLE, &outimg);
01120 
01121   if (table)
01122     free (table);
01123 
01124   if (CHECKIMG (outimg))
01125     sprintf (outimg->text, "%s", outname);
01126   outimgaddr = (int) outimg;
01127 
01128   sprintf (msg, "%x", outimgaddr);
01129   Tcl_SetResult (interp, msg, TCL_VOLATILE);
01130 
01131   return TCL_OK;
01132 }
01133 
01134 /*-Copyright Information------------------------------------------------------*/
01135 /* Copyright (c) 1999 by the University of Arizona Digital Image Analysis Lab */
01136 /*----------------------------------------------------------------------------*/
01137 /*-General Information--------------------------------------------------------*/
01138 /*                                                                            */
01139 /*   This procedure provides an interface to the SADIE function               */
01140 /*   STRETCH from Tcl/Tk.  It expects a tcl global array                      */
01141 /*   with these indices to exist:                                             */
01142 /*      array(inimg,addr)         --  SADIE image address                     */
01143 /*      array(steps)              --  int                                     */
01144 /*      array(gmin)               --  PIXEL                                   */
01145 /*      array(gmax)               --  PIXEL                                   */
01146 /*      array(outname)            --  char*                                   */
01147 /*                                                                            */
01148 /*----------------------------------------------------------------------------*/
01149 /*-Interface Information------------------------------------------------------*/
01150 int
01151 Sadie_Contrast_QntStretchCmd (ClientData client_data, Tcl_Interp * interp,
01152                               int argc, char *argv[])
01153 {
01154   Tcl_Obj *tclobj = NULL;
01155   Tcl_Obj *tclarrayname = NULL;
01156   Tcl_Obj *tclindexname = NULL;
01157   char msg[SLEN];
01158   char *array = NULL;
01159   char *tempstr = NULL;
01160   int strlen;
01161   int inimgaddr;
01162   IMAGE *inimg = NULL;
01163   int outimgaddr;
01164   IMAGE *outimg = NULL;
01165   char *outname = NULL;
01166   int steps;
01167   double tempdouble;
01168 
01169   if (argc != 2)
01170     {
01171       Tcl_AppendResult (interp, "wrong # args: should be \"",
01172                         argv[0], " arrayname\"", (char *) NULL);
01173       return TCL_ERROR;
01174     }
01175   array = argv[1];
01176 
01177   /* Read input image array(inimg,addr) */
01178   tclarrayname = Tcl_NewStringObj (array, -1);
01179   tclindexname = Tcl_NewStringObj ("inimg,addr", -1);
01180   if (tclobj =
01181       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
01182                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
01183     {
01184 
01185       tempstr = Tcl_GetStringFromObj (tclobj, &strlen);
01186       if (strlen <= 0)
01187         return TCL_ERROR;
01188       sscanf (tempstr, "%x", &inimgaddr);
01189       inimg = (IMAGE *) inimgaddr;
01190     }
01191   else
01192     {
01193       return TCL_ERROR;
01194     }
01195   Tcl_DecrRefCount (tclarrayname);
01196   Tcl_DecrRefCount (tclindexname);
01197 
01198   /* Read the input integer array(steps) */
01199   tclarrayname = Tcl_NewStringObj (array, -1);
01200   tclindexname = Tcl_NewStringObj ("steps", -1);
01201   if (tclobj =
01202       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
01203                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
01204     {
01205 
01206       if (Tcl_GetIntFromObj (interp, tclobj, &steps) == TCL_ERROR)
01207         return TCL_ERROR;
01208       nlev = (short) steps;
01209     }
01210   else
01211     {
01212       return TCL_ERROR;
01213     }
01214   Tcl_DecrRefCount (tclarrayname);
01215   Tcl_DecrRefCount (tclindexname);
01216 
01217   /* Read the input PIXEL array(gmin) */
01218   tclarrayname = Tcl_NewStringObj (array, -1);
01219   tclindexname = Tcl_NewStringObj ("gmin", -1);
01220   if (tclobj =
01221       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
01222                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
01223     {
01224 
01225       if (Tcl_GetDoubleFromObj (interp, tclobj, &tempdouble) == TCL_ERROR)
01226         return TCL_ERROR;
01227       gmin = (PIXEL) tempdouble;
01228     }
01229   else
01230     {
01231       return TCL_ERROR;
01232     }
01233   Tcl_DecrRefCount (tclarrayname);
01234   Tcl_DecrRefCount (tclindexname);
01235 
01236   /* Read the input PIXEL array(gmax) */
01237   tclarrayname = Tcl_NewStringObj (array, -1);
01238   tclindexname = Tcl_NewStringObj ("gmax", -1);
01239   if (tclobj =
01240       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
01241                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
01242     {
01243 
01244       if (Tcl_GetDoubleFromObj (interp, tclobj, &tempdouble) == TCL_ERROR)
01245         return TCL_ERROR;
01246       gmax = (PIXEL) tempdouble;
01247     }
01248   else
01249     {
01250       return TCL_ERROR;
01251     }
01252   Tcl_DecrRefCount (tclarrayname);
01253   Tcl_DecrRefCount (tclindexname);
01254 
01255   /* Read the output image 1 name */
01256   tclarrayname = Tcl_NewStringObj (array, -1);
01257   tclindexname = Tcl_NewStringObj ("outname", -1);
01258   if (tclobj =
01259       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
01260                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
01261     {
01262 
01263       outname = Tcl_GetStringFromObj (tclobj, &strlen);
01264       if (strlen <= 0)
01265         return TCL_ERROR;
01266     }
01267   else
01268     {
01269       return TCL_ERROR;
01270     }
01271   Tcl_DecrRefCount (tclarrayname);
01272   Tcl_DecrRefCount (tclindexname);
01273 
01274   STRETCH (inimg, TFQUANT, &outimg);
01275 
01276   if (CHECKIMG (outimg))
01277     sprintf (outimg->text, "%s", outname);
01278   outimgaddr = (int) outimg;
01279 
01280   sprintf (msg, "%x", outimgaddr);
01281   Tcl_SetResult (interp, msg, TCL_VOLATILE);
01282 
01283   return TCL_OK;
01284 }
01285 
01286 /*-Copyright Information------------------------------------------------------*/
01287 /* Copyright (c) 1999 by the University of Arizona Digital Image Analysis Lab */
01288 /*----------------------------------------------------------------------------*/
01289 /*-General Information--------------------------------------------------------*/
01290 /*                                                                            */
01291 /*   This procedure provides an interface to the SADIE function               */
01292 /*   STRETCH from Tcl/Tk.  It expects a tcl global array                      */
01293 /*   with these indices to exist:                                             */
01294 /*      array(inimg,addr)         --  SADIE image address                     */
01295 /*      array(gmin)               --  PIXEL                                   */
01296 /*      array(gmax)               --  PIXEL                                   */
01297 /*      array(outname)            --  char*                                   */
01298 /*                                                                            */
01299 /*----------------------------------------------------------------------------*/
01300 /*-Interface Information------------------------------------------------------*/
01301 int
01302 Sadie_Contrast_SatStretchCmd (ClientData client_data, Tcl_Interp * interp,
01303                               int argc, char *argv[])
01304 {
01305   Tcl_Obj *tclobj = NULL;
01306   Tcl_Obj *tclarrayname = NULL;
01307   Tcl_Obj *tclindexname = NULL;
01308   char msg[SLEN];
01309   char *array = NULL;
01310   char *tempstr = NULL;
01311   int strlen;
01312   int inimgaddr;
01313   IMAGE *inimg = NULL;
01314   int outimgaddr;
01315   IMAGE *outimg = NULL;
01316   char *outname = NULL;
01317   double tempdouble;
01318 
01319   if (argc != 2)
01320     {
01321       Tcl_AppendResult (interp, "wrong # args: should be \"",
01322                         argv[0], " arrayname\"", (char *) NULL);
01323       return TCL_ERROR;
01324     }
01325   array = argv[1];
01326 
01327   /* Read input image array(inimg,addr) */
01328   tclarrayname = Tcl_NewStringObj (array, -1);
01329   tclindexname = Tcl_NewStringObj ("inimg,addr", -1);
01330   if (tclobj =
01331       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
01332                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
01333     {
01334 
01335       tempstr = Tcl_GetStringFromObj (tclobj, &strlen);
01336       if (strlen <= 0)
01337         return TCL_ERROR;
01338       sscanf (tempstr, "%x", &inimgaddr);
01339       inimg = (IMAGE *) inimgaddr;
01340     }
01341   else
01342     {
01343       return TCL_ERROR;
01344     }
01345   Tcl_DecrRefCount (tclarrayname);
01346   Tcl_DecrRefCount (tclindexname);
01347 
01348   /* Read the input PIXEL array(gmin) */
01349   tclarrayname = Tcl_NewStringObj (array, -1);
01350   tclindexname = Tcl_NewStringObj ("gmin", -1);
01351   if (tclobj =
01352       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
01353                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
01354     {
01355 
01356       if (Tcl_GetDoubleFromObj (interp, tclobj, &tempdouble) == TCL_ERROR)
01357         return TCL_ERROR;
01358       gmin = (PIXEL) tempdouble;
01359     }
01360   else
01361     {
01362       return TCL_ERROR;
01363     }
01364   Tcl_DecrRefCount (tclarrayname);
01365   Tcl_DecrRefCount (tclindexname);
01366 
01367   /* Read the input PIXEL array(gmax) */
01368   tclarrayname = Tcl_NewStringObj (array, -1);
01369   tclindexname = Tcl_NewStringObj ("gmax", -1);
01370   if (tclobj =
01371       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
01372                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
01373     {
01374 
01375       if (Tcl_GetDoubleFromObj (interp, tclobj, &tempdouble) == TCL_ERROR)
01376         return TCL_ERROR;
01377       gmax = (PIXEL) tempdouble;
01378     }
01379   else
01380     {
01381       return TCL_ERROR;
01382     }
01383   Tcl_DecrRefCount (tclarrayname);
01384   Tcl_DecrRefCount (tclindexname);
01385 
01386   /* Read the output image 1 name */
01387   tclarrayname = Tcl_NewStringObj (array, -1);
01388   tclindexname = Tcl_NewStringObj ("outname", -1);
01389   if (tclobj =
01390       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
01391                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
01392     {
01393 
01394       outname = Tcl_GetStringFromObj (tclobj, &strlen);
01395       if (strlen <= 0)
01396         return TCL_ERROR;
01397     }
01398   else
01399     {
01400       return TCL_ERROR;
01401     }
01402   Tcl_DecrRefCount (tclarrayname);
01403   Tcl_DecrRefCount (tclindexname);
01404 
01405   STRETCH (inimg, TFSAT, &outimg);
01406 
01407   if (CHECKIMG (outimg))
01408     sprintf (outimg->text, "%s", outname);
01409   outimgaddr = (int) outimg;
01410 
01411   sprintf (msg, "%x", outimgaddr);
01412   Tcl_SetResult (interp, msg, TCL_VOLATILE);
01413 
01414   return TCL_OK;
01415 }
01416 
01417 /*-Copyright Information------------------------------------------------------*/
01418 /* Copyright (c) 1999 by the University of Arizona Digital Image Analysis Lab */
01419 /*----------------------------------------------------------------------------*/
01420 /*-General Information--------------------------------------------------------*/
01421 /*                                                                            */
01422 /*   This procedure provides an interface to the SADIE function               */
01423 /*   STRETCH from Tcl/Tk.  It expects a tcl global array                      */
01424 /*   with these indices to exist:                                             */
01425 /*      array(inimg,addr)         --  SADIE image address                     */
01426 /*      array(thresh)             --  PIXEL                                   */
01427 /*      array(outname)            --  char*                                   */
01428 /*                                                                            */
01429 /*----------------------------------------------------------------------------*/
01430 /*-Interface Information------------------------------------------------------*/
01431 int
01432 Sadie_Contrast_ThreshStretchCmd (ClientData client_data, Tcl_Interp * interp,
01433                                  int argc, char *argv[])
01434 {
01435   Tcl_Obj *tclobj = NULL;
01436   Tcl_Obj *tclarrayname = NULL;
01437   Tcl_Obj *tclindexname = NULL;
01438   char msg[SLEN];
01439   char *array = NULL;
01440   char *tempstr = NULL;
01441   int strlen;
01442   int inimgaddr;
01443   IMAGE *inimg = NULL;
01444   int outimgaddr;
01445   IMAGE *outimg = NULL;
01446   char *outname = NULL;
01447   double tempdouble;
01448 
01449   if (argc != 2)
01450     {
01451       Tcl_AppendResult (interp, "wrong # args: should be \"",
01452                         argv[0], " arrayname\"", (char *) NULL);
01453       return TCL_ERROR;
01454     }
01455   array = argv[1];
01456 
01457   /* Read input image array(inimg,addr) */
01458   tclarrayname = Tcl_NewStringObj (array, -1);
01459   tclindexname = Tcl_NewStringObj ("inimg,addr", -1);
01460   if (tclobj =
01461       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
01462                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
01463     {
01464 
01465       tempstr = Tcl_GetStringFromObj (tclobj, &strlen);
01466       if (strlen <= 0)
01467         return TCL_ERROR;
01468       sscanf (tempstr, "%x", &inimgaddr);
01469       inimg = (IMAGE *) inimgaddr;
01470     }
01471   else
01472     {
01473       return TCL_ERROR;
01474     }
01475   Tcl_DecrRefCount (tclarrayname);
01476   Tcl_DecrRefCount (tclindexname);
01477 
01478   /* Read the input PIXEL array(thresh) */
01479   tclarrayname = Tcl_NewStringObj (array, -1);
01480   tclindexname = Tcl_NewStringObj ("thresh", -1);
01481   if (tclobj =
01482       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
01483                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
01484     {
01485 
01486       if (Tcl_GetDoubleFromObj (interp, tclobj, &tempdouble) == TCL_ERROR)
01487         return TCL_ERROR;
01488       thresh = (PIXEL) tempdouble;
01489     }
01490   else
01491     {
01492       return TCL_ERROR;
01493     }
01494   Tcl_DecrRefCount (tclarrayname);
01495   Tcl_DecrRefCount (tclindexname);
01496 
01497   /* Read the output image 1 name */
01498   tclarrayname = Tcl_NewStringObj (array, -1);
01499   tclindexname = Tcl_NewStringObj ("outname", -1);
01500   if (tclobj =
01501       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
01502                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
01503     {
01504 
01505       outname = Tcl_GetStringFromObj (tclobj, &strlen);
01506       if (strlen <= 0)
01507         return TCL_ERROR;
01508     }
01509   else
01510     {
01511       return TCL_ERROR;
01512     }
01513   Tcl_DecrRefCount (tclarrayname);
01514   Tcl_DecrRefCount (tclindexname);
01515 
01516   STRETCH (inimg, TFTHRESH, &outimg);
01517 
01518   if (CHECKIMG (outimg))
01519     sprintf (outimg->text, "%s", outname);
01520   outimgaddr = (int) outimg;
01521 
01522   sprintf (msg, "%x", outimgaddr);
01523   Tcl_SetResult (interp, msg, TCL_VOLATILE);
01524 
01525   return TCL_OK;
01526 }
01527 
01528 /*-Copyright Information------------------------------------------------------*/
01529 /* Copyright (c) 1999 by the University of Arizona Digital Image Analysis Lab */
01530 /*----------------------------------------------------------------------------*/
01531 /*-General Information--------------------------------------------------------*/
01532 /*                                                                            */
01533 /*   This procedure provides an interface to the SADIE function               */
01534 /*   VSTRETCH from Tcl/Tk.  It expects a tcl global array                     */
01535 /*   with these indices to exist:                                             */
01536 /*      array(inimg,addr)         --  SADIE image address                     */
01537 /*      array(blocksize)          --  int                                     */
01538 /*      array(outname)            --  char*                                   */
01539 /*                                                                            */
01540 /*----------------------------------------------------------------------------*/
01541 /*-Interface Information------------------------------------------------------*/
01542 int
01543 Sadie_Contrast_AdaptStretchCmd (ClientData client_data, Tcl_Interp * interp,
01544                                 int argc, char *argv[])
01545 {
01546   Tcl_Obj *tclobj = NULL;
01547   Tcl_Obj *tclarrayname = NULL;
01548   Tcl_Obj *tclindexname = NULL;
01549   char msg[SLEN];
01550   char *array = NULL;
01551   char *tempstr = NULL;
01552   int strlen;
01553   int inimgaddr;
01554   IMAGE *inimg = NULL;
01555   int outimgaddr;
01556   IMAGE *outimg = NULL;
01557   char *outname = NULL;
01558   int blocksize;
01559 
01560   if (argc != 2)
01561     {
01562       Tcl_AppendResult (interp, "wrong # args: should be \"",
01563                         argv[0], " arrayname\"", (char *) NULL);
01564       return TCL_ERROR;
01565     }
01566   array = argv[1];
01567 
01568   /* Read input image array(inimg,addr) */
01569   tclarrayname = Tcl_NewStringObj (array, -1);
01570   tclindexname = Tcl_NewStringObj ("inimg,addr", -1);
01571   if (tclobj =
01572       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
01573                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
01574     {
01575 
01576       tempstr = Tcl_GetStringFromObj (tclobj, &strlen);
01577       if (strlen <= 0)
01578         return TCL_ERROR;
01579       sscanf (tempstr, "%x", &inimgaddr);
01580       inimg = (IMAGE *) inimgaddr;
01581     }
01582   else
01583     {
01584       return TCL_ERROR;
01585     }
01586   Tcl_DecrRefCount (tclarrayname);
01587   Tcl_DecrRefCount (tclindexname);
01588 
01589   /* Read the input integer array(blocksize) */
01590   tclarrayname = Tcl_NewStringObj (array, -1);
01591   tclindexname = Tcl_NewStringObj ("blocksize", -1);
01592   if (tclobj =
01593       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
01594                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
01595     {
01596 
01597       if (Tcl_GetIntFromObj (interp, tclobj, &blocksize) == TCL_ERROR)
01598         return TCL_ERROR;
01599     }
01600   else
01601     {
01602       return TCL_ERROR;
01603     }
01604   Tcl_DecrRefCount (tclarrayname);
01605   Tcl_DecrRefCount (tclindexname);
01606 
01607   /* Read the output image 1 name */
01608   tclarrayname = Tcl_NewStringObj (array, -1);
01609   tclindexname = Tcl_NewStringObj ("outname", -1);
01610   if (tclobj =
01611       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
01612                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
01613     {
01614 
01615       outname = Tcl_GetStringFromObj (tclobj, &strlen);
01616       if (strlen <= 0)
01617         return TCL_ERROR;
01618     }
01619   else
01620     {
01621       return TCL_ERROR;
01622     }
01623   Tcl_DecrRefCount (tclarrayname);
01624   Tcl_DecrRefCount (tclindexname);
01625 
01626   VSTRETCH (inimg, blocksize, &outimg);
01627 
01628   if (CHECKIMG (outimg))
01629     sprintf (outimg->text, "%s", outname);
01630   outimgaddr = (int) outimg;
01631 
01632   sprintf (msg, "%x", outimgaddr);
01633   Tcl_SetResult (interp, msg, TCL_VOLATILE);
01634 
01635   return TCL_OK;
01636 }
01637 
01638 /*-Copyright Information------------------------------------------------------*/
01639 /* Copyright (c) 1999 by the University of Arizona Digital Image Analysis Lab */
01640 /*----------------------------------------------------------------------------*/
01641 /*-General Information--------------------------------------------------------*/
01642 /*                                                                            */
01643 /*   This procedure provides an interface to the SADIE function               */
01644 /*   MATCH from Tcl/Tk.  It expects a tcl global array                        */
01645 /*   with these indices to exist:                                             */
01646 /*      array(inimg,addr1)        --  SADIE image address                     */
01647 /*      array(inimg,addr2)        --  SADIE image address                     */
01648 /*      array(nlevels)            --  int                                     */
01649 /*      array(option)             --  int                                     */
01650 /*      array(outname)            --  char*                                   */
01651 /*                                                                            */
01652 /*----------------------------------------------------------------------------*/
01653 /*-Interface Information------------------------------------------------------*/
01654 int
01655 Sadie_Contrast_RefStretchCmd (ClientData client_data, Tcl_Interp * interp,
01656                               int argc, char *argv[])
01657 {
01658   Tcl_Obj *tclobj = NULL;
01659   Tcl_Obj *tclarrayname = NULL;
01660   Tcl_Obj *tclindexname = NULL;
01661   char msg[SLEN];
01662   char *array = NULL;
01663   char *tempstr = NULL;
01664   int strlen;
01665   int inimgaddr1, inimgaddr2;
01666   IMAGE *inimg1 = NULL, *inimg2 = NULL;
01667   int outimgaddr;
01668   IMAGE *outimg = NULL;
01669   char *outname = NULL;
01670   int nlevels, option;
01671 
01672   if (argc != 2)
01673     {
01674       Tcl_AppendResult (interp, "wrong # args: should be \"",
01675                         argv[0], " arrayname\"", (char *) NULL);
01676       return TCL_ERROR;
01677     }
01678   array = argv[1];
01679 
01680   /* Read input image array(inimg,addr1) */
01681   tclarrayname = Tcl_NewStringObj (array, -1);
01682   tclindexname = Tcl_NewStringObj ("inimg,addr1", -1);
01683   if (tclobj =
01684       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
01685                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
01686     {
01687 
01688       tempstr = Tcl_GetStringFromObj (tclobj, &strlen);
01689       if (strlen <= 0)
01690         return TCL_ERROR;
01691       sscanf (tempstr, "%x", &inimgaddr1);
01692       inimg1 = (IMAGE *) inimgaddr1;
01693     }
01694   else
01695     {
01696       return TCL_ERROR;
01697     }
01698   Tcl_DecrRefCount (tclarrayname);
01699   Tcl_DecrRefCount (tclindexname);
01700 
01701   /* Read input image array(inimg,addr2) */
01702   tclarrayname = Tcl_NewStringObj (array, -1);
01703   tclindexname = Tcl_NewStringObj ("inimg,addr2", -1);
01704   if (tclobj =
01705       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
01706                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
01707     {
01708 
01709       tempstr = Tcl_GetStringFromObj (tclobj, &strlen);
01710       if (strlen <= 0)
01711         return TCL_ERROR;
01712       sscanf (tempstr, "%x", &inimgaddr2);
01713       inimg2 = (IMAGE *) inimgaddr2;
01714     }
01715   else
01716     {
01717       return TCL_ERROR;
01718     }
01719   Tcl_DecrRefCount (tclarrayname);
01720   Tcl_DecrRefCount (tclindexname);
01721 
01722   /* Read the input integer array(nlevels) */
01723   tclarrayname = Tcl_NewStringObj (array, -1);
01724   tclindexname = Tcl_NewStringObj ("nlevels", -1);
01725   if (tclobj =
01726       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
01727                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
01728     {
01729 
01730       if (Tcl_GetIntFromObj (interp, tclobj, &nlevels) == TCL_ERROR)
01731         return TCL_ERROR;
01732     }
01733   else
01734     {
01735       return TCL_ERROR;
01736     }
01737   Tcl_DecrRefCount (tclarrayname);
01738   Tcl_DecrRefCount (tclindexname);
01739 
01740   /* Read the input integer array(option) */
01741   tclarrayname = Tcl_NewStringObj (array, -1);
01742   tclindexname = Tcl_NewStringObj ("option", -1);
01743   if (tclobj =
01744       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
01745                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
01746     {
01747 
01748       if (Tcl_GetIntFromObj (interp, tclobj, &option) == TCL_ERROR)
01749         return TCL_ERROR;
01750     }
01751   else
01752     {
01753       return TCL_ERROR;
01754     }
01755   Tcl_DecrRefCount (tclarrayname);
01756   Tcl_DecrRefCount (tclindexname);
01757 
01758   /* Read the output image 1 name */
01759   tclarrayname = Tcl_NewStringObj (array, -1);
01760   tclindexname = Tcl_NewStringObj ("outname", -1);
01761   if (tclobj =
01762       Tcl_ObjGetVar2 (interp, tclarrayname, tclindexname,
01763                       TCL_GLOBAL_ONLY | TCL_LEAVE_ERR_MSG))
01764     {
01765 
01766       outname = Tcl_GetStringFromObj (tclobj, &strlen);
01767       if (strlen <= 0)
01768         return TCL_ERROR;
01769     }
01770   else
01771     {
01772       return TCL_ERROR;
01773     }
01774   Tcl_DecrRefCount (tclarrayname);
01775   Tcl_DecrRefCount (tclindexname);
01776 
01777   MATCH (inimg1, inimg2, nlevels, option, &outimg);
01778 
01779   if (CHECKIMG (outimg))
01780     sprintf (outimg->text, "%s", outname);
01781   outimgaddr = (int) outimg;
01782 
01783   sprintf (msg, "%x", outimgaddr);
01784   Tcl_SetResult (interp, msg, TCL_VOLATILE);
01785 
01786   return TCL_OK;
01787 }
01788 
01789 /*-Copyright Information------------------------------------------------------*/
01790 /* Copyright (c) 1999 by the University of Arizona Digital Image Analysis Lab */
01791 /*----------------------------------------------------------------------------*/
01792 /*-General Information--------------------------------------------------------*/
01793 /*                                                                            */
01794 /*   This procedure initializes the all of the procedures                     */
01795 /*   in this file by registering them with Tcl.                               */
01796 /*                                                                            */
01797 /*----------------------------------------------------------------------------*/
01798 /*-Interface Information------------------------------------------------------*/
01799 int
01800 Sadie_Contrast_Init (Tcl_Interp * interp)
01801 {
01802   Tcl_CreateCommand (interp, "Sadie_Contrast_NormStretch",
01803                      Sadie_Contrast_NormStretchCmd, (ClientData) NULL, NULL);
01804   Tcl_CreateCommand (interp, "Sadie_Contrast_HisteqStretch",
01805                      Sadie_Contrast_HisteqStretchCmd, (ClientData) NULL,
01806                      NULL);
01807   Tcl_CreateCommand (interp, "Sadie_Contrast_LinearStretch",
01808                      Sadie_Contrast_LinearStretchCmd, (ClientData) NULL,
01809                      NULL);
01810   Tcl_CreateCommand (interp, "Sadie_Contrast_LogStretch",
01811                      Sadie_Contrast_LogStretchCmd, (ClientData) NULL, NULL);
01812   Tcl_CreateCommand (interp, "Sadie_Contrast_PWLStretch",
01813                      Sadie_Contrast_PWLStretchCmd, (ClientData) NULL, NULL);
01814   Tcl_CreateCommand (interp, "Sadie_Contrast_RootStretch",
01815                      Sadie_Contrast_RootStretchCmd, (ClientData) NULL, NULL);
01816   Tcl_CreateCommand (interp, "Sadie_Contrast_SqrStretch",
01817                      Sadie_Contrast_SqrStretchCmd, (ClientData) NULL, NULL);
01818   Tcl_CreateCommand (interp, "Sadie_Contrast_TblStretch",
01819                      Sadie_Contrast_TblStretchCmd, (ClientData) NULL, NULL);
01820   Tcl_CreateCommand (interp, "Sadie_Contrast_QntStretch",
01821                      Sadie_Contrast_QntStretchCmd, (ClientData) NULL, NULL);
01822   Tcl_CreateCommand (interp, "Sadie_Contrast_SatStretch",
01823                      Sadie_Contrast_SatStretchCmd, (ClientData) NULL, NULL);
01824   Tcl_CreateCommand (interp, "Sadie_Contrast_ThreshStretch",
01825                      Sadie_Contrast_ThreshStretchCmd, (ClientData) NULL,
01826                      NULL);
01827   Tcl_CreateCommand (interp, "Sadie_Contrast_AdaptStretch",
01828                      Sadie_Contrast_AdaptStretchCmd, (ClientData) NULL, NULL);
01829   Tcl_CreateCommand (interp, "Sadie_Contrast_RefStretch",
01830                      Sadie_Contrast_RefStretchCmd, (ClientData) NULL, NULL);
01831   return TCL_OK;
01832 }

Generated on Sun May 18 15:36:15 2003 for tclSadie by doxygen1.3