/* Image file formats. */ /* Last edited on 2017-01-04 23:36:29 by stolfilocal */ #ifndef dsm_image_format_H #define dsm_image_format_H #define _GNU_SOURCE #include /* IMAGE FILE FORMATS */ typedef enum { dsm_image_format_PNG, /* PNG (Portable Network Graphics) format. */ dsm_image_format_PNM, /* PNM (Portable AnyMap) format; includes PBM, PGM, PPM. */ dsm_image_format_JPG /* JPEG format. */ } dsm_image_format_t; /* Codes for different image file formats. */ dsm_image_format_t dsm_image_format_arg_parse(argparser_t *pp, const char *keyword); /* Looks for a command line argument equal to {keyword} and parses the next argument as a file format spec, as described by {dsm_image_format_arg_INFO} below. */ #define dsm_image_format_arg_INFO \ "Allowed argument values" \ " are \"pnm\" (meaning the classic Portable" \ " Bitmap format), \"jpg\" or \"jpeg\" (Joint Photographic Experts Group" \ " format), or \"png\" (Portable Network Graphics format); or" \ " their uppercase versions. The \"pnm\" tag allows any of the" \ " formats PBM (bilevel), PGM (grayscale), and PPM (RGB color). The" \ " tags \"pbm\", \"ppm\", and \"pgm\", in upper or lower case, are" \ " also accepted as equivalent to \"pnm\", and each of them" \ " specifies 'any of the three formats'." #endif