| 1223 | } |
| 1224 | |
| 1225 | static stbi__uint16* stbi__convert_8_to_16(stbi_uc* orig, int w, int h, int channels) { |
| 1226 | int i; |
| 1227 | int img_len = w * h * channels; |
| 1228 | stbi__uint16* enlarged; |
| 1229 | |
| 1230 | enlarged = (stbi__uint16*)stbi__malloc(img_len * 2); |
| 1231 | if (enlarged == NULL) |
| 1232 | return (stbi__uint16*)stbi__errpuc("outofmem", "Out of memory"); |
| 1233 | |
| 1234 | for (i = 0; i < img_len; ++i) |
| 1235 | enlarged[i] = (stbi__uint16)((orig[i] << 8) + orig[i]); // replicate to high |
| 1236 | // and low byte, maps |
| 1237 | // 0->0, 255->0xffff |
| 1238 | |
| 1239 | STBI_FREE(orig); |
| 1240 | return enlarged; |
| 1241 | } |
| 1242 | |
| 1243 | static void stbi__vertical_flip(void* image, int w, int h, int bytes_per_pixel) { |
| 1244 | int row; |
no test coverage detected