Changeset View
Changeset View
Standalone View
Standalone View
source/blender/imbuf/intern/radiance_hdr.c
| Show First 20 Lines • Show All 206 Lines • ▼ Show 20 Lines | if (strstr((char *)buf, "#?")) { | ||||
| return 1; | return 1; | ||||
| } | } | ||||
| // if (strstr((char *)buf, "32-bit_rle_rgbe")) return 1; | // if (strstr((char *)buf, "32-bit_rle_rgbe")) return 1; | ||||
| return 0; | return 0; | ||||
| } | } | ||||
| struct ImBuf *imb_loadhdr(const unsigned char *mem, | struct ImBuf *imb_loadhdr(const unsigned char *mem, | ||||
| size_t size, | size_t size, | ||||
| int flags, | eImBufFlags flags, | ||||
| char colorspace[IM_MAX_SPACE]) | char colorspace[IM_MAX_SPACE]) | ||||
| { | { | ||||
| struct ImBuf *ibuf; | struct ImBuf *ibuf; | ||||
| RGBE *sline; | RGBE *sline; | ||||
| fCOLOR fcol; | fCOLOR fcol; | ||||
| float *rect_float; | float *rect_float; | ||||
| int found = 0; | int found = 0; | ||||
| int width = 0, height = 0; | int width = 0, height = 0; | ||||
| ▲ Show 20 Lines • Show All 179 Lines • ▼ Show 20 Lines | static void writeHeader(FILE *file, int width, int height) | ||||
| fputc(10, file); | fputc(10, file); | ||||
| fprintf(file, "FORMAT=32-bit_rle_rgbe"); | fprintf(file, "FORMAT=32-bit_rle_rgbe"); | ||||
| fputc(10, file); | fputc(10, file); | ||||
| fputc(10, file); | fputc(10, file); | ||||
| fprintf(file, "-Y %d +X %d", height, width); | fprintf(file, "-Y %d +X %d", height, width); | ||||
| fputc(10, file); | fputc(10, file); | ||||
| } | } | ||||
| int imb_savehdr(struct ImBuf *ibuf, const char *name, int flags) | int imb_savehdr(struct ImBuf *ibuf, const char *name, eImBufFlags flags) | ||||
| { | { | ||||
| FILE *file = BLI_fopen(name, "wb"); | FILE *file = BLI_fopen(name, "wb"); | ||||
| float *fp = NULL; | float *fp = NULL; | ||||
| size_t width = ibuf->x, height = ibuf->y; | size_t width = ibuf->x, height = ibuf->y; | ||||
| unsigned char *cp = NULL; | unsigned char *cp = NULL; | ||||
| (void)flags; /* unused */ | (void)flags; /* unused */ | ||||
| Show All 30 Lines | |||||