}
// Go through each input that is not sRGB, and insert
- // a colorspace conversion before it.
+ // a colorspace conversion after it.
for (unsigned j = 0; j < node->incoming_links.size(); ++j) {
Node *input = node->incoming_links[j];
assert(input->output_color_space != COLORSPACE_INVALID);
CHECK(conversion->effect->set_int("source_space", input->output_color_space));
CHECK(conversion->effect->set_int("destination_space", COLORSPACE_sRGB));
conversion->output_color_space = COLORSPACE_sRGB;
- insert_node_between(input, conversion, node);
+ replace_sender(input, conversion);
+ connect_nodes(input, conversion);
}
// Re-sort topologically, and propagate the new information.
conversion = add_node(new AlphaDivisionEffect());
}
conversion->output_alpha_type = desired_type;
- insert_node_between(input, conversion, node);
+ replace_sender(input, conversion);
+ connect_nodes(input, conversion);
}
// Re-sort topologically, and propagate the new information.
}
// If not, go through each input that is not linear gamma,
- // and insert a gamma conversion before it.
+ // and insert a gamma conversion after it.
for (unsigned j = 0; j < node->incoming_links.size(); ++j) {
Node *input = node->incoming_links[j];
assert(input->output_gamma_curve != GAMMA_INVALID);
Node *conversion = add_node(new GammaExpansionEffect());
CHECK(conversion->effect->set_int("source_curve", input->output_gamma_curve));
conversion->output_gamma_curve = GAMMA_LINEAR;
- insert_node_between(input, conversion, node);
+ replace_sender(input, conversion);
+ connect_nodes(input, conversion);
}
// Re-sort topologically, and propagate the new information.