Cleanup: refactor passing of color management settings for image save

Make a copy of ImageFormatData that contains the effective color management
settings, and pass that along to the various functions. This will make it
possible to add more complex logic later.

For compositing nodes, passing along view and display settings through
many functions made it harder to add additional settings, so just get those
from the scene now.

Differential Revision: https://developer.blender.org/D14401
This commit is contained in:
2022-03-11 18:21:05 +01:00
parent 2ebcb7fab3
commit 3b5224b57c
26 changed files with 184 additions and 303 deletions

View File

@@ -24,6 +24,7 @@ void SplitViewerNode::convert_to_operations(NodeConverter &converter,
NodeInput *image2Socket = this->get_input_socket(1);
Image *image = (Image *)this->get_bnode()->id;
ImageUser *image_user = (ImageUser *)this->get_bnode()->storage;
Scene *scene = context.get_scene();
SplitOperation *split_viewer_operation = new SplitOperation();
split_viewer_operation->set_split_percentage(this->get_bnode()->custom1);
@@ -36,8 +37,8 @@ void SplitViewerNode::convert_to_operations(NodeConverter &converter,
ViewerOperation *viewer_operation = new ViewerOperation();
viewer_operation->set_image(image);
viewer_operation->set_image_user(image_user);
viewer_operation->set_view_settings(context.get_view_settings());
viewer_operation->set_display_settings(context.get_display_settings());
viewer_operation->set_view_settings(&scene->view_settings);
viewer_operation->set_display_settings(&scene->display_settings);
viewer_operation->set_render_data(context.get_render_data());
viewer_operation->set_view_name(context.get_view_name());