[Rawstudio-commit] r2971 - branches/rawstudio-ng-color/src

Klaus Post klauspost at gmail.com
Mon Jan 4 20:57:15 CET 2010


Author: post
Date: 2010-01-04 20:57:15 +0100 (Mon, 04 Jan 2010)
New Revision: 2971

Modified:
   branches/rawstudio-ng-color/src/rs-loupe.c
   branches/rawstudio-ng-color/src/rs-loupe.h
   branches/rawstudio-ng-color/src/rs-preview-widget.c
Log:
Support DCP profiles in loupe view.

Modified: branches/rawstudio-ng-color/src/rs-loupe.c
===================================================================
--- branches/rawstudio-ng-color/src/rs-loupe.c	2010-01-04 18:51:17 UTC (rev 2970)
+++ branches/rawstudio-ng-color/src/rs-loupe.c	2010-01-04 19:57:15 UTC (rev 2971)
@@ -120,6 +120,18 @@
 	redraw(loupe);
 }
 
+/**
+ * Set display colorspace
+ * @param loupe A RSLoupe
+ * @param colorspace An RSColorSpace that should be used to display the content of the loupe
+ */
+void
+rs_loupe_set_colorspace(RSLoupe *loupe, RSColorSpace *display_color_space)
+{
+	g_assert(RS_IS_LOUPE(loupe));
+	loupe->display_color_space = display_color_space;
+}
+
 static gboolean
 expose(GtkWidget *widget, GdkEventExpose *event, RSLoupe *loupe)
 {
@@ -214,6 +226,7 @@
 	roi.width = window_width;
 	roi.height = window_height;
 	rs_filter_request_set_roi(request, &roi);
+	rs_filter_param_set_object(RS_FILTER_PARAM(request), "colorspace", loupe->display_color_space);
 
 	RSFilterResponse *response = rs_filter_get_image8(loupe->filter, request);
 	GdkPixbuf *buffer = rs_filter_response_get_image8(response);

Modified: branches/rawstudio-ng-color/src/rs-loupe.h
===================================================================
--- branches/rawstudio-ng-color/src/rs-loupe.h	2010-01-04 18:51:17 UTC (rev 2970)
+++ branches/rawstudio-ng-color/src/rs-loupe.h	2010-01-04 19:57:15 UTC (rev 2971)
@@ -39,6 +39,7 @@
 	gint center_y;
 	gboolean left;
 	gboolean atop;
+	RSColorSpace *display_color_space;
 } RSLoupe;
 
 typedef struct {
@@ -68,6 +69,13 @@
  */
 void rs_loupe_set_coord(RSLoupe *loupe, gint center_x, gint center_y);
 
+/**
+ * Set display colorspace
+ * @param loupe A RSLoupe
+ * @param display_color_space An RSColorSpace that should be used to display the content of the loupe
+ */
+void rs_loupe_set_colorspace(RSLoupe *loupe, RSColorSpace *display_color_space);
+
 G_END_DECLS
 
 #endif /* RS_LOUPE_H */

Modified: branches/rawstudio-ng-color/src/rs-preview-widget.c
===================================================================
--- branches/rawstudio-ng-color/src/rs-preview-widget.c	2010-01-04 18:51:17 UTC (rev 2970)
+++ branches/rawstudio-ng-color/src/rs-preview-widget.c	2010-01-04 19:57:15 UTC (rev 2971)
@@ -171,8 +171,10 @@
 	gboolean loupe_enabled;
 	RSLoupe *loupe;
 	RSFilter *loupe_filter_cache;
+	RSFilter *loupe_transform_input;
+	RSFilter *loupe_filter_dcp;
 	RSFilter *loupe_filter_denoise;
-	RSFilter *loupe_filter_render;
+	RSFilter *loupe_transform_display;
 	RSFilter *loupe_filter_end;
 
 	RSFilter *navigator_filter_scale;
@@ -367,9 +369,11 @@
 	rs_filter_set_label(preview->filter_resample[1], "RSPreviewWidget-1");
 
 	preview->loupe_filter_cache = rs_filter_new("RSCache", NULL);
-	preview->loupe_filter_denoise = rs_filter_new("RSDenoise", preview->loupe_filter_cache);
-	preview->loupe_filter_render = rs_filter_new("RSBasicRender", preview->loupe_filter_denoise);
-	preview->loupe_filter_end = preview->loupe_filter_render;
+	preview->loupe_transform_input = rs_filter_new("RSColorspaceTransform", preview->loupe_filter_cache);
+	preview->loupe_filter_dcp = rs_filter_new("RSDcp", preview->loupe_transform_input);
+	preview->loupe_filter_denoise = rs_filter_new("RSDenoise", preview->loupe_filter_dcp);
+	preview->loupe_transform_display = rs_filter_new("RSColorspaceTransform", preview->loupe_filter_denoise);
+	preview->loupe_filter_end = preview->loupe_transform_display;
 	preview->loupe = rs_loupe_new();
 	g_object_set(preview->loupe_filter_cache, "ignore-roi", TRUE, NULL);
 	preview->photo = NULL;
@@ -544,7 +548,9 @@
 
 			rs_filter_set_previous(preview->loupe_filter_cache, preview->filter_input);
 			/* FIXME: view is hardcoded to 0 */
+			g_object_set(preview->loupe_filter_dcp, "profile", rs_photo_get_dcp_profile(preview->photo), NULL);
 			rs_filter_set_recursive(preview->loupe_filter_end, "settings", preview->photo->settings[preview->snapshot[0]], NULL);
+			rs_loupe_set_colorspace(preview->loupe, preview->display_color_space);
 
 			gtk_widget_show_all(GTK_WIDGET(preview->loupe));
 		}




More information about the Rawstudio-commit mailing list