-extern char dcraw_info[1024];
-extern float **dcraw_data;
-extern int dcraw_alpha;
-extern float dcraw_matrix[9];
-int dcraw_main (int argc, const char **argv);
+ DCRaw dcraw;
+ if( frame ) {
+ dcraw.data = (float**) frame->get_rows();
+ dcraw.alpha = frame->get_color_model() == BC_RGBA_FLOAT ? 1 : 0;
+ }
+ int result = dcraw.main(argc, argv);
+ if( file )
+ file->format_to_asset(dcraw.info);
+ if( frame ) {
+// This was only used by the bayer interpolate plugin, which itself created
+// too much complexity to use effectively.
+// It required bypassing the cache any time a plugin parameter changed
+// to store the color matrix from dcraw in the frame stack along with the new
+// plugin parameters. The cache couldn't know if a parameter in the stack came
+// from dcraw or a plugin & replace it.
+ char string[BCTEXTLEN];
+ sprintf(string, "%f %f %f %f %f %f %f %f %f\n",
+ dcraw.matrix[0], dcraw.matrix[1], dcraw.matrix[2],
+ dcraw.matrix[3], dcraw.matrix[4], dcraw.matrix[5],
+ dcraw.matrix[6], dcraw.matrix[7], dcraw.matrix[8]);
+ frame->get_params()->update("DCRAW_MATRIX", string);
+// frame->dump_params();
+ }
+ return result;