-
- if(get_output()->get_color_model() != BC_RGB_FLOAT &&
- get_output()->get_color_model() != BC_RGBA_FLOAT)
- {
- printf("InterpolatePixelsMain::process_buffer: only supports float colormodels\n");
- return 1;
+ int color_model = frame->get_color_model();
+ int active_model = BC_CModels::has_alpha(color_model) ?
+ BC_RGBA_FLOAT : BC_RGB_FLOAT;
+ new_temp(frame->get_w(), frame->get_h(), active_model);
+ get_temp()->transfer_from(frame);
+
+ out_frame = get_output();
+ color_model = out_frame->get_color_model();
+ active_model = BC_CModels::has_alpha(color_model) ?
+ BC_RGBA_FLOAT : BC_RGB_FLOAT;
+ if( active_model != color_model ) {
+ int w = out_frame->get_w(), h = out_frame->get_h();
+ if( out_temp && ( out_temp->get_color_model() != active_model ||
+ out_temp->get_w() != w || out_temp->get_w() != h ) ) {
+ delete out_temp; out_temp = 0;
+ }
+ if( !out_temp )
+ out_temp = new VFrame(0, -1, w, h, active_model, -1);
+ out_frame = out_temp;