/* depend: */
/* cflags: */
-/* linker: color.o debug.o image.o pnm.o -lncursesw */
-/* doslnk: color.o debug.o image.o pnm.o -lpdc~2 */
-/* winlnk: color.o debug.o image.o pnm.o -lpdcursesw */
+/* 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 */
#include <curses.h>
#include <stdio.h>
int width = min (image->width - xcursor, COLS / mode);
int height = min (image->height - ycursor, LINES);
+ VERBOSE (DEBUG, FILE *fd = fopen ("my.log", "a"); fprintf (fd, "(%d, %d)\n", width, height); fclose (fd));
int x, y;
for (y = 0; y < height; y++) {
for (x = 0; x < width; x++) {
int ind = (x + xcursor) + image->width * (y + ycursor);
- color_t *color = findcolor (image->red[ind], image->green[ind], image->blue[ind], colormap);
- //color_t *color = findcolor (correction (image->red[ind], gf[0]), correction (image->green[ind], gf[1]), correction (image->blue[ind], gf[2]), colormap);
+ color_t *color = findcolor (correction (image->red[ind], gf[0]),
+ correction (image->green[ind], gf[1]),
+ correction (image->blue[ind], gf[2]), colormap);
attron (COLOR_PAIR (color->code));
-
+
move (y, x * mode);
- cchar_t tmp;
- wchar_t tmp_wchar[2] = {0};
- tmp_wchar[0] = (wchar_t) ' ';
- setcchar (&tmp, tmp_wchar, A_NORMAL, 0, NULL);
- add_wch (&tmp);
+ cchar_t cchar;
+ wchar_t wchar[2] = {0};
+ wchar[0] = (wchar_t) ' ';
+ setcchar (&cchar, wchar, A_NORMAL, 0, NULL);
+ add_wch (&cchar);
if (mode == 2) {
move (y, x * mode + 1);
- add_wch (&tmp);
+ add_wch (&cchar);
}
}
+ refresh ();
}
refresh ();
attron (COLOR_PAIR (0));