equal
deleted
inserted
replaced
116 |
116 |
117 struct image *img; |
117 struct image *img; |
118 new_image(&img, w, h, 3); |
118 new_image(&img, w, h, 3); |
119 |
119 |
120 Float *fd = fdata; |
120 Float *fd = fdata; |
121 for (char *cd = img->data; cd != img->data + w*h*3; cd++, fd++) { |
121 for (unsigned char *cd = img->data; cd != img->data + w*h*3; cd++, fd++) { |
122 if (*fd > 1.0) |
122 if (*fd > 1.0) |
123 *cd = 255; |
123 *cd = 255; |
124 else |
124 else |
125 *cd = (unsigned char)(*fd * 255.0); |
125 *cd = (unsigned char)(*fd * 255.0); |
126 } |
126 } |