Main Page | Data Structures | Directories | File List | Data Fields | Globals

tclsadie.h File Reference

Application-specific data and definitions for tclSadie. More...

#include <tcl.h>
#include <tk.h>
#include <sadie.h>
#include "project_utilities.h"

Go to the source code of this file.

BEGIN_C_DECLARATIONSStrings used to reference Tcl data.

Default or constant strings serving as Tcl names or array indexes. We follow a convention that defines the strings in one place (here), then copies them into private character arrays within the files that need to reference them.

#define SADIEVAR_ARRAYNAME   "SadieVar"
 The name of the global Tcl array for SADIE settings.
#define DEFAULT_IN_IMAGE_ADDR_INDEX   "inimg,addr"
 The usual index for finding a SADIE image ID within a Tcl array.
#define DEFAULT_OUT_IMAGE_NAME_INDEX   "outname"
 The usual index for finding an output image name within a Tcl array.
#define DEFAULT_MESSAGE_INDEX   "message"
 A trace on an array element with this index updates the session log.
#define DEFAULT_ERR_POPUP   ".dlg"
 The canvas name for pop-up modal dialogs.
#define DEFAULT_SESSION_LOG_CANVAS   ".sessionlog.canvas"
 The canvas name for the session log window.
#define DEFAULT_SESSION_LOG_POS_INDEX   "sessionlog,pos"
 The index of a Tcl array element tracking the session log insert point.
#define DEFAULT_SESSION_LOG_REFRESH   "update_sessionlog_view"
 The name of a Tcl command for updating the session log.
#define DEFAULT_TCL_ARRAY_TITLE   "arrayname"
 The name to use for a Tcl array in error messages, etc.

Defines

#define TCLSADIE_H   1
 The standard guard against including the same header twice.

Typedefs

typedef Tclsadie_app_datatclsadie_app_datap_t
 The pointer to the private data, recovered from void* in callbacks.
typedef Tclsadie_cmd_skeltclsadie_cmd_skelp_t
 A pointer to a pre-parsed Tcl object command.

Functions

int tclsadie_private_data_init (Tcl_Interp *interp)
 Set up the tclSadie-specific private data structure for the SADIE library.
int tclsadie_app_init (void)
 Register all the necessary callbacks with the SADIE library.
int ProgMeter_Create (const char *title, void *data)
 Create a pop-up progress meter widget.
int ProgMeter_Update (int gaugenum, double value, void *data)
 Modify the progress displayed by an existing progress meter.
int ProgMeter_Destroy (int gaugenum, void *data)
 Destroy a pop-up progress meter widget.
Tcl_Obj * NewSadieImageObj (IMAGE *img)
 Create a Tcl object representation from a SADIE image.
Tcl_Obj * NewSadieImageObj2 (Tcl_Interp *interp, Tcl_Obj *arrayobjPtr, const char *ixname, IMAGE *imagePtr)
 Make a Tcl object representing a SADIE image ID, resetting the image name.
int SetSadieNamedImageResult (Tcl_Interp *interp, IMAGE *imagePtr, Tcl_Obj *nameobjPtr)
 Reset a SADIE image name, then return its ID as the Tcl interpreter result.
int GetSadieImageFromObj (Tcl_Obj *objPtr, IMAGE **imagehandle)
 Recover a pointer to a SADIE image from a Tcl object.
int GetSadieDkeyFromObj (Tcl_Obj *objPtr, const char **dkeyhandle)
 Obtain a hashable string from a Tcl object representing a SADIE image ID.
int GetSadieImageFromObj2 (Tcl_Interp *interp, Tcl_Obj *arrayobjPtr, const char *ixname, IMAGE **imagehandle)
 Recover a pointer to a SADIE image from a Tcl array element.
int SetSadieImageObj2 (Tcl_Interp *interp, Tcl_Obj *arrayobjPtr, const char *ixname, IMAGE *imagePtr)
 Set the Tcl interpreter result to the ID of a renamed SADIE image.
int SetSadieComponentObj2 (Tcl_Interp *interp, Tcl_Obj *arrayobjPtr, const char **ixname, IMAGE **comp_image)
 Set the Tcl interpreter result to a list representing a SADIE image pair.
int GetSadiePixelFromObj2 (Tcl_Interp *interp, Tcl_Obj *arrayobjPtr, const char *ixname, PIXEL *pixelPtr)
 Recover a PIXEL value from a Tcl array element.
int GetSadieUintFromObj (Tcl_Interp *interp, Tcl_Obj *objPtr, uint32_t *uintPtr)
 Recover a 32-bit unsigned integer value from a Tcl object.
int GetSadieUint64FromObj (Tcl_Interp *interp, Tcl_Obj *objPtr, uint64_t *uintPtr)
 Recover a 64-bit unsigned integer value from a Tcl object.
int GetSadieUintFromObj2 (Tcl_Interp *interp, Tcl_Obj *arrayobjPtr, const char *ixname, uint32_t *uintPtr)
 Recover a 32-bit unsigned integer value from a Tcl array element.
int GetSadieIntFromObj2 (Tcl_Interp *interp, Tcl_Obj *arrayobjPtr, const char *ixname, int *intPtr)
 Recover an integer value from a Tcl array element.
int GetSadieDoubleFromObj2 (Tcl_Interp *interp, Tcl_Obj *arrayobjPtr, const char *ixname, double *doublePtr)
 Recover a double value from a Tcl array element.
int GetSadieBooleanFromObj2 (Tcl_Interp *interp, Tcl_Obj *arrayobjPtr, const char *ixname, int *boolPtr)
 Recover an Boolean value from a Tcl array element.
int GetSadieDkeyFromObj2 (Tcl_Interp *interp, Tcl_Obj *arrayobjPtr, const char *ixname, const char **dkeyhandle)
 Obtain a hashable string value from a Tcl array element.


Detailed Description

Application-specific data and definitions for tclSadie.

Visible interfaces for the utility functions that recover data from Tcl arrays, implement progress bars, and maintain tclSadie's private data within the SADIE library.

Author:
University of Arizona Digital Image Analysis Lab
Date:
1999, 2004
Version:
Id
tclsadie.h,v 1.5 2005/03/22 21:21:16 mmunro Exp

Definition in file tclsadie.h.


Function Documentation

int GetSadieBooleanFromObj2 Tcl_Interp *  interp,
Tcl_Obj *  arrayobjPtr,
const char *  ixname,
int *  boolPtr
 

Recover an Boolean value from a Tcl array element.

Tcl Boolean values are a little more versatile than just the integer constants 0 and 1. Objects whose string representation is 0, false, no, or off (or the corresponding upper-case or abbreviated versions) have a false Boolean value; similarly, those whose string representation is 1, true, yes, or on (or the corresponding variations) have a true Boolean value. We use Tcl_ObjGetVar2 to find an object holding such a Boolean value through a pair of Tcl objects: an array name (provided as an existing Tcl object) and an index (newly created from a C string argument). If possible, we deposit the value in the location specified by boolPtr, but otherwise set this to false.

Parameters:
[in] interp the Tcl interpreter.
[in] arrayobjPtr the name of an array variable (as a Tcl object).
[in] ixname the array index (as a C string).
[out] boolPtr where to deposit the Boolean value.
Returns:
TCL_OK on success, TCL_ERROR on failure.

Definition at line 617 of file tclSadie_getset.c.

Referenced by Sadie_Classify_MaxLikeCmd(), Sadie_Classify_MinDistCmd(), and Sadie_Filter_ImageConvCmd().

int GetSadieDkeyFromObj Tcl_Obj *  objPtr,
const char **  dkeyhandle
 

Obtain a hashable string from a Tcl object representing a SADIE image ID.

The string representation of the image ID object is already a reasonable hash key. Note however that we do not copy it here, and it should generally be copied for subsequent use, lest the Tcl object be nodified or freed.

Parameters:
[in] objPtr the Tcl object represention of a SADIE image ID.
[out] dkeyhandle where to deposit a pointer to the string.
Returns:
TCL_OK on success, TCL_ERROR on failure.

Definition at line 664 of file tclSadie_getset.c.

Referenced by GetSadieDkeyFromObj2(), Sadie_General_IndexImageCmd(), and Sadie_Plot_CreateROICmd().

int GetSadieDkeyFromObj2 Tcl_Interp *  interp,
Tcl_Obj *  arrayobjPtr,
const char *  ixname,
const char **  dkeyhandle
 

Obtain a hashable string value from a Tcl array element.

The standard Tcl library function Tcl_ObjGetVar2 finds the string value through a pair of Tcl objects: an array name (provided as an existing Tcl object) and an index (newly created from the specified C string), then GetSadieDkeyFromObj recovers the string pointer, which we deposit in dkeyhandle, or set this NULL if an error arises.

Parameters:
[in] interp the Tcl interpreter.
[in] arrayobjPtr the name of an array variable (as a Tcl object).
[in] ixname the array index (as a C string).
[out] dkeyhandle where to deposit a pointer to the string value.
Returns:
TCL_OK on success, TCL_ERROR on failure.

Definition at line 699 of file tclSadie_getset.c.

References GetSadieDkeyFromObj().

Referenced by Sadie_Classify_LvlSliceCmd(), Sadie_Classify_MaxLikeCmd(), and Sadie_Classify_MinDistCmd().

int GetSadieDoubleFromObj2 Tcl_Interp *  interp,
Tcl_Obj *  arrayobjPtr,
const char *  ixname,
double *  doublePtr
 

Recover a double value from a Tcl array element.

We use Tcl_ObjGetVar2 to find the double value through a pair of Tcl objects: an array name (provided as an existing Tcl object) and an index (newly created from a C string argument). If possible, we deposit the value in the location specified by doublePtr, but otherwise set this to zero.

Parameters:
[in] interp the Tcl interpreter.
[in] arrayobjPtr the name of an array variable (as a Tcl object).
[in] ixname the array index (as a C string).
[out] doublePtr where to deposit the double value.
Returns:
TCL_OK on success, TCL_ERROR on failure.

Definition at line 561 of file tclSadie_getset.c.

Referenced by Sadie_Classify_MaxLikeCmd(), Sadie_Classify_SegmentCmd(), Sadie_Contrast_LinearStretchCmd(), Sadie_Contrast_NormStretchCmd(), Sadie_Filter_FFTFiltCmd(), Sadie_Filter_MajFiltCmd(), Sadie_Filter_MaskConvCmd(), Sadie_Filter_MaskGradCmd(), Sadie_Multi_CombineCmd(), Sadie_NewFunctions_ChirpCmd(), Sadie_NewFunctions_FunctionCmd(), Sadie_NewFunctions_RandomCmd(), Sadie_NewFunctions_SineStarCmd(), Sadie_NewFunctions_SineWaveCmd(), Sadie_Tools_ContMapCmd(), and Sadie_Tools_ReliefCmd().

int GetSadieImageFromObj Tcl_Obj *  objPtr,
IMAGE **  imagehandle
 

Recover a pointer to a SADIE image from a Tcl object.

If possible, we deposit a pointer to a SADIE image in the specified location, but otherwise set it to NULL. Note that the string representation we use here may change in future.

Parameters:
[in] objPtr the Tcl object encoding the image ID.
[out] imagehandle where to deposit the SADIE IMAGE pointer.
Returns:
TCL_OK on success, TCL_ERROR on failure.

Definition at line 73 of file tclSadie_getset.c.

Referenced by Sadie_FileIO_SaveCmd(), Sadie_FileIO_SaveEPSCmd(), Sadie_FileIO_SavePNMCmd(), Sadie_FileIO_SaveTEXTCmd(), Sadie_FileIO_SaveTIFFCmd(), Sadie_General_GetNumBandsCmd(), Sadie_General_GetPixelCmd(), Sadie_General_GmaxCmd(), Sadie_General_GminCmd(), Sadie_General_HeightCmd(), Sadie_General_IndexImageCmd(), Sadie_General_SetNameCmd(), Sadie_General_WidthCmd(), Sadie_Plot_CreateROICmd(), Sadie_Plot_ProfileCmd(), and Sadie_Plot_StatisticsCmd().

int GetSadieImageFromObj2 Tcl_Interp *  interp,
Tcl_Obj *  arrayobjPtr,
const char *  ixname,
IMAGE **  imagehandle
 

Recover a pointer to a SADIE image from a Tcl array element.

We find the Tcl value representing the SADIE image ID through a pair of Tcl objects: an array name and an index (a straightforward application of Tcl_ObjGetVar2). The array name object must already exist, but we convert a C string to the array index object. If possible, we deposit a pointer to this SADIE image in the specified location, but otherwise set it to NULL.

Parameters:
[in] interp the Tcl interpreter.
[in] arrayobjPtr the name of an array variable (as a Tcl object).
[in] ixname the array index (as a C string).
[out] imagehandle where to deposit the SADIE IMAGE pointer.
Returns:
TCL_OK on success, TCL_ERROR on failure.

Definition at line 134 of file tclSadie_getset.c.

Referenced by Sadie_Classify_ClusterCmd(), Sadie_Classify_LvlSliceCmd(), Sadie_Classify_MaxLikeCmd(), Sadie_Classify_MinDistCmd(), Sadie_Classify_SegmentCmd(), Sadie_Classify_SigMapCmd(), Sadie_Contrast_AdaptStretchCmd(), Sadie_Contrast_HisteqStretchCmd(), Sadie_Contrast_LinearStretchCmd(), Sadie_Contrast_LogStretchCmd(), Sadie_Contrast_NormStretchCmd(), Sadie_Contrast_PWLStretchCmd(), Sadie_Contrast_QntStretchCmd(), Sadie_Contrast_RefStretchCmd(), Sadie_Contrast_RootStretchCmd(), Sadie_Contrast_SatStretchCmd(), Sadie_Contrast_SqrStretchCmd(), Sadie_Contrast_TblStretchCmd(), Sadie_Contrast_ThreshStretchCmd(), Sadie_Filter_CAvgFiltCmd(), Sadie_Filter_FFTCmd(), Sadie_Filter_FFTConvCmd(), Sadie_Filter_FFTFiltCmd(), Sadie_Filter_FHTCmd(), Sadie_Filter_ImageConvCmd(), Sadie_Filter_ImageGradCmd(), Sadie_Filter_LibGradCmd(), Sadie_Filter_MajFiltCmd(), Sadie_Filter_MaskConvCmd(), Sadie_Filter_MaskGradCmd(), Sadie_Filter_MedFiltCmd(), Sadie_Filter_PSpectCmd(), Sadie_Multi_BIL2BSQCmd(), Sadie_Multi_BSQ2BILCmd(), Sadie_Multi_CombineCmd(), Sadie_Multi_Comp2RealCmd(), Sadie_Multi_CompareCmd(), Sadie_Multi_HSV2RGBCmd(), Sadie_Multi_PCSCmd(), Sadie_Multi_PCTCmd(), Sadie_Multi_Real2CompCmd(), Sadie_Multi_RGB2HSVCmd(), Sadie_Multi_RotateCubeCmd(), Sadie_Tools_ContMapCmd(), Sadie_Tools_DestripeCmd(), Sadie_Tools_ReliefCmd(), Sadie_Tools_RMSCmd(), and Sadie_Tools_ScatterCmd().

int GetSadieIntFromObj2 Tcl_Interp *  interp,
Tcl_Obj *  arrayobjPtr,
const char *  ixname,
int *  intPtr
 

Recover an integer value from a Tcl array element.

We use Tcl_ObjGetVar2 to find the integer value through a pair of Tcl objects: an array name (provided as an existing Tcl object) and an index (newly created from a C string argument). If possible, we deposit the value in the location specified by intPtr, but otherwise set this to zero.

Parameters:
[in] interp the Tcl interpreter.
[in] arrayobjPtr the name of an array variable (as a Tcl object).
[in] ixname the array index (as a C string).
[out] intPtr where to deposit the integer value.
Returns:
TCL_OK on success, TCL_ERROR on failure.

Definition at line 511 of file tclSadie_getset.c.

Referenced by Sadie_Classify_ClusterCmd(), Sadie_Classify_LvlSliceCmd(), Sadie_Classify_MaxLikeCmd(), Sadie_Classify_MinDistCmd(), Sadie_Classify_SegmentCmd(), Sadie_Contrast_LinearStretchCmd(), Sadie_Filter_FFTCmd(), Sadie_Filter_FFTConvCmd(), Sadie_Filter_FFTFiltCmd(), Sadie_Filter_FHTCmd(), Sadie_Filter_LibGradCmd(), Sadie_Filter_PSpectCmd(), Sadie_Multi_CombineCmd(), Sadie_Multi_Comp2RealCmd(), Sadie_Multi_CompareCmd(), Sadie_Multi_Real2CompCmd(), Sadie_Multi_RotateCubeCmd(), Sadie_NewFunctions_FunctionCmd(), Sadie_NewFunctions_RandomCmd(), Sadie_Tools_ContMapCmd(), and Sadie_Tools_DestripeCmd().

int GetSadiePixelFromObj2 Tcl_Interp *  interp,
Tcl_Obj *  arrayobjPtr,
const char *  ixname,
PIXEL *  pixelPtr
 

Recover a PIXEL value from a Tcl array element.

A straightforward application of Tcl_ObjGetVar2 finds the PIXEL value through a pair of Tcl objects: an array name (provided as an existing Tcl object) and an index (newly created from the specified C string). If possible, we deposit the value in the specified location, but otherwise set it to zero.

Parameters:
[in] interp the Tcl interpreter.
[in] arrayobjPtr the name of an array variable (as a Tcl object).
[in] ixname the array index (as a C string).
[out] pixelPtr where to deposit the PIXEL value.
Returns:
TCL_OK on success, TCL_ERROR on failure.

Definition at line 345 of file tclSadie_getset.c.

Referenced by Sadie_Classify_ClusterCmd(), Sadie_Classify_LvlSliceCmd(), Sadie_Classify_SegmentCmd(), Sadie_Contrast_NormStretchCmd(), Sadie_Contrast_PWLStretchCmd(), Sadie_Contrast_QntStretchCmd(), Sadie_Contrast_SatStretchCmd(), Sadie_Contrast_TblStretchCmd(), Sadie_Contrast_ThreshStretchCmd(), Sadie_Filter_CAvgFiltCmd(), and Sadie_NewFunctions_GrayScaleCmd().

int GetSadieUint64FromObj Tcl_Interp *  interp,
Tcl_Obj *  objPtr,
uint64_t *  uintPtr
 

Recover a 64-bit unsigned integer value from a Tcl object.

Newer versions of Tcl support 64-bit values through the Tcl_WideInt type, but we fall back to using longs if this isn't available, and in ether case set the value to zero on errors.

Parameters:
[in] interp the Tcl interpreter.
[in] objPtr the Tcl object holding the value.
[out] uintPtr where to deposit the 64-bit unsigned integer value.
Returns:
TCL_OK on success, TCL_ERROR on failure.

Definition at line 420 of file tclSadie_getset.c.

Referenced by Sadie_FileIO_ImportCmd(), and Sadie_FileIO_OpenCmd().

int GetSadieUintFromObj Tcl_Interp *  interp,
Tcl_Obj *  objPtr,
uint32_t *  uintPtr
 

Recover a 32-bit unsigned integer value from a Tcl object.

We rely on the Tcl object's long value being large enough to encode an unsigned 32-bit value, which we deposit in the specified location if possible, but otherwise set it to zero.

Parameters:
[in] interp the Tcl interpreter.
[in] objPtr the Tcl object holding the value.
[out] uintPtr where to deposit the 32-bit unsigned integer value.
Returns:
TCL_OK on success, TCL_ERROR on failure.

Definition at line 395 of file tclSadie_getset.c.

Referenced by Sadie_FileIO_ImportCmd(), Sadie_FileIO_SaveCmd(), Sadie_FileIO_SaveEPSCmd(), Sadie_FileIO_SaveTIFFCmd(), Sadie_General_GetPixelCmd(), and Sadie_Plot_CreateROICmd().

int GetSadieUintFromObj2 Tcl_Interp *  interp,
Tcl_Obj *  arrayobjPtr,
const char *  ixname,
uint32_t *  uintPtr
 

Recover a 32-bit unsigned integer value from a Tcl array element.

A straightforward application of Tcl_ObjGetVar2 finds a 32-bit unsigned integer value through a pair of Tcl objects: an array name (provided as an existing Tcl object) and an index (newly created from the specified C string). If possible, we deposit the value in the specified location, but otherwise set it to zero.

Parameters:
[in] interp the Tcl interpreter.
[in] arrayobjPtr the name of an array variable (as a Tcl object).
[in] ixname the array index (as a C string).
[out] uintPtr where to deposit the 32-bit unsigned integer value.
Returns:
TCL_OK on success, TCL_ERROR on failure.

Definition at line 458 of file tclSadie_getset.c.

Referenced by Sadie_Contrast_AdaptStretchCmd(), Sadie_Contrast_HisteqStretchCmd(), Sadie_Contrast_NormStretchCmd(), Sadie_Contrast_QntStretchCmd(), Sadie_Contrast_RefStretchCmd(), Sadie_Filter_CAvgFiltCmd(), Sadie_Filter_MajFiltCmd(), Sadie_Filter_MaskConvCmd(), Sadie_Filter_MedFiltCmd(), Sadie_Multi_PCSCmd(), Sadie_Multi_PCTCmd(), Sadie_NewFunctions_CheckerboardCmd(), Sadie_NewFunctions_ChirpCmd(), Sadie_NewFunctions_FunctionCmd(), Sadie_NewFunctions_GrayScaleCmd(), Sadie_NewFunctions_RandomCmd(), Sadie_NewFunctions_SineStarCmd(), Sadie_NewFunctions_SineWaveCmd(), Sadie_Tools_ScatterCmd(), and tclsadie_plotter().

Tcl_Obj* NewSadieImageObj IMAGE *  img  ) 
 

Create a Tcl object representation from a SADIE image.

Note that the object has a zero reference count, and the particular string representation may change in future.

Parameters:
[in] img points to the SADIE image.
Returns:
the new Tcl object representing the image ID.

Definition at line 53 of file tclSadie_getset.c.

Referenced by SetSadieNamedImageResult().

Tcl_Obj* NewSadieImageObj2 Tcl_Interp *  interp,
Tcl_Obj *  arrayobjPtr,
const char *  ixname,
IMAGE *  imagePtr
 

Make a Tcl object representing a SADIE image ID, resetting the image name.

We create a new Tcl object (with a zero reference count) to represent the ID of a SADIE image, resetting the image name to a string taken from a Tcl array element.

Parameters:
[in] interp the Tcl interpreter.
[in] arrayobjPtr the name of an array variable (as a Tcl object).
[in] ixname the array index (as a C string).
[in,out] imagePtr points to the SADIE image.
Returns:
the new Tcl object representing the image ID.

Definition at line 192 of file tclSadie_getset.c.

Referenced by Sadie_Multi_BIL2BSQCmd(), and SetSadieComponentObj2().

int ProgMeter_Create const char *  title,
void *  data
 

Create a pop-up progress meter widget.

There should already be a Tcl/Tk command that will create the widget within the current GUI in its initial state (no progress yet). Here we invoke it, passing it a title string for the widget.

Parameters:
[in] title the title string.
[in] data an opaque pointer to the saved tclSadie state data.
Returns:
An integer identifying the progress meter widget, zero on failure.

Definition at line 89 of file ProgMeter.c.

Referenced by tclsadie_app_init().

int ProgMeter_Destroy int  gaugenum,
void *  data
 

Destroy a pop-up progress meter widget.

There should already be a Tcl/Tk command that will destroy the widget within the current GUI, given its ID number, so we invoke it, returning any error status.

Parameters:
[in] data an opaque pointer to the saved tclSadie state data.
[in] gaugenum the code identifying the particular progress meter.
Returns:
An error status code (zero on failure).

Definition at line 192 of file ProgMeter.c.

Referenced by tclsadie_app_init().

int ProgMeter_Update int  gaugenum,
double  value,
void *  data
 

Modify the progress displayed by an existing progress meter.

The progress meter should already exist, and there should be a Tcl command that will update it, given an ID number and an indication of the current percentage progress. This invokes the command, and returns a value showing if the user clicked on a cancel button within the widget since the previous update.

Parameters:
[in] gaugenum the code identifying the particular progress meter.
[in] value the percentage progress the meter should display.
[in] data an opaque pointer to the saved tclSadie state data.
Returns:
A non-zero value for cancellation (by user selection or error).

Definition at line 138 of file ProgMeter.c.

Referenced by tclsadie_app_init().

int SetSadieComponentObj2 Tcl_Interp *  interp,
Tcl_Obj *  arrayobjPtr,
const char **  ixname,
IMAGE **  comp_image
 

Set the Tcl interpreter result to a list representing a SADIE image pair.

We create new Tcl objects representing the IDs of two SADIE images, renaming these to strings taken from two Tcl array elements (specified by a Tcl object giving the array name, and a pair of index strings). The list as a whole has a reference count of zero, but the image ID objects end up with reference counts of one (they have their counts incremented before inserting them in the list, so just after insertion they are briefly two, and must be decremented).

Parameters:
[in] interp the Tcl interpreter.
[in] arrayobjPtr the name of an array variable (as a Tcl object).
[in] ixname a C array holding the two Tcl array index strings.
[in,out] comp_image a C array holding two SADIE image pointers.
Returns:
TCL_OK on success, TCL_ERROR on failure.

Definition at line 301 of file tclSadie_getset.c.

References NewSadieImageObj2().

Referenced by Sadie_Filter_ImageGradCmd(), Sadie_Filter_LibGradCmd(), Sadie_Filter_MaskGradCmd(), and Sadie_Multi_Comp2RealCmd().

int SetSadieImageObj2 Tcl_Interp *  interp,
Tcl_Obj *  arrayobjPtr,
const char *  ixname,
IMAGE *  imagePtr
 

Set the Tcl interpreter result to the ID of a renamed SADIE image.

We create a new Tcl object (with a zero reference count) to represent the ID of a SADIE image, resetting the image name to a string taken from a Tcl array element, and return the image ID object through the Tcl interpreter result. Note that the string representation of the image ID may change in future.

Parameters:
[in] interp the Tcl interpreter.
[in] arrayobjPtr the name of an array variable (as a Tcl object).
[in] ixname the array index (as a C string).
[in,out] imagePtr points to the SADIE image.
Returns:
TCL_OK on success, TCL_ERROR on failure.

Definition at line 246 of file tclSadie_getset.c.

Referenced by Sadie_Classify_ClusterCmd(), Sadie_Classify_LvlSliceCmd(), Sadie_Classify_MaxLikeCmd(), Sadie_Classify_MinDistCmd(), Sadie_Classify_SegmentCmd(), Sadie_Classify_SigMapCmd(), Sadie_Contrast_AdaptStretchCmd(), Sadie_Contrast_HisteqStretchCmd(), Sadie_Contrast_LinearStretchCmd(), Sadie_Contrast_LogStretchCmd(), Sadie_Contrast_NormStretchCmd(), Sadie_Contrast_PWLStretchCmd(), Sadie_Contrast_QntStretchCmd(), Sadie_Contrast_RefStretchCmd(), Sadie_Contrast_RootStretchCmd(), Sadie_Contrast_SatStretchCmd(), Sadie_Contrast_SqrStretchCmd(), Sadie_Contrast_TblStretchCmd(), Sadie_Contrast_ThreshStretchCmd(), Sadie_Filter_CAvgFiltCmd(), Sadie_Filter_FFTCmd(), Sadie_Filter_FFTConvCmd(), Sadie_Filter_FFTFiltCmd(), Sadie_Filter_FHTCmd(), Sadie_Filter_ImageConvCmd(), Sadie_Filter_MajFiltCmd(), Sadie_Filter_MaskConvCmd(), Sadie_Filter_MedFiltCmd(), Sadie_Filter_PSpectCmd(), Sadie_Multi_BSQ2BILCmd(), Sadie_Multi_CombineCmd(), Sadie_Multi_CompareCmd(), Sadie_Multi_HSV2RGBCmd(), Sadie_Multi_PCSCmd(), Sadie_Multi_PCTCmd(), Sadie_Multi_Real2CompCmd(), Sadie_Multi_RGB2HSVCmd(), Sadie_Multi_RotateCubeCmd(), Sadie_NewFunctions_CheckerboardCmd(), Sadie_NewFunctions_ChirpCmd(), Sadie_NewFunctions_FunctionCmd(), Sadie_NewFunctions_GrayScaleCmd(), Sadie_NewFunctions_RandomCmd(), Sadie_NewFunctions_SineStarCmd(), Sadie_NewFunctions_SineWaveCmd(), Sadie_Tools_ContMapCmd(), Sadie_Tools_DestripeCmd(), Sadie_Tools_ReliefCmd(), and Sadie_Tools_ScatterCmd().

int SetSadieNamedImageResult Tcl_Interp *  interp,
IMAGE *  imagePtr,
Tcl_Obj *  nameobjPtr
 

Reset a SADIE image name, then return its ID as the Tcl interpreter result.

We create a new Tcl object representing the ID of a SADIE image, set the name of this image to a string extracted from another Tcl object, and make the image ID object the current interpreter result.

Parameters:
[in] interp the Tcl interpreter.
[in,out] imagePtr points to the SADIE image.
[in] nameobjPtr points to the Tcl object providing the new name.
Returns:
TCL_OK on success, TCL_ERROR on failure.

Definition at line 102 of file tclSadie_getset.c.

References NewSadieImageObj().

Referenced by Sadie_FileIO_ImportCmd(), Sadie_FileIO_OpenCmd(), Sadie_FileIO_OpenPNMCmd(), and Sadie_FileIO_OpenTIFFCmd().

int tclsadie_app_init void   ) 
 

Register all the necessary callbacks with the SADIE library.

Note that this registers all the SADIE callbacks (including the plotter and progress meter callbacks), not just the ones defined in tclSadie_app.c. The SADIE library provides the various sad_register functions (see sadie.h for the interfaces).

Returns:
TCL_OK on success, TCL_ERROR on errors.

Definition at line 454 of file tclSadie_app.c.

References ProgMeter_Create(), ProgMeter_Destroy(), ProgMeter_Update(), tclsadie_error_messenger(), tclsadie_plotter(), and tclsadie_warning_messenger().

Referenced by Tcl_AppInit().

int tclsadie_private_data_init Tcl_Interp *  interp  ) 
 

Set up the tclSadie-specific private data structure for the SADIE library.

The tclSadie callbacks need access to information such as the particular Tk canvas used for the SADIE session log, the name of the top-level window to use for pop-up dialog boxes, and the pre-parsed Tcl/Tk command templates, but cannot obtain it from SADIE, so here we initialize the relevant global data structure for their benefit.

Parameters:
[in] interp the main Tcl interpreter.
Returns:
TCL_ERROR on errors, otherwise TCL_OK.

Definition at line 258 of file tclSadie_app.c.

References DEFAULT_SESSION_LOG_CANVAS, dispose_private_data(), Tclsadie_app_data::err_popup, Tclsadie_app_data::log_refresh, Tclsadie_app_data::main_interp, Tclsadie_app_data::sadievar, SADIEVAR_ARRAYNAME, Tclsadie_app_data::sessionlog_canvas, and tclsadie_demolish_private_data().

Referenced by Tcl_AppInit().


Generated on Fri Jul 8 14:55:03 2005 for tclSadie by  doxygen 1.4.2