default minimal header. modify if you want more information in header */
| 462 | |
| 463 | /* default minimal header. modify if you want more information in header */ |
| 464 | ILboolean RGBE_WriteHeader(ILuint width, ILuint height, rgbe_header_info *info) |
| 465 | { |
| 466 | char *programtype = (char*)"RGBE"; |
| 467 | |
| 468 | if (info && (info->valid & RGBE_VALID_PROGRAMTYPE)) |
| 469 | programtype = (char*)info->programtype; |
| 470 | if (ilprintf("#?%s\n",programtype) < 0) |
| 471 | return IL_FALSE; |
| 472 | /* The #? is to identify file type, the programtype is optional. */ |
| 473 | if (info && (info->valid & RGBE_VALID_GAMMA)) { |
| 474 | if (ilprintf("GAMMA=%g\n",info->gamma) < 0) |
| 475 | return IL_FALSE; |
| 476 | } |
| 477 | if (info && (info->valid & RGBE_VALID_EXPOSURE)) { |
| 478 | if (ilprintf("EXPOSURE=%g\n",info->exposure) < 0) |
| 479 | return IL_FALSE; |
| 480 | } |
| 481 | if (ilprintf("FORMAT=32-bit_rle_rgbe\n\n") < 0) |
| 482 | return IL_FALSE; |
| 483 | if (ilprintf("-Y %d +X %d\n", height, width) < 0) |
| 484 | return IL_FALSE; |
| 485 | return IL_TRUE; |
| 486 | } |
| 487 | |
| 488 | |
| 489 | /* simple write routine that does not use run length encoding */ |