colrcv  v0.5.0
C Library for converting Colours between different Colour Models
xyz.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_XYZ_H
25 #define SAXBOPHONE_COLRCV_MODELS_XYZ_H
26 
27 #include <stdbool.h>
28 
29 #include "../colrcv.h"
30 #include "types.h"
31 
32 
33 #ifdef __cplusplus
34 extern "C"{
35 #endif
36 
43 struct colrcv_xyz_t {
45  double x;
47  double y;
49  double z;
50 };
51 
56 extern const double COLRCV_XYZ_MIN_VALUE;
57 
62 extern const double COLRCV_XYZ_X_MAX_VALUE;
67 extern const double COLRCV_XYZ_Y_MAX_VALUE;
72 extern const double COLRCV_XYZ_Z_MAX_VALUE;
73 
78 extern const double COLRCV_XYZ_X_REF_VALUE;
83 extern const double COLRCV_XYZ_Y_REF_VALUE;
88 extern const double COLRCV_XYZ_Z_REF_VALUE;
89 
97 
106 
114 
122 
131 
140 
149 
158 
166 
174 
182 
190 
191 #ifdef __cplusplus
192 } // extern "C"
193 #endif
194 
195 // end of header file
196 #endif
double y
The y component. Should be in range 0 -> 100.
Definition: xyz.h:47
const double COLRCV_XYZ_Z_MAX_VALUE
Definition: xyz.c:30
colrcv_rgb_t colrcv_xyz_to_rgb(colrcv_xyz_t xyz)
Converts an XYZ colour to an RGB colour.
Definition: xyz.c:106
colrcv_lab_t colrcv_xyz_to_lab(colrcv_xyz_t xyz)
Converts an XYZ colour to a LAB colour.
Definition: xyz.c:143
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_xyz_t colrcv_xyz_clamp_z(colrcv_xyz_t xyz)
Makes the z component of a given colrcv_xyz_t struct fit within the &#39;standard&#39; range for that channel...
Definition: xyz.c:80
bool colrcv_xyz_x_is_valid(colrcv_xyz_t xyz)
Checks that x component of a given colrcv_xyz_t struct is valid.
Definition: xyz.c:36
colrcv_xyz_t colrcv_xyz_clamp_y(colrcv_xyz_t xyz)
Makes the y component of a given colrcv_xyz_t struct fit within the &#39;standard&#39; range for that channel...
Definition: xyz.c:74
colrcv_hsv_t colrcv_xyz_to_hsv(colrcv_xyz_t xyz)
Converts an XYZ colour to a HSV colour.
Definition: xyz.c:126
const double COLRCV_XYZ_Y_MAX_VALUE
Definition: xyz.c:29
Used to represent a HSV colour.
Definition: hsv.h:41
colrcv_xyz_t colrcv_xyz_clamp(colrcv_xyz_t xyz)
Makes all of the channels of a given colrcv_xyz_t struct fit within the &#39;standard&#39; range for that cha...
Definition: xyz.c:63
const double COLRCV_XYZ_Z_REF_VALUE
Definition: xyz.c:34
colrcv_xyz_t colrcv_xyz_clamp_x(colrcv_xyz_t xyz)
Makes the x component of a given colrcv_xyz_t struct fit within the &#39;standard&#39; range for that channel...
Definition: xyz.c:68
double x
The x component. Should be in range 0 -> 112.
Definition: xyz.h:45
bool colrcv_xyz_z_is_valid(colrcv_xyz_t xyz)
Checks that z component of a given colrcv_xyz_t struct is valid.
Definition: xyz.c:48
const double COLRCV_XYZ_MIN_VALUE
Definition: xyz.c:26
const double COLRCV_XYZ_X_REF_VALUE
Definition: xyz.c:32
double z
The z component. Should be in range 0 -> 123.
Definition: xyz.h:49
colrcv_hsl_t colrcv_xyz_to_hsl(colrcv_xyz_t xyz)
Converts an XYZ colour to a HSL colour.
Definition: xyz.c:131
Used to represent a HSL colour.
Definition: hsl.h:41
const double COLRCV_XYZ_Y_REF_VALUE
Definition: xyz.c:33
Used to represent a LAB colour.
Definition: lab.h:41
bool colrcv_xyz_is_valid(colrcv_xyz_t xyz)
Checks that the components of a given colrcv_xyz_t struct are valid.
Definition: xyz.c:54
const double COLRCV_XYZ_X_MAX_VALUE
Definition: xyz.c:28
bool colrcv_xyz_y_is_valid(colrcv_xyz_t xyz)
Checks that y component of a given colrcv_xyz_t struct is valid.
Definition: xyz.c:42
Used to represent an RGB colour.
Definition: rgb.h:42