colrcv  v0.5.0
C Library for converting Colours between different Colour Models
colrcv.h
Go to the documentation of this file.
1 /*
2  * This source file forms part of colrcv
3  * colrcv is a C Library for converting Colours between different Colour Models.
4  */
5 
23 #ifndef SAXBOPHONE_COLRCV_COLRCV_H
24 #define SAXBOPHONE_COLRCV_COLRCV_H
25 
26 #include <stdbool.h>
27 #include <stdint.h>
28 
29 
30 #ifdef __cplusplus
31 extern "C"{
32 #endif
33 
39 typedef struct colrcv_version_t {
41  uint16_t major;
43  uint16_t minor;
45  uint16_t patch;
47  const char* string;
49 
54 extern const colrcv_version_t COLRCV_VERSION;
55 
63 bool colrcv_range_valid(double min, double val, double max);
64 
70 double colrcv_min(double a, double b);
71 
77 double colrcv_max(double a, double b);
78 
88 double colrcv_clamp(double value, double min, double max);
89 
90 #ifdef __cplusplus
91 } // extern "C"
92 #endif
93 
94 // end of header file
95 #endif
double colrcv_max(double a, double b)
Get the largest of two given values.
Definition: colrcv.c:36
uint16_t minor
The minor version number of the version.
Definition: colrcv.h:43
const colrcv_version_t COLRCV_VERSION
Stores the current version of colrcv.
Definition: colrcv.c:21
Used to represent a version of colrcv.
Definition: colrcv.h:39
bool colrcv_range_valid(double min, double val, double max)
A utility function for checking that a given value is in a given range.
Definition: colrcv.c:28
uint16_t major
The major version number of the version.
Definition: colrcv.h:41
double colrcv_clamp(double value, double min, double max)
Clamp a given value to be within a given range.
Definition: colrcv.c:40
struct colrcv_version_t colrcv_version_t
Used to represent a version of colrcv.
double colrcv_min(double a, double b)
Get the smallest of two given values.
Definition: colrcv.c:32
uint16_t patch
The patch version number of the version.
Definition: colrcv.h:45
const char * string
String form of the version (vX.Y.Z)
Definition: colrcv.h:47