delete engine;
}
-const char* InterpolatePixelsMain::plugin_title() { return _("Interpolate Pixels"); }
+const char* InterpolatePixelsMain::plugin_title() { return N_("Interpolate Bayer"); }
int InterpolatePixelsMain::is_realtime() { return 1; }
delete out_temp; out_temp = 0;
}
if( !out_temp )
- out_temp = new VFrame(0, -1, w, h, active_model, -1);
+ out_temp = new VFrame(w, h, active_model, 0);
out_frame = out_temp;
}
get_output()->to_texture();
get_output()->enable_opengl();
- const char *shader_stack[] = { 0, 0, 0 };
- int current_shader = 0;
- INTERPOLATE_COMPILE(shader_stack, current_shader)
- unsigned int frag = VFrame::make_shader(0,
- shader_stack[0],
- 0);
- if(frag > 0)
- {
- glUseProgram(frag);
- glUniform1i(glGetUniformLocation(frag, "tex"), 0);
- INTERPOLATE_UNIFORMS(frag)
- }
+ const char *shader_stack[16];
+ memset(shader_stack,0, sizeof(shader_stack));
+ int current_shader = 0;
+
+ INTERPOLATE_COMPILE(shader_stack, current_shader);
+ shader_stack[current_shader] = 0;
+ unsigned int shader = VFrame::make_shader(shader_stack);
+ if( shader > 0 ) {
+ glUseProgram(shader);
+ glUniform1i(glGetUniformLocation(shader, "tex"), 0);
+ INTERPOLATE_UNIFORMS(shader);
+ }
get_output()->init_screen();
get_output()->bind_texture(0);
float color_matrix[9];
memcpy(color_matrix, server->color_matrix, sizeof(color_matrix));
+// printf("InterpolatePixelsUnit::process_package %d color_matrix=", __LINE__);
+// for(int i = 0; i < 9; i++)
+// {
+// printf("%f ", color_matrix[i]);
+// }
+// printf("\n");
+
y1 = MAX(y1, 1);
y2 = MIN(y2, h - 1);
b = current_row[BLUE];
}
- out_row[0] = r * color_matrix[0] + g * color_matrix[1] + b * color_matrix[2];
- out_row[1] = r * color_matrix[3] + g * color_matrix[4] + b * color_matrix[5];
- out_row[2] = r * color_matrix[6] + g * color_matrix[7] + b * color_matrix[8];
+// out_row[0] = r * color_matrix[0] + g * color_matrix[1] + b * color_matrix[2];
+// out_row[1] = r * color_matrix[3] + g * color_matrix[4] + b * color_matrix[5];
+// out_row[2] = r * color_matrix[6] + g * color_matrix[7] + b * color_matrix[8];
+
+ out_row[0] = r;
+ out_row[1] = g;
+ out_row[2] = b;
+
prev_row += components;
current_row += components;
next_row += components;
b = (prev_row[BLUE] + next_row[BLUE]) / 2;
}
- out_row[0] = r * color_matrix[0] + g * color_matrix[1] + b * color_matrix[2];
- out_row[1] = r * color_matrix[3] + g * color_matrix[4] + b * color_matrix[5];
- out_row[2] = r * color_matrix[6] + g * color_matrix[7] + b * color_matrix[8];
+// out_row[0] = r * color_matrix[0] + g * color_matrix[1] + b * color_matrix[2];
+// out_row[1] = r * color_matrix[3] + g * color_matrix[4] + b * color_matrix[5];
+// out_row[2] = r * color_matrix[6] + g * color_matrix[7] + b * color_matrix[8];
+
+ out_row[0] = r;
+ out_row[1] = g;
+ out_row[2] = b;
+
prev_row += components;
current_row += components;
next_row += components;
char string[BCTEXTLEN];
string[0] = 0;
plugin->get_output()->get_params()->get("DCRAW_MATRIX", string);
+
+// printf("InterpolatePixelsEngine::init_packages %d\n", __LINE__);
+// plugin->get_output()->dump_params();
+
sscanf(string,
"%f %f %f %f %f %f %f %f %f",
&color_matrix[0],