29 if (!(
tile.size ==
tile.full_size)) {
36 if (image_output ==
nullptr) {
37 log_(
"Failed to create image file");
41 const int width =
tile.size.x;
42 const int height =
tile.size.y;
44 const ImageSpec spec(width, height, 4, TypeDesc::FLOAT);
45 if (!image_output->open(
filepath_, spec)) {
46 log_(
"Failed to create image file");
51 if (!
tile.get_pass_pixels(
pass_, 4, pixels.data())) {
52 log_(
"Failed to read render pass pixels");
57 OIIO::ImageBuf image_buffer(spec,
58 pixels.data() + (height - 1) * width * 4,
60 -width * 4 *
sizeof(
float),
68 const float g = 1.0f / 2.2f;
69 OIIO::ImageBufAlgo::pow(image_buffer, image_buffer, {g, g, g, 1.0f});
73 image_buffer.set_write_format(TypeDesc::FLOAT);
74 image_buffer.write(image_output.get());
75 image_output->close();