aboutsummaryrefslogtreecommitdiffstats
path: root/libgamma_name_of_subpixel_order.c
blob: c3612bfe847a86ee11f2ed6ab69cc763ce9589f1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* 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;
	}
}