/* linker: color.o debug.o image.o pnm.o -lncursesw -lm */
/* doslnk: color.o debug.o image.o pnm.o -lpdc~2 -lm */
/* winlnk: color.o debug.o image.o pnm.o -lpdcursesw -lm */
/* linker: color.o debug.o image.o pnm.o -lncursesw -lm */
/* doslnk: color.o debug.o image.o pnm.o -lpdc~2 -lm */
/* winlnk: color.o debug.o image.o pnm.o -lpdcursesw -lm */
- case 'g':
- arg = (arg[2]) ? arg + 2 : (--argc > 0) ? *(++argv) : NULL;
- if (arg == NULL) {
- VERBOSE (ERROR, fprintf (stderr, "%s: no gamma specified\n", progname));
- return usage (1);
- }
- gf[0] = strtof (arg, &pt);
- if (*pt == '\0') {
- gf[1] = gf[2] = gf[0];
- } else if (*pt == ':') {
- gf[1] = strtof (pt + 1, &pt);
- if (*pt == ':') {
- gf[2] = strtof (pt + 1, &pt);
+ case 'g':
+ arg = (arg[2]) ? arg + 2 : (--argc > 0) ? *(++argv) : NULL;
+ if (arg == NULL) {
+ VERBOSE (ERROR, fprintf (stderr, "%s: no gamma specified\n", progname));
+ return usage (1);
+ }
+ gf[0] = strtof (arg, &pt);
+ if (*pt == '\0') {
+ gf[1] = gf[2] = gf[0];
+ } else if (*pt == ':') {
+ gf[1] = strtof (pt + 1, &pt);
+ if (*pt == ':') {
+ gf[2] = strtof (pt + 1, &pt);
+ } else {
+ gf[2] = 0;
+ }
- } else {
- gf[1] = gf[2] = 0;
- }
- break;
- case 't':
- mode = 1;
- break;
- case 'v':
- arg = (arg[2]) ? arg + 2 : (--argc > 0) ? *(++argv) : NULL;
- if (arg == NULL) {
- VERBOSE (ERROR, fprintf (stderr, "%s: missing verbose level\n", progname));
- return usage (1);
- }
- verbose = atoi (arg);
- break;
- case 'w':
- mode = 2;
- break;
- case 'h':
- default:
- return usage (c != 'h');
+ break;
+ case 't':
+ mode = 1;
+ break;
+ case 'v':
+ arg = (arg[2]) ? arg + 2 : (--argc > 0) ? *(++argv) : NULL;
+ if (arg == NULL) {
+ VERBOSE (ERROR, fprintf (stderr, "%s: missing verbose level\n", progname));
+ return usage (1);
+ }
+ verbose = atoi (arg);
+ break;
+ case 'w':
+ mode = 2;
+ break;
+ case 'h':
+ default:
+ return usage (c != 'h');
images[i] = shrinkimage (images[1], i);
}
images[0] = expandimage (images[1], 2);
images[i] = shrinkimage (images[1], i);
}
images[0] = expandimage (images[1], 2);
/* check cursor location */
if (images[scale]->width - xcursor < COLS / mode) {
int newxcursor = max (0, images[scale]->width - COLS / mode);
/* check cursor location */
if (images[scale]->width - xcursor < COLS / mode) {
int newxcursor = max (0, images[scale]->width - COLS / mode);
int width = min (images[scale]->width - xcursor, COLS / mode);
int height = min (images[scale]->height - ycursor, LINES);
VERBOSE (DEBUG, FILE *fd = fopen ("my.log", "a"); fprintf (fd, "(%d, %d)\n", width, height); fclose (fd));
int width = min (images[scale]->width - xcursor, COLS / mode);
int height = min (images[scale]->height - ycursor, LINES);
VERBOSE (DEBUG, FILE *fd = fopen ("my.log", "a"); fprintf (fd, "(%d, %d)\n", width, height); fclose (fd));
int ind = x + xcursor + images[scale]->width * (y + ycursor);
//if (ind >= images[scale]->width * images[scale]->height) {
int ind = x + xcursor + images[scale]->width * (y + ycursor);
//if (ind >= images[scale]->width * images[scale]->height) {