colrcv  v0.5.0
C Library for converting Colours between different Colour Models
lab.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 
24 #ifndef SAXBOPHONE_COLRCV_MODELS_LAB_H
25 #define SAXBOPHONE_COLRCV_MODELS_LAB_H
26 
27 #include <stdbool.h>
28 
29 #include "types.h"
30 
31 
32 #ifdef __cplusplus
33 extern "C"{
34 #endif
35 
41 struct colrcv_lab_t {
43  double l;
45  double a;
47  double b;
48 };
49 
54 extern const double COLRCV_LAB_L_MIN_VALUE;
55 
60 extern const double COLRCV_LAB_A_MIN_VALUE;
61 
66 extern const double COLRCV_LAB_B_MIN_VALUE;
67 
72 extern const double COLRCV_LAB_MAX_VALUE;
73 
81 
90 
98 
106 
115 
124 
133 
142 
150 
158 
166 
174 
175 #ifdef __cplusplus
176 } // extern "C"
177 #endif
178 
179 // end of header file
180 #endif
const double COLRCV_LAB_MAX_VALUE
Definition: lab.c:29
colrcv_xyz_t colrcv_lab_to_xyz(colrcv_lab_t lab)
Converts a LAB colour to an XYZ colour.
Definition: lab.c:105
bool colrcv_lab_a_is_valid(colrcv_lab_t lab)
Checks that saturation component of a given colrcv_lab_t struct is valid.
Definition: lab.c:37
colrcv_hsv_t colrcv_lab_to_hsv(colrcv_lab_t lab)
Converts a LAB colour to a HSV colour.
Definition: lab.c:86
Used to represent an XYZ colour.
Definition: xyz.h:43
This header file forward-declares (via typedef) all the data types used to represent colours in diffe...
colrcv_rgb_t colrcv_lab_to_rgb(colrcv_lab_t lab)
Converts a LAB colour to an RGB colour.
Definition: lab.c:81
bool colrcv_lab_is_valid(colrcv_lab_t lab)
Checks that the components of a given colrcv_lab_t struct are valid.
Definition: lab.c:49
bool colrcv_lab_b_is_valid(colrcv_lab_t lab)
Checks that value component of a given colrcv_lab_t struct is valid.
Definition: lab.c:43
colrcv_lab_t colrcv_lab_clamp_a(colrcv_lab_t lab)
Makes the a component of a given colrcv_lab_t struct fit within the &#39;standard&#39; range for that channel...
Definition: lab.c:69
const double COLRCV_LAB_B_MIN_VALUE
Definition: lab.c:28
bool colrcv_lab_l_is_valid(colrcv_lab_t lab)
Checks that hue component of a given colrcv_lab_t struct is valid.
Definition: lab.c:31
double l
The lightness. Should be in range 0 -> 100.
Definition: lab.h:43
const double COLRCV_LAB_L_MIN_VALUE
Definition: lab.c:26
colrcv_lab_t colrcv_lab_clamp_b(colrcv_lab_t lab)
Makes the b component of a given colrcv_lab_t struct fit within the &#39;standard&#39; range for that channel...
Definition: lab.c:75
colrcv_lab_t colrcv_lab_clamp_l(colrcv_lab_t lab)
Makes the lightness channel of a given colrcv_lab_t struct fit within the &#39;standard&#39; range for that c...
Definition: lab.c:63
double a
The a component. Should be in range -100 -> 100.
Definition: lab.h:45
Used to represent a HSV colour.
Definition: hsv.h:41
double b
The b component. Should be in range -100 -> 100.
Definition: lab.h:47
colrcv_hsl_t colrcv_lab_to_hsl(colrcv_lab_t lab)
Converts a LAB colour to a HSL colour.
Definition: lab.c:91
const double COLRCV_LAB_A_MIN_VALUE
Definition: lab.c:27
Used to represent a HSL colour.
Definition: hsl.h:41
Used to represent a LAB colour.
Definition: lab.h:41
Used to represent an RGB colour.
Definition: rgb.h:42
colrcv_lab_t colrcv_lab_clamp(colrcv_lab_t lab)
Makes all of the channels of a given colrcv_lab_t struct fit within the &#39;standard&#39; range for that cha...
Definition: lab.c:58