From 4c446cb45c93e940d350a487cf34e41996b598fc Mon Sep 17 00:00:00 2001 From: zhouhang95 <765229842@qq.com> Date: Mon, 24 Jun 2024 19:39:07 +0800 Subject: [PATCH] improve --- zenovis/xinxinoptix/ChiefDesignerEXR.h | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/zenovis/xinxinoptix/ChiefDesignerEXR.h b/zenovis/xinxinoptix/ChiefDesignerEXR.h index e72966418f..31e270a318 100644 --- a/zenovis/xinxinoptix/ChiefDesignerEXR.h +++ b/zenovis/xinxinoptix/ChiefDesignerEXR.h @@ -187,19 +187,10 @@ inline void SaveMultiLayerEXR_half( OutputFile file (exrFilePath, header); FrameBuffer frameBuffer; - std::vector> data; - for (half *rgb: pixels) { - std::vector half_rgb(width * height * 3); - for (auto i = 0; i < half_rgb.size(); i++) { - half_rgb[i] = rgb[i]; - } - data.push_back(std::move(half_rgb)); - } - for (auto i = 0; i < channels.size(); i++) { - frameBuffer.insert (zeno::format("{}R", channels[i]), Slice ( HALF, (char*) &data[i][0], sizeof (half) * 3, sizeof (half) * width * 3)); - frameBuffer.insert (zeno::format("{}G", channels[i]), Slice ( HALF, (char*) &data[i][1], sizeof (half) * 3, sizeof (half) * width * 3)); - frameBuffer.insert (zeno::format("{}B", channels[i]), Slice ( HALF, (char*) &data[i][2], sizeof (half) * 3, sizeof (half) * width * 3)); + frameBuffer.insert (zeno::format("{}R", channels[i]), Slice ( HALF, (char*) &pixels[i][0], sizeof (half) * 3, sizeof (half) * width * 3)); + frameBuffer.insert (zeno::format("{}G", channels[i]), Slice ( HALF, (char*) &pixels[i][1], sizeof (half) * 3, sizeof (half) * width * 3)); + frameBuffer.insert (zeno::format("{}B", channels[i]), Slice ( HALF, (char*) &pixels[i][2], sizeof (half) * 3, sizeof (half) * width * 3)); } file.setFrameBuffer (frameBuffer);