diff options
author | Aaron Plattner <aplattner@nvidia.com> | 2020-02-19 14:51:50 -0800 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2020-03-23 19:52:27 +0000 |
commit | 6d64e4cc8b6846bed6a242ff90403c0310208fdc (patch) | |
tree | eec497099843528e733c5ae356a33195498e6116 | |
parent | 78365e9b5ecf6352ed95f46d8dde0313e10c5796 (diff) | |
download | colord-6d64e4cc8b6846bed6a242ff90403c0310208fdc.tar.gz |
libcolord: Add cd_icc_create_default_full
The existing cd_icc_create_default creates a CdIcc with none of the load flags
set. A future change to gnome-settings-daemon is going to want to load an sRGB
profile with CD_ICC_LOAD_FLAGS_PRIMARIES in order to use it to construct a color
transformation matrix to plug into the window system.
-rw-r--r-- | lib/colord/cd-icc.c | 30 | ||||
-rw-r--r-- | lib/colord/cd-icc.h | 4 |
2 files changed, 29 insertions, 5 deletions
diff --git a/lib/colord/cd-icc.c b/lib/colord/cd-icc.c index 7dddc6a..73e116e 100644 --- a/lib/colord/cd-icc.c +++ b/lib/colord/cd-icc.c @@ -3041,18 +3041,21 @@ cd_icc_get_white (CdIcc *icc) } /** - * cd_icc_create_default: + * cd_icc_create_default_full: * @icc: A valid #CdIcc - * @error: A #GError, or %NULL + * @flags: a set of #CdIccLoadFlags + * @error: (out): A #GError, or %NULL * * Creates a default sRGB ICC profile. * * Return value: %TRUE for success * - * Since: 1.1.2 + * Since: 1.4.5 **/ gboolean -cd_icc_create_default (CdIcc *icc, GError **error) +cd_icc_create_default_full (CdIcc *icc, + CdIccLoadFlags flags, + GError **error) { CdIccPrivate *priv = GET_PRIVATE (icc); gboolean ret = TRUE; @@ -3079,7 +3082,7 @@ cd_icc_create_default (CdIcc *icc, GError **error) } /* get defaults from profile */ - ret = cd_icc_load (icc, 0, error); + ret = cd_icc_load (icc, flags, error); if (!ret) goto out; @@ -3095,6 +3098,23 @@ out: } /** + * cd_icc_create_default: + * @icc: A valid #CdIcc + * @error: (out): A #GError, or %NULL + * + * Creates a default sRGB ICC profile. + * + * Return value: %TRUE for success + * + * Since: 1.1.2 + **/ +gboolean +cd_icc_create_default (CdIcc *icc, GError **error) +{ + return cd_icc_create_default_full (icc, CD_ICC_LOAD_FLAGS_NONE, error); +} + +/** * cd_icc_create_from_edid_data: * @icc: A valid #CdIcc * @edid: EDID data diff --git a/lib/colord/cd-icc.h b/lib/colord/cd-icc.h index 31699eb..f1d6dd7 100644 --- a/lib/colord/cd-icc.h +++ b/lib/colord/cd-icc.h @@ -255,6 +255,10 @@ gboolean cd_icc_create_from_edid_data (CdIcc *icc, gboolean cd_icc_create_default (CdIcc *icc, GError **error) G_GNUC_WARN_UNUSED_RESULT; +gboolean cd_icc_create_default_full (CdIcc *icc, + CdIccLoadFlags flags, + GError **error) + G_GNUC_WARN_UNUSED_RESULT; GPtrArray *cd_icc_get_vcgt (CdIcc *icc, guint size, GError **error) |