[gegl] gegl: gegl-chain add serialization of babl formats
- From: Øyvind Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] gegl: gegl-chain add serialization of babl formats
- Date: Thu, 13 Apr 2017 17:08:01 +0000 (UTC)
commit 70395e5e725fd73ca4679076eb3a9f38d17e223b
Author: Øyvind Kolås <pippin gimp org>
Date: Thu Apr 13 18:57:34 2017 +0200
gegl: gegl-chain add serialization of babl formats
gegl/gegl-serialize.c | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/gegl/gegl-serialize.c b/gegl/gegl-serialize.c
index d8a0378..414eee5 100644
--- a/gegl/gegl-serialize.c
+++ b/gegl/gegl-serialize.c
@@ -19,6 +19,7 @@
#include "gegl.h"
#include <string.h>
#include <stdio.h>
+#include "property-types/gegl-paramspecs.h"
//#define make_rel(strv) (g_strtod (strv, NULL) * gegl_node_get_bounding_box
// (iter[0]).height)
@@ -801,11 +802,30 @@ gegl_serialize2 (GeglNode *start, GeglNode *end, const char *basepath,
gegl_node_get (iter, properties[i]->name, &path, NULL);
svg_path = gegl_path_to_string (path);
g_object_unref (path);
+ if (flags & GEGL_SERIALIZE_INDENT)
+ g_string_append_printf (s2, " ");
g_string_append_printf (s2, " %s='%s'", property_name,
svg_path);
printed = TRUE;
g_free (svg_path);
}
+ else if (property_type == G_TYPE_POINTER &&
+ GEGL_IS_PARAM_SPEC_FORMAT (properties[i]))
+ {
+ const Babl *format;
+ const gchar *value = "";
+ gegl_node_get (iter, properties[i]->name, &format, NULL);
+ if (format)
+ value = babl_get_name (format);
+ if (value[0] || (!trim_defaults))
+ {
+ if (flags & GEGL_SERIALIZE_INDENT)
+ g_string_append_printf (s2, " ");
+ g_string_append_printf (s2, " %s='%s'", property_name,
+ value);
+ printed = TRUE;
+ }
+ }
else
{
g_warning (
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]