Author: post
Date: 2009-07-11 21:32:41 +0200 (Sat, 11 Jul 2009)
New Revision: 2584
Modified:
trunk/librawstudio/rs-filter-response.c
trunk/librawstudio/rs-filter-response.h
Log:
Added ability to ask a response if an image is attached without affecting
refcount.
Modified: trunk/librawstudio/rs-filter-response.c
===================================================================
--- trunk/librawstudio/rs-filter-response.c 2009-07-11 18:00:36 UTC (rev
2583)
+++ trunk/librawstudio/rs-filter-response.c 2009-07-11 19:32:41 UTC (rev
2584)
@@ -73,6 +73,7 @@
filter_response->quick = FALSE;
filter_response->image = NULL;
filter_response->image8 = NULL;
+ filter_response->dispose_has_run = FALSE;
}
/**
@@ -194,6 +195,18 @@
}
/**
+ * Is there a 16 bit image attached
+ * @param filter_response A RSFilterResponse
+ * @return A RS_IMAGE16 (must be unreffed after usage) or NULL if none is set
+ */
+ gboolean rs_filter_response_has_image(const RSFilterResponse *filter_response)
+{
+ g_assert(RS_IS_FILTER_RESPONSE(filter_response));
+
+ return !!filter_response->image;
+}
+
+/**
* Get 16 bit image data
* @param filter_response A RSFilterResponse
* @return A RS_IMAGE16 (must be unreffed after usage) or NULL if none is set
@@ -232,6 +245,18 @@
}
/**
+ * Does the response have an 8 bit image
+ * @param filter_response A RSFilterResponse
+ * @return A gboolean TRUE if an image8 is attached, FALSE otherwise
+ */
+gboolean rs_filter_response_has_image8(const RSFilterResponse
*filter_response)
+{
+ g_assert(RS_IS_FILTER_RESPONSE(filter_response));
+
+ return !!filter_response->image8;
+}
+
+/**
* Get 8 bit image data
* @param filter_response A RSFilterResponse
* @return A GdkPixbuf (must be unreffed after usage) or NULL if none is set
@@ -248,3 +273,4 @@
return ret;
}
+
Modified: trunk/librawstudio/rs-filter-response.h
===================================================================
--- trunk/librawstudio/rs-filter-response.h 2009-07-11 18:00:36 UTC (rev
2583)
+++ trunk/librawstudio/rs-filter-response.h 2009-07-11 19:32:41 UTC (rev
2584)
@@ -95,10 +95,17 @@
void rs_filter_response_set_image(RSFilterResponse *filter_response,
RS_IMAGE16 *image);
/**
- * Get 16 bit image data
+ * Is there a 16 bit image attached
* @param filter_response A RSFilterResponse
* @return A RS_IMAGE16 (must be unreffed after usage) or NULL if none is set
*/
+ gboolean rs_filter_response_has_image(const RSFilterResponse
*filter_response);
+
+/**
+ * Get 16 bit image data
+ * @param filter_response A RSFilterResponse
+ * @return A gboolean TRUE if an image is attached, FALSE otherwise
+ */
RS_IMAGE16 *rs_filter_response_get_image(const RSFilterResponse
*filter_response);
/**
@@ -109,12 +116,20 @@
void rs_filter_response_set_image8(RSFilterResponse *filter_response,
GdkPixbuf *pixbuf);
/**
+ * Does the response have an 8 bit image
+ * @param filter_response A RSFilterResponse
+ * @return A gboolean TRUE if an image8 is attached, FALSE otherwise
+ */
+gboolean rs_filter_response_has_image8(const RSFilterResponse
*filter_response);
+
+/**
* Get 8 bit image data
* @param filter_response A RSFilterResponse
* @return A GdkPixbuf (must be unreffed after usage) or NULL if none is set
*/
GdkPixbuf *rs_filter_response_get_image8(const RSFilterResponse
*filter_response);
+
G_END_DECLS
#endif /* RS_FILTER_RESPONSE_H */
_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit