struct colorize_priv *cp = (struct colorize_priv *) priv;
guchar *data;
int rs, i, j;
- unsigned char *buffer;
+ unsigned short *buffer;
GtkWidget *dialog;
char *filename = NULL;
data = gdk_pixbuf_get_pixels(cp->pixbuf);
rs = gdk_pixbuf_get_rowstride(cp->pixbuf);
- buffer = malloc(cp->width*cp->height*3);
+ buffer = malloc(cp->width*cp->height*3*sizeof(unsigned short));
for (i = 0; i < cp->height; i++) {
for (j = 0; j < cp->width; j++) {
- buffer[(i*cp->width+j)*3+0] = data[i*rs+j*3+0];
- buffer[(i*cp->width+j)*3+1] = data[i*rs+j*3+1];
- buffer[(i*cp->width+j)*3+2] = data[i*rs+j*3+2];
+ buffer[(i*cp->width+j)*3+0] = data[i*rs+j*3+0] << 8;
+ buffer[(i*cp->width+j)*3+1] = data[i*rs+j*3+1] << 8;
+ buffer[(i*cp->width+j)*3+2] = data[i*rs+j*3+2] << 8;
}
}