hsv_test.c

Go to the documentation of this file.
00001 #include <stdio.h>
00002 #include <stdlib.h>
00003 #include <malloc.h>
00004 #include <math.h>
00005 #include <string.h>
00006 #include <unistd.h>
00007 #include <ppm.h>
00008 
00009 #include "hsv_test.proto"
00010 
00011 int main(int argc, char *argv[]) {
00012   
00013   PPM *im_hsv;
00014   enum file_types ppm_type;
00015   enum ppm_error the_error;
00016   int dim;
00017   float f;
00018   double V;
00019 
00020   switch(argc) {
00021   case 3:
00022     dim = atoi(argv[1]);
00023     sscanf(argv[2], "%f", &f);
00024     V = (double)f;
00025     break;
00026   default:
00027     fprintf(stderr, "Usage: %s dimension value\n\n", argv[0]);
00028     exit(1);
00029     break;
00030   }
00031 
00032   im_hsv = hsv_test_pattern(dim, V);
00033   if ((the_error = write_ppm(stdout, im_hsv, PPM_RAW)) != PPM_OK) {
00034     ppm_handle_error(the_error);
00035     exit(1);
00036   }
00037 
00038   exit(0);
00039 }

Generated on Wed Jan 7 00:30:36 2009 for Gift by  doxygen 1.5.6