+ int opt;
+
+ char filename[FILENAME_MAX] = {0};
+ int format = AM7x01_IMAGE_FORMAT_JPEG;
+ int width = 800;
+ int height = 480;
+ uint8_t *image = NULL;
+ int size = 59475;
+
+ while ((opt = getopt(argc, argv, "f:F:W:H:h")) != -1) {
+ switch (opt) {
+ case 'f':
+ strncpy(filename, optarg, FILENAME_MAX);
+ break;
+ case 'F':
+ format = atoi(optarg);
+ if (format != 1) {
+ fprintf(stderr, "Unsupported format\n");
+ exit(EXIT_FAILURE);
+ }
+ break;
+ case 'W':
+ width = atoi(optarg);
+ if (width < 0) {
+ fprintf(stderr, "Unsupported width\n");
+ exit(EXIT_FAILURE);
+ }
+ break;
+ case 'H':
+ height = atoi(optarg);
+ if (height < 0) {
+ fprintf(stderr, "Unsupported height\n");
+ exit(EXIT_FAILURE);
+ }
+ break;
+ default: /* '?' */
+ usage(argv[0]);
+ exit(EXIT_FAILURE);
+ }
+ }