~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Tina6/tina-libs/demo/example/example.c

Version: ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /**********
  2  * 
  3  * This file is part of the TINA Open Source Image Analysis Environment
  4  * henceforth known as TINA
  5  *
  6  * TINA is free software; you can redistribute it and/or modify
  7  * it under the terms of the GNU Lesser General Public License as 
  8  * published by the Free Software Foundation.
  9  *
 10  * TINA is distributed in the hope that it will be useful,
 11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 13  * GNU Lesser General Public License for more details.
 14  *
 15  * You should have received a copy of the GNU Lesser General Public License
 16  * along with TINA; if not, write to the Free Software Foundation, Inc., 
 17  * 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 18  *
 19  **********
 20  * 
 21  * Program :    TINA
 22  * File    :  $Source: /home/tina/cvs/tina-libs/demo/example/example.c,v $
 23  * Date    :  $Date: 2007/02/15 01:52:29 $
 24  * Version :  $Revision: 1.5 $
 25  * CVS Id  :  $Id: example.c,v 1.5 2007/02/15 01:52:29 paul Exp $
 26  *
 27  * Author  :  Tony lacey (a.lacey@man.ac.uk)
 28  *
 29  * Notes   :
 30  * 
 31  * Demonstration program for using tina libraries
 32  * 
 33  *********
 34 */
 35 
 36 #if HAVE_CONFIG_H
 37   #include <config.h>
 38 #endif
 39 
 40 #include <stdio.h>
 41 #include <tina/image/imgDef.h>
 42 #include <tina/image/imgPro.h>
 43 #include <tina/file/fileDef.h>
 44 #include <tina/file/filePro.h>
 45 
 46 int main(int argvc, char **argv)
 47 {
 48         Imrect *im1, *im2, *im3;
 49 
 50         /*
 51          * create an image of a black and white checquerboard (0 and 1 values)
 52          * 256 pixels in height, 256 pixels wide and with a 16 by 16 pattern.
 53          * A pointer to an Imrect structure (the basic image structure in tina)
 54          * is returned.  The data in this image is of type float.
 55          */
 56         printf("Generating image...\n");
 57         im1 = imf_checquer(256, 256, 16, 16);
 58         
 59         /*
 60          * generate a new image which is the horizontal gradients of the chequerboard
 61          * This function convolves the original image with a [-1, 0, 1] mask at
 62          * every pixel location
 63          */
 64         printf("Processing image...\n");
 65         im2 = imf_grad_h(im1);
 66         im3 = im_tsmooth(im2);
 67 
 68         /* 
 69          * write the gradient image to a pgm format file
 70          */
 71         printf("Writing image...\n");
 72         if (pgm_write_image(im2, "example.pgm") != 0)
 73         {
 74                 printf("Error writing pgm image file\n");
 75                 exit(-1);
 76         }
 77 
 78     /*
 79      * free the image structures used
 80      */
 81         im_free(im1);
 82         im_free(im2);
 83         im_free(im3);
 84 
 85         /* Doing this messes up running it via `make check'.  */
 86 /*      printf("Finished - hit return to continue...");
 87         getchar(); */
 88 
 89         return 0;
 90 }
 91 
 92 
 93 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.