diff options
Diffstat (limited to 'src/common.h')
| -rw-r--r-- | src/common.h | 73 | 
1 files changed, 71 insertions, 2 deletions
| diff --git a/src/common.h b/src/common.h index 0b89b8f..22253e7 100644 --- a/src/common.h +++ b/src/common.h @@ -35,6 +35,7 @@  #include <errno.h>  #include <fcntl.h>  #include <inttypes.h> +#include <limits.h>  #include <locale.h>  #include <math.h>  #include <signal.h> @@ -117,16 +118,84 @@  /** + * Minimum valid latitude + */ +#define MIN_LATITUDE -90.0 + +/** + * Maximum valid latitude + */ +#define MAX_LATITUDE 90.0 + +/** + * Minimum valid longitude + */ +#define MIN_LONGITUDE -180.0 + +/** + * Maximum valid longitude + */ +#define MAX_LONGITUDE 180.0 + +/** + * Minimum allowed colour temperature + */ +#define MIN_TEMPERATURE ((unsigned long int)LIBRED_LOWEST_TEMPERATURE) + +/** + * Maximum allowed colour temperature + */ +#define MAX_TEMPERATURE ULONG_MAX + +/** + * Minimum allowed whitepoint brightness + */ +#define MIN_BRIGHTNESS 0.1 + +/** + * Maximum allowed whitepoint brightness + */ +#define MAX_BRIGHTNESS 1.0 + +/** + * Minimum allowed gamma + */ +#define MIN_GAMMA 0.1 + +/** + * Maximum allowed gamma + */ +#define MAX_GAMMA 10.0 + + +/**   * The colour temperature corresponding to no effect   */ -#define NEUTRAL_TEMP  6500U +#define NEUTRAL_TEMPERATURE  6500UL + +/** + * The whitepoint brightness corresponding to + * full brightness (no effect) + */ +#define NEUTRAL_BRIGHTNESS  1.0 + +/** + * The gamma corresponding to no effect (linear output level curve) + */ +#define NEUTRAL_GAMMA  1.0 +  /**   * Initialiser for `struct color_setting`   *    * Sets all values to their neutral values (no effects applied)   */ -#define COLOR_SETTING_NEUTRAL  ((struct color_setting){NEUTRAL_TEMP, 1.0, {1.0, 1.0, 1.0}}) +#define COLOR_SETTING_NEUTRAL\ +	((struct color_setting){\ +		NEUTRAL_TEMPERATURE,\ +		NEUTRAL_BRIGHTNESS,\ +		{NEUTRAL_GAMMA, NEUTRAL_GAMMA, NEUTRAL_GAMMA}\ +	})  /** | 
