26 if (!(
tile.size ==
tile.full_size)) {
32 unique_ptr<ImageOutput> image_output(ImageOutput::create(
filepath_));
33 if (image_output ==
nullptr) {
34 log_(
"Failed to create image file");
38 const int width =
tile.size.
x;
39 const int height =
tile.size.
y;
41 ImageSpec spec(width, height, 4, TypeDesc::FLOAT);
42 if (!image_output->open(
filepath_, spec)) {
43 log_(
"Failed to create image file");
48 if (!
tile.get_pass_pixels(
pass_, 4, pixels.data())) {
49 log_(
"Failed to read render pass pixels");
54 ImageBuf image_buffer(spec,
55 pixels.data() + (height - 1) * width * 4,
57 -width * 4 *
sizeof(
float),
65 const float g = 1.0f / 2.2f;
66 ImageBufAlgo::pow(image_buffer, image_buffer, {g, g, g, 1.0f});
70 image_buffer.set_write_format(TypeDesc::FLOAT);
71 image_buffer.write(image_output.get());
72 image_output->close();