aboutsummaryrefslogtreecommitdiffstats
path: root/libgamma_name_of_subpixel_order.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-03-05 00:43:38 +0100
committerMattias Andrée <maandree@kth.se>2021-03-05 00:43:38 +0100
commit0ce0d8d6e0c420ccafa79e0203b928c3559a4311 (patch)
tree88e8228a93691c28811a49898abf86a96dd9d613 /libgamma_name_of_subpixel_order.c
parentChange license + change style + misc (diff)
downloadlibgamma-0ce0d8d6e0c420ccafa79e0203b928c3559a4311.tar.gz
libgamma-0ce0d8d6e0c420ccafa79e0203b928c3559a4311.tar.bz2
libgamma-0ce0d8d6e0c420ccafa79e0203b928c3559a4311.tar.xz
Split source files, merge public header files, eliminite use gpp, rewrite makefile
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'libgamma_name_of_subpixel_order.c')
-rw-r--r--libgamma_name_of_subpixel_order.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/libgamma_name_of_subpixel_order.c b/libgamma_name_of_subpixel_order.c
new file mode 100644
index 0000000..f8c0bf8
--- /dev/null
+++ b/libgamma_name_of_subpixel_order.c
@@ -0,0 +1,27 @@
+/* See LICENSE file for copyright and license details. */
+#include "common.h"
+
+
+/**
+ * Get the name of a subpixel order, for example
+ * "Horizontal RGB" for `LIBGAMMA_SUBPIXEL_ORDER_HORIZONTAL_RGB`
+ *
+ * "Unknown" is returned for `LIBGAMMA_SUBPIXEL_ORDER_UNKNOWN`,
+ * "None" is returned for `LIBGAMMA_SUBPIXEL_ORDER_NONE`
+ *
+ * @param order The subpixel order
+ * @return The name subpixel order, `NULL` if not
+ * recognised (errno is not changed)
+ */
+const char *
+libgamma_name_of_subpixel_order(int order)
+{
+ switch (order) {
+#define X(CONST, NAME)\
+ case CONST: return NAME;
+ LIST_SUBPIXEL_ORDERS(X)
+#undef X
+ default:
+ return NULL;
+ }
+}