Miscellaneous utility functions.  
More...
Detailed Description
Miscellaneous utility functions. 
Copyright (C) 2006 Rob Hess <hess@eecs.oregonstate.edu>
- Version:
 - 1.1.1-20070119 
 
Definition in file utils.h.
 
Go to the source code of this file.
Defines | 
| 
#define  | ABS(x)   ( ( x < 0 )? -x : x ) | 
Functions | 
| static int  | pixval8 (IplImage *img, int r, int c) | 
|   | A function to get a pixel value from an 8-bit unsigned image.  
  | 
| static void  | setpix8 (IplImage *img, int r, int c, uchar val) | 
|   | A function to set a pixel value in an 8-bit unsigned image.  
  | 
| static float  | pixval32f (IplImage *img, int r, int c) | 
|   | A function to get a pixel value from a 32-bit floating-point image.  
  | 
| static void  | setpix32f (IplImage *img, int r, int c, float val) | 
|   | A function to set a pixel value in a 32-bit floating-point image.  
  | 
| static double  | pixval64f (IplImage *img, int r, int c) | 
|   | A function to get a pixel value from a 64-bit floating-point image.  
  | 
| static void  | setpix64f (IplImage *img, int r, int c, double val) | 
|   | A function to set a pixel value in a 64-bit floating-point image.  
  | 
| void  | fatal_error (char *format,...) | 
|   | Prints an error message and aborts the program.  
  | 
| int  | array_double (void **array, int n, int size) | 
|   | Doubles the size of an array with error checking.  
  | 
Function Documentation
Doubles the size of an array with error checking. 
- Parameters:
 - 
  
    | array | pointer to an array whose size is to be doubled  | 
    | n | number of elements allocated for array  | 
    | size | size in bytes of elements in array  | 
  
   
- Returns:
 - Returns the new number of elements allocated for array. If no memory is available, returns 0 and frees array. 
 
 
 
Prints an error message and aborts the program. 
The error message is of the form "Error: ...", where the ... is specified by the format argument
- Parameters:
 - 
  
    | format | an error message format string (as with printf(3)).  | 
  
   
 
 
      
        
          | static float pixval32f  | 
          ( | 
          IplImage *  | 
          img,  | 
        
        
           | 
           | 
          int  | 
          r,  | 
        
        
           | 
           | 
          int  | 
          c  | 
        
        
           | 
          ) | 
           |  [inline, static] | 
        
      
 
A function to get a pixel value from a 32-bit floating-point image. 
- Parameters:
 - 
  
  
 
- Returns:
 - Returns the value of the pixel at (r, c) in img 
 
Definition at line 62 of file utils.h.
 
 
      
        
          | static double pixval64f  | 
          ( | 
          IplImage *  | 
          img,  | 
        
        
           | 
           | 
          int  | 
          r,  | 
        
        
           | 
           | 
          int  | 
          c  | 
        
        
           | 
          ) | 
           |  [inline, static] | 
        
      
 
A function to get a pixel value from a 64-bit floating-point image. 
- Parameters:
 - 
  
  
 
- Returns:
 - Returns the value of the pixel at (r, c) in img 
 
Definition at line 90 of file utils.h.
 
 
      
        
          | static int pixval8  | 
          ( | 
          IplImage *  | 
          img,  | 
        
        
           | 
           | 
          int  | 
          r,  | 
        
        
           | 
           | 
          int  | 
          c  | 
        
        
           | 
          ) | 
           |  [inline, static] | 
        
      
 
A function to get a pixel value from an 8-bit unsigned image. 
- Parameters:
 - 
  
  
 
- Returns:
 - Returns the value of the pixel at (r, c) in img 
 
Definition at line 34 of file utils.h.
 
 
      
        
          | static void setpix32f  | 
          ( | 
          IplImage *  | 
          img,  | 
        
        
           | 
           | 
          int  | 
          r,  | 
        
        
           | 
           | 
          int  | 
          c,  | 
        
        
           | 
           | 
          float  | 
          val  | 
        
        
           | 
          ) | 
           |  [inline, static] | 
        
      
 
A function to set a pixel value in a 32-bit floating-point image. 
- Parameters:
 - 
  
    | img | an image  | 
    | r | row  | 
    | c | column  | 
    | val | pixel value  | 
  
   
Definition at line 76 of file utils.h.
 
 
      
        
          | static void setpix64f  | 
          ( | 
          IplImage *  | 
          img,  | 
        
        
           | 
           | 
          int  | 
          r,  | 
        
        
           | 
           | 
          int  | 
          c,  | 
        
        
           | 
           | 
          double  | 
          val  | 
        
        
           | 
          ) | 
           |  [inline, static] | 
        
      
 
A function to set a pixel value in a 64-bit floating-point image. 
- Parameters:
 - 
  
    | img | an image  | 
    | r | row  | 
    | c | column  | 
    | val | pixel value  | 
  
   
Definition at line 104 of file utils.h.
 
 
      
        
          | static void setpix8  | 
          ( | 
          IplImage *  | 
          img,  | 
        
        
           | 
           | 
          int  | 
          r,  | 
        
        
           | 
           | 
          int  | 
          c,  | 
        
        
           | 
           | 
          uchar  | 
          val  | 
        
        
           | 
          ) | 
           |  [inline, static] | 
        
      
 
A function to set a pixel value in an 8-bit unsigned image. 
- Parameters:
 - 
  
    | img | an image  | 
    | r | row  | 
    | c | column  | 
    | val | pixel value  | 
  
   
Definition at line 48 of file utils.h.