#include <stdio.h>#include <stdlib.h>#include <malloc.h>#include <math.h>#include <string.h>#include <unistd.h>#include <ppm.h>#include "hsv_test.proto"Go to the source code of this file.
Functions | |
| int | main (int argc, char *argv[]) |
| int main | ( | int | argc, | |
| char * | argv[] | |||
| ) |
Definition at line 11 of file hsv_test.c.
References hsv_test_pattern(), ppm_handle_error(), PPM_OK, PPM_RAW, and write_ppm().
00011 { 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 }
1.5.6