1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
3
* Copyright (C) 2009-2010 Richard Hughes <richard@hughsie.com>
5
* Licensed under the GNU General Public License Version 2
7
* This program is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 2 of the License, or
10
* (at your option) any later version.
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24
#include <glib/gi18n.h>
29
* gcm_intent_to_string:
32
gcm_intent_to_string (GcmIntent intent)
34
if (intent == GCM_INTENT_PERCEPTUAL)
36
if (intent == GCM_INTENT_RELATIVE_COLORMETRIC)
37
return "relative-colormetric";
38
if (intent == GCM_INTENT_SATURATION)
40
if (intent == GCM_INTENT_ABSOLUTE_COLORMETRIC)
41
return "absolute-colormetric";
46
* gcm_intent_from_string:
49
gcm_intent_from_string (const gchar *intent)
51
if (g_strcmp0 (intent, "perceptual") == 0)
52
return GCM_INTENT_PERCEPTUAL;
53
if (g_strcmp0 (intent, "relative-colormetric") == 0)
54
return GCM_INTENT_RELATIVE_COLORMETRIC;
55
if (g_strcmp0 (intent, "saturation") == 0)
56
return GCM_INTENT_SATURATION;
57
if (g_strcmp0 (intent, "absolute-colormetric") == 0)
58
return GCM_INTENT_ABSOLUTE_COLORMETRIC;
59
return GCM_INTENT_UNKNOWN;
63
* gcm_profile_kind_to_string:
66
gcm_profile_kind_to_string (GcmProfileKind kind)
68
if (kind == GCM_PROFILE_KIND_INPUT_DEVICE)
69
return "input-device";
70
if (kind == GCM_PROFILE_KIND_DISPLAY_DEVICE)
71
return "display-device";
72
if (kind == GCM_PROFILE_KIND_OUTPUT_DEVICE)
73
return "output-device";
74
if (kind == GCM_PROFILE_KIND_DEVICELINK)
76
if (kind == GCM_PROFILE_KIND_COLORSPACE_CONVERSION)
77
return "colorspace-conversion";
78
if (kind == GCM_PROFILE_KIND_ABSTRACT)
80
if (kind == GCM_PROFILE_KIND_NAMED_COLOR)
86
* gcm_colorspace_to_string:
89
gcm_colorspace_to_string (GcmColorspace colorspace)
91
if (colorspace == GCM_COLORSPACE_XYZ)
93
if (colorspace == GCM_COLORSPACE_LAB)
95
if (colorspace == GCM_COLORSPACE_LUV)
97
if (colorspace == GCM_COLORSPACE_YCBCR)
99
if (colorspace == GCM_COLORSPACE_YXY)
101
if (colorspace == GCM_COLORSPACE_RGB)
103
if (colorspace == GCM_COLORSPACE_GRAY)
105
if (colorspace == GCM_COLORSPACE_HSV)
107
if (colorspace == GCM_COLORSPACE_CMYK)
109
if (colorspace == GCM_COLORSPACE_CMY)
115
* gcm_colorspace_from_string:
118
gcm_colorspace_from_string (const gchar *colorspace)
120
if (g_strcmp0 (colorspace, "xyz") == 0)
121
return GCM_COLORSPACE_XYZ;
122
if (g_strcmp0 (colorspace, "lab") == 0)
123
return GCM_COLORSPACE_LAB;
124
if (g_strcmp0 (colorspace, "luv") == 0)
125
return GCM_COLORSPACE_LUV;
126
if (g_strcmp0 (colorspace, "ycbcr") == 0)
127
return GCM_COLORSPACE_YCBCR;
128
if (g_strcmp0 (colorspace, "yxy") == 0)
129
return GCM_COLORSPACE_YXY;
130
if (g_strcmp0 (colorspace, "rgb") == 0)
131
return GCM_COLORSPACE_RGB;
132
if (g_strcmp0 (colorspace, "gray") == 0)
133
return GCM_COLORSPACE_GRAY;
134
if (g_strcmp0 (colorspace, "hsv") == 0)
135
return GCM_COLORSPACE_HSV;
136
if (g_strcmp0 (colorspace, "cmyk") == 0)
137
return GCM_COLORSPACE_CMYK;
138
if (g_strcmp0 (colorspace, "cmy") == 0)
139
return GCM_COLORSPACE_CMY;
140
return GCM_COLORSPACE_UNKNOWN;