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

Sadie_General.c File Reference

Application and image data utilities. More...

#include <tcl.h>
#include <tk.h>
#include <sadie.h>
#include <string.h>
#include "tclsadie.h"
#include "Sadie_Index.h"

Go to the source code of this file.

Defines

#define MAX_DISPLAY_CHANNEL   3
 The number of bands to include in pixel value displays.

Functions

int Sadie_General_CloseCmd (ClientData client_data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
 Dispose of an image and all its associated metadata such as ROIs.
int Sadie_General_InitializeProgCmd (ClientData client_data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
 SADIE library initialization.
int Sadie_General_FinishProgCmd (ClientData client_data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
 SADIE library termination.
int Sadie_General_WidthCmd (ClientData client_data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
 Pass the recorded width of a SADIE image to Tcl.
int Sadie_General_HeightCmd (ClientData client_data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
 Pass the recorded height of a SADIE image to Tcl.
int Sadie_General_GminCmd (ClientData client_data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
 Pass the newly determined minimum SADIE image pixel value to Tcl.
int Sadie_General_GmaxCmd (ClientData client_data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
 Pass the newly determined minimum SADIE image pixel value to Tcl.
int Sadie_General_GetNumBandsCmd (ClientData client_data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
 Pass the recorded number of bands in a SADIE image to Tcl.
int Sadie_General_GetPixelCmd (ClientData client_data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
 Make a Tcl list from the values of a sub-set of bands at a single point.
int Sadie_General_SetNameCmd (ClientData client_data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
 Set the SADIE image text from a Tcl string value.
int Sadie_General_IndexImageCmd (ClientData client_data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
 Register a SADIE image within the global hash table.
int Sadie_General_Init (Tcl_Interp *interp)
 Make the commands defined in this file accessible to the Tcl interpreter.

Variables

sad_doclistp_t global_doclist
 The global hash table structures, associating images and their metadata.


Detailed Description

Application and image data utilities.

A miscellaneous collection of Tcl/Tk interfaces to SADIE image data (recovering and setting image attributes, disposing of images), and to the housekeeping operations needed by the SADIE library in the context of the whole application (initialization and finalization).

Author:
University of Arizona Digital Image Analysis Lab
Date:
1999, 2004
Version:
Id
Sadie_General.c,v 2.3 2005/03/22 21:16:14 mmunro Exp

Definition in file Sadie_General.c.


Function Documentation

int Sadie_General_CloseCmd ClientData  client_data,
Tcl_Interp *  interp,
int  objc,
Tcl_Obj *const   objv[]
 

Dispose of an image and all its associated metadata such as ROIs.

We delete the image's entry from the global hash table, leaving this operation to invoke the usual SADIE library image cleanup function, RELIMG.

Parameters:
[in] client_data (unused).
[in] interp the main Tcl interpreter.
[in] objc number of Tcl object arguments (always two).
[in] objv Tcl object argument list (the image ID string).
Returns:
TCL_OK on success, TCL_ERROR on errors.

Definition at line 54 of file Sadie_General.c.

References sad_dispose_doc().

Referenced by Sadie_General_Init().

int Sadie_General_FinishProgCmd ClientData  client_data,
Tcl_Interp *  interp,
int  objc,
Tcl_Obj *const   objv[]
 

SADIE library termination.

Invoke the operation to terminate the SADIE library from Tcl code.

Parameters:
[in] client_data (unused).
[in] interp the main Tcl interpreter.
[in] objc number of Tcl object arguments (always one).
[in] objv Tcl object argument list (no arguments, just the name).
Returns:
TCL_OK unconditionally.

Definition at line 93 of file Sadie_General.c.

Referenced by Sadie_General_Init().

int Sadie_General_GetNumBandsCmd ClientData  client_data,
Tcl_Interp *  interp,
int  objc,
Tcl_Obj *const   objv[]
 

Pass the recorded number of bands in a SADIE image to Tcl.

We recover the number of bands per image from the SADIE image, and assign this to the Tcl interpreter result object (as a long value).

Parameters:
[in] client_data (unused).
[in] interp the main Tcl interpreter.
[in] objc number of Tcl object arguments (always two).
[in] objv Tcl object argument list (the image ID string).
Returns:
TCL_OK on success, TCL_ERROR on errors.

Definition at line 245 of file Sadie_General.c.

References GetSadieImageFromObj().

Referenced by Sadie_General_Init().

int Sadie_General_GetPixelCmd ClientData  client_data,
Tcl_Interp *  interp,
int  objc,
Tcl_Obj *const   objv[]
 

Make a Tcl list from the values of a sub-set of bands at a single point.

Given a particular position (pixel position within a line and line number), find the values for a sub-set of bands, of size max_display_channel; if the image has fewer than this number of bands, duplicate the value of the first band to make up the missing values. Set the Tcl interpreter result to the sub-set of values, as a list of doubles. The Tcl object arguments required are passed in an array with the following arrangement:

  • objv[0] the command name.
  • objv[1] the image ID string.
  • objv[2] the pixel position within a line.
  • objv[3] the line number.

Parameters:
[in] client_data (unused).
[in] interp the Tcl interpreter.
[in] objc the number of Tcl object arguments (always four).
[in] objv the array of Tcl object arguments.
Returns:
TCL_OK on success, TCL_ERROR on errors.

Definition at line 292 of file Sadie_General.c.

References GetSadieImageFromObj(), GetSadieUintFromObj(), and MAX_DISPLAY_CHANNEL.

Referenced by Sadie_General_Init().

int Sadie_General_GmaxCmd ClientData  client_data,
Tcl_Interp *  interp,
int  objc,
Tcl_Obj *const   objv[]
 

Pass the newly determined minimum SADIE image pixel value to Tcl.

We determine the image-wide minimum pixel value in the SADIE image, and assign this to the Tcl interpreter result object (as a double value).

Parameters:
[in] client_data (unused).
[in] interp the main Tcl interpreter.
[in] objc number of Tcl object arguments (always two).
[in] objv Tcl object argument list (the image ID string).
Returns:
TCL_OK on success, TCL_ERROR on errors.

Definition at line 211 of file Sadie_General.c.

References GetSadieImageFromObj().

Referenced by Sadie_General_Init().

int Sadie_General_GminCmd ClientData  client_data,
Tcl_Interp *  interp,
int  objc,
Tcl_Obj *const   objv[]
 

Pass the newly determined minimum SADIE image pixel value to Tcl.

We determine the image-wide minimum pixel value in the SADIE image, and assign this to the Tcl interpreter result object (as a double value).

Parameters:
[in] client_data (unused).
[in] interp the main Tcl interpreter.
[in] objc number of Tcl object arguments (always two).
[in] objv Tcl object argument list (the image ID string).
Returns:
TCL_OK on success, TCL_ERROR on errors.

Definition at line 177 of file Sadie_General.c.

References GetSadieImageFromObj().

Referenced by Sadie_General_Init().

int Sadie_General_HeightCmd ClientData  client_data,
Tcl_Interp *  interp,
int  objc,
Tcl_Obj *const   objv[]
 

Pass the recorded height of a SADIE image to Tcl.

We recover the number of lines per band from the SADIE image, and assign this to the Tcl interpreter result object (as a long value).

Parameters:
[in] client_data (unused).
[in] interp the main Tcl interpreter.
[in] objc number of Tcl object arguments (always two).
[in] objv Tcl object argument list (the image ID string).
Returns:
TCL_OK on success, TCL_ERROR on errors.

Definition at line 144 of file Sadie_General.c.

References GetSadieImageFromObj().

Referenced by Sadie_General_Init().

int Sadie_General_IndexImageCmd ClientData  client_data,
Tcl_Interp *  interp,
int  objc,
Tcl_Obj *const   objv[]
 

Register a SADIE image within the global hash table.

We insert a new entry in the global hash table, representing the image and a table of additional properties (initially blank).

Parameters:
[in] client_data (unused).
[in] interp the main Tcl interpreter.
[in] objc number of Tcl object arguments (always two).
[in] objv Tcl object argument list (the image ID string).
Returns:
TCL_OK on success, TCL_ERROR on errors.

Definition at line 392 of file Sadie_General.c.

References GetSadieDkeyFromObj(), GetSadieImageFromObj(), and sad_put_doc().

Referenced by Sadie_General_Init().

int Sadie_General_Init Tcl_Interp *  interp  ) 
 

Make the commands defined in this file accessible to the Tcl interpreter.

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

Definition at line 433 of file Sadie_General.c.

References Sadie_General_CloseCmd(), Sadie_General_FinishProgCmd(), Sadie_General_GetNumBandsCmd(), Sadie_General_GetPixelCmd(), Sadie_General_GmaxCmd(), Sadie_General_GminCmd(), Sadie_General_HeightCmd(), Sadie_General_IndexImageCmd(), Sadie_General_InitializeProgCmd(), Sadie_General_SetNameCmd(), and Sadie_General_WidthCmd().

Referenced by Tcl_AppInit().

int Sadie_General_InitializeProgCmd ClientData  client_data,
Tcl_Interp *  interp,
int  objc,
Tcl_Obj *const   objv[]
 

SADIE library initialization.

Invoke the operation to initialize the SADIE library from Tcl code.

Parameters:
[in] client_data (unused).
[in] interp the main Tcl interpreter.
[in] objc number of Tcl object arguments (always one).
[in] objv Tcl object argument list (no arguments, just the name).
Returns:
TCL_OK unconditionally.

Definition at line 76 of file Sadie_General.c.

Referenced by Sadie_General_Init().

int Sadie_General_SetNameCmd ClientData  client_data,
Tcl_Interp *  interp,
int  objc,
Tcl_Obj *const   objv[]
 

Set the SADIE image text from a Tcl string value.

Replace the text in a SADIE image structure with new text taken from a Tcl string value, truncating it if it is too long. The Tcl object arguments required are passed in an array with the following arrangement:

  • objv[0] the command name.
  • objv[1] the image ID string.
  • objv[2] the new text string.

Parameters:
[in] client_data (unused).
[in] interp the Tcl interpreter.
[in] objc the number of Tcl object arguments (always three).
[in] objv the Tcl object argument array.
Returns:
TCL_OK on success, TCL_ERROR on errors.

Definition at line 359 of file Sadie_General.c.

References GetSadieImageFromObj().

Referenced by Sadie_General_Init().

int Sadie_General_WidthCmd ClientData  client_data,
Tcl_Interp *  interp,
int  objc,
Tcl_Obj *const   objv[]
 

Pass the recorded width of a SADIE image to Tcl.

We recover the number of pixels per line from the SADIE image, and assign this to the Tcl interpreter result object (as a long value).

Parameters:
[in] client_data (unused).
[in] interp the main Tcl interpreter.
[in] objc number of Tcl object arguments (always two).
[in] objv Tcl object argument list (the image ID string).
Returns:
TCL_OK on success, TCL_ERROR on errors.

Definition at line 111 of file Sadie_General.c.

References GetSadieImageFromObj().

Referenced by Sadie_General_Init().


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