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

Sadie_NewFunctions.c File Reference

A Tcl/Tk interface to the SADIE operations that synthesize images. More...

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

Go to the source code of this file.

Functions

int Sadie_NewFunctions_SineWaveCmd (ClientData client_data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
 Synthesize an image with a horizontal sine wave pattern.
int Sadie_NewFunctions_ChirpCmd (ClientData client_data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
 Synthesize a two-dimensional chirp test pattern.
int Sadie_NewFunctions_SineStarCmd (ClientData client_data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
 Synthesize a radially-symmetrical sine test pattern.
int Sadie_NewFunctions_CheckerboardCmd (ClientData client_data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
 Synthesize a test pattern of alternating black and white rectangles.
int Sadie_NewFunctions_GrayScaleCmd (ClientData client_data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
 Synthesize a uniform horizontal gradient image.
int Sadie_NewFunctions_FunctionCmd (ClientData client_data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
 Synthesize a windowing function image.
int Sadie_NewFunctions_RandomCmd (ClientData client_data, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[])
 Synthesize an image filled with random noise.
int Sadie_NewFunctions_Init (Tcl_Interp *interp)
 Make the commands defined in this file accessible to the Tcl interpreter.


Detailed Description

A Tcl/Tk interface to the SADIE operations that synthesize images.

It is often useful to synthesize an image by a simple algorithm rather than by importing some kind of sensor data, not only for having test patterns to check the results of applying sequences of image processing operations, or simulated noise for modeling processes of image degradation, but also to act as masks or windows for operations such as Fourier transforms. The SADIE library includes sever operations for synthesizing all these types of image, and we define the Tcl/Tk interface to them here.

Author:
University of Arizona Digital Image Analysis Lab
Date:
1999, 2004
Version:
Id
Sadie_NewFunctions.c,v 2.6 2005/03/22 21:42:33 mmunro Exp

Definition in file Sadie_NewFunctions.c.


Function Documentation

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

Synthesize a test pattern of alternating black and white rectangles.

The SADIE library function CHECKER synthesizes an image tiled with regularly alternating black and white rectangles of the specified size, starting from the top left corner. The Tcl data should conform to the patterns:

  • tcl_array_name(lines) the number of lines in the synthesized image.
  • tcl_array_name(pix) pixels per line in the synthesized image.
  • tcl_array_name(checkpix) horizontal rectangle size (pixel units).
  • tcl_array_name(checklines) vertical rectangle size (pixel units).
  • tcl_array_name(DEFAULT_OUT_IMAGE_NAME_INDEX) synthesized image name.

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

Definition at line 203 of file Sadie_NewFunctions.c.

References GetSadieUintFromObj2(), and SetSadieImageObj2().

Referenced by Sadie_NewFunctions_Init().

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

Synthesize a two-dimensional chirp test pattern.

The SADIE library function CHIRP synthesizes a two-dimensional sinusoidal pattern with the frequency of the sinusoid increasing with distance from the center of the pattern. The pattern itself is periodic, with the specified period in pixel units being the interval between pattern centers. The Tcl data should conform to the patterns:

  • tcl_array_name(lines) the number of lines in the synthesized image.
  • tcl_array_name(pix) pixels per line in the synthesized image.
  • tcl_array_name(period) repetition interval for the pattern.
  • tcl_array_name(DEFAULT_OUT_IMAGE_NAME_INDEX) synthesized image name.

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

Definition at line 118 of file Sadie_NewFunctions.c.

References GetSadieDoubleFromObj2(), GetSadieUintFromObj2(), and SetSadieImageObj2().

Referenced by Sadie_NewFunctions_Init().

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

Synthesize a windowing function image.

FUNCTION in the SADIE library sythesizes images with values determined by one of a family of functions intended to be useful for windowing and similar operations. They generally have radial symmetry about the image center (except for the similarly centered box function), modified by different scale factors for the horizontal and vertical axes, and values scaled to range from SMIN to SMAX (defined in sadie.h). An type code, also defined in sadie.h, selects the particular function to use :

  • CONE uniform radial gradient (2D triangle),
  • NEGEXP 2D negative exponential,
  • GAUSS 2D Gaussian,
  • BOX centered square or rectangle,
  • CYLINDER centered circle or elipse,
  • HANNING 2D Hanning window (a modified truncated cosine),
  • HAMMING 2D Hamming window (another modified truncated cosine),
  • KAISER Kaiser window (with @ alpha specifying sidelobe attenuation),
  • SINC 2D version of the sinc function.

The Tcl data should conform to the patterns:

  • tcl_array_name(lines) the number of lines in the synthesized image.
  • tcl_array_name(pix) pixels per line in the synthesized image.
  • tcl_array_name(type) function type code.
  • tcl_array_name(radiuslines) defines the vertical scaling.
  • tcl_array_name(radiuspix) defines the horizontal scaling.
  • tcl_array_name(alpha) sidelobe attenuation for the Kaiser window.
  • tcl_array_name(DEFAULT_OUT_IMAGE_NAME_INDEX) synthesized image name.

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

Definition at line 312 of file Sadie_NewFunctions.c.

References GetSadieDoubleFromObj2(), GetSadieIntFromObj2(), GetSadieUintFromObj2(), and SetSadieImageObj2().

Referenced by Sadie_NewFunctions_Init().

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

Synthesize a uniform horizontal gradient image.

The SADIE library function GRAYSCAL synthesizes an image of the specified size filled with a uniform horizontal gradient from a starting greylevel to an ending greylevel (imposing a limitation that the start must be darker than the end). The Tcl data should conform to the patterns:

  • tcl_array_name(lines) the number of lines in the synthesized image.
  • tcl_array_name(pix) pixels per line in the synthesized image.
  • tcl_array_name(number) number of greylevels (broken at present?).
  • tcl_array_name(min) starting value for the gradient.
  • tcl_array_name(max) ending value for the gradient.
  • tcl_array_name(DEFAULT_OUT_IMAGE_NAME_INDEX) synthesized image name.

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

Definition at line 249 of file Sadie_NewFunctions.c.

References GetSadiePixelFromObj2(), GetSadieUintFromObj2(), and SetSadieImageObj2().

Referenced by Sadie_NewFunctions_Init().

int Sadie_NewFunctions_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.

Definition at line 396 of file Sadie_NewFunctions.c.

References Sadie_NewFunctions_CheckerboardCmd(), Sadie_NewFunctions_ChirpCmd(), Sadie_NewFunctions_FunctionCmd(), Sadie_NewFunctions_GrayScaleCmd(), Sadie_NewFunctions_RandomCmd(), Sadie_NewFunctions_SineStarCmd(), and Sadie_NewFunctions_SineWaveCmd().

Referenced by Tcl_AppInit().

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

Synthesize an image filled with random noise.

The SADIE library function RANDOM synthesizes an image of the specified size filled with noise generated as random numbers from either a uniform or a Gaussian distribution, depending on whether a type parameter equals UNIFORM or GAUSSIAN respectively (constants defined in sadie.h). The Tcl data should conform to the patterns:

  • tcl_array_name(lines) the number of lines in the synthesized image.
  • tcl_array_name(pix) pixels per line in the synthesized image.
  • tcl_array_name(type) the uniform or Gaussian type code.
  • tcl_array_name(deviation) Gaussian standard deviation, uniform scale.
  • tcl_array_name(DEFAULT_OUT_IMAGE_NAME_INDEX) synthesized image name.

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

Definition at line 363 of file Sadie_NewFunctions.c.

References GetSadieDoubleFromObj2(), GetSadieIntFromObj2(), GetSadieUintFromObj2(), and SetSadieImageObj2().

Referenced by Sadie_NewFunctions_Init().

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

Synthesize a radially-symmetrical sine test pattern.

The SADIE library function SINESTAR synthesizes a two-dimensional sine test pattern that uses polar coordinates with an origin in at the center of the image. For each concentric circle, it sets the image intensity to the sine of the angle scaled by a frequency factor in hertz (cycles round the circle). The Tcl data should conform to the patterns:

  • tcl_array_name(lines) the number of lines in the synthesized image.
  • tcl_array_name(pix) pixels per line in the synthesized image.
  • tcl_array_name(period) the radial repetition frequency of the pattern.
  • tcl_array_name(DEFAULT_OUT_IMAGE_NAME_INDEX) synthesized image name.

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

Definition at line 161 of file Sadie_NewFunctions.c.

References GetSadieDoubleFromObj2(), GetSadieUintFromObj2(), and SetSadieImageObj2().

Referenced by Sadie_NewFunctions_Init().

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

Synthesize an image with a horizontal sine wave pattern.

The SADIE library function SINEWAVE scales a sine function so that its maxima are at the value SMAX and its minima are at SMIN (as defined in sadie.h), with a period of the specified number of pixels, and uses it to synthesize the values of a line of pixels, which it repeats for the specified number of lines vertically to produce a pattern of vertical light and dark bands. The phase is the displacement of the sine function's origin from the start of a line, in pixel units. The Tcl data should conform to the patterns:

  • tcl_array_name(lines) the number of lines in the synthesized image.
  • tcl_array_name(pix) pixels per line in the synthesized image.
  • tcl_array_name(period) period of the sine function (pixel units).
  • tcl_array_name(phase) horizontal offset of the function origin.
  • tcl_array_name(DEFAULT_OUT_IMAGE_NAME_INDEX) synthesized image name.

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

Definition at line 73 of file Sadie_NewFunctions.c.

References GetSadieDoubleFromObj2(), GetSadieUintFromObj2(), and SetSadieImageObj2().

Referenced by Sadie_NewFunctions_Init().


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