| 1204 | } |
| 1205 | |
| 1206 | static stbi__uint16 *stbi__convert_8_to_16(stbi_uc *orig, int w, int h, int channels) |
| 1207 | { |
| 1208 | int i; |
| 1209 | int img_len = w * h * channels; |
| 1210 | stbi__uint16 *enlarged; |
| 1211 | |
| 1212 | enlarged = (stbi__uint16 *) stbi__malloc(img_len*2); |
| 1213 | if (enlarged == NULL) return (stbi__uint16 *) stbi__errpuc("outofmem", "Out of memory"); |
| 1214 | |
| 1215 | for (i = 0; i < img_len; ++i) |
| 1216 | enlarged[i] = (stbi__uint16)((orig[i] << 8) + orig[i]); // replicate to high and low byte, maps 0->0, 255->0xffff |
| 1217 | |
| 1218 | STBI_FREE(orig); |
| 1219 | return enlarged; |
| 1220 | } |
| 1221 | |
| 1222 | static void stbi__vertical_flip(void *image, int w, int h, int bytes_per_pixel) |
| 1223 | { |
no test coverage detected