7 int SaveEXRSnapshot(
const char* outfilename,
int width,
int height,
const float* rgb);
11#define TINYEXR_IMPLEMENTATION
14int SaveEXRSnapshot(
const char* outfilename,
int width,
int height,
const float* rgb)
24 std::vector<float> images[3];
25 images[0].resize(width * height);
26 images[1].resize(width * height);
27 images[2].resize(width * height);
29 for (
int i = 0; i < width * height; i++)
31 images[0][i] = rgb[3*i+0];
32 images[1][i] = rgb[3*i+1];
33 images[2][i] = rgb[3*i+2];
37 image_ptr[0] = &(images[2].at(0));
38 image_ptr[1] = &(images[1].at(0));
39 image_ptr[2] = &(images[0].at(0));
41 image.
images = (
unsigned char**)image_ptr;
54 std::time_t timestamp;
55 std::time(×tamp);
56 char signatureStringIntro[255] =
"Generated by Oolite ";
57 char *signatureString = strcat(signatureStringIntro, std::ctime(×tamp));
59 signatureString[strlen(signatureString) - 1] =
'\0';
80 fprintf(stderr,
"Save EXR err: %s\n", err);
90int SaveEXRSnapshot(
const char* outfilename,
int width,
int height,
const float* rgb)
92 fprintf(stderr,
"EXR Snapshot not supported yet under Linux!\n");
int SaveEXRSnapshot(const char *outfilename, int width, int height, const float *rgb)
#define TINYEXR_PIXELTYPE_HALF
#define TINYEXR_COMPRESSIONTYPE_ZIP
void InitEXRHeader(EXRHeader *exr_header)
#define TINYEXR_PIXELTYPE_FLOAT
void InitEXRImage(EXRImage *exr_image)
int SaveEXRImageToFile(const EXRImage *image, const EXRHeader *exr_header, const char *filename, const char **err)