colrcv  v0.5.0
C Library for converting Colours between different Colour Models
Data Structures | Functions | Variables
xyz.h File Reference

This header file defines the data types for representing colours in the XYZ model, and functions for manipulating it. More...

#include <stdbool.h>
#include "../colrcv.h"
#include "types.h"
Include dependency graph for xyz.h:

Go to the source code of this file.

Data Structures

struct  colrcv_xyz_t
 Used to represent an XYZ colour. More...
 

Functions

bool colrcv_xyz_x_is_valid (colrcv_xyz_t xyz)
 Checks that x component of a given colrcv_xyz_t struct is valid. More...
 
bool colrcv_xyz_y_is_valid (colrcv_xyz_t xyz)
 Checks that y component of a given colrcv_xyz_t struct is valid. More...
 
bool colrcv_xyz_z_is_valid (colrcv_xyz_t xyz)
 Checks that z component of a given colrcv_xyz_t struct is valid. More...
 
bool colrcv_xyz_is_valid (colrcv_xyz_t xyz)
 Checks that the components of a given colrcv_xyz_t struct are valid. More...
 
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 'standard' range for that channel. More...
 
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 'standard' range for that channel. More...
 
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 'standard' range for that channel. More...
 
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 'standard' range for that channel. More...
 
colrcv_rgb_t colrcv_xyz_to_rgb (colrcv_xyz_t xyz)
 Converts an XYZ colour to an RGB colour. More...
 
colrcv_hsv_t colrcv_xyz_to_hsv (colrcv_xyz_t xyz)
 Converts an XYZ colour to a HSV colour. More...
 
colrcv_hsl_t colrcv_xyz_to_hsl (colrcv_xyz_t xyz)
 Converts an XYZ colour to a HSL colour. More...
 
colrcv_lab_t colrcv_xyz_to_lab (colrcv_xyz_t xyz)
 Converts an XYZ colour to a LAB colour. More...
 

Variables

const double COLRCV_XYZ_MIN_VALUE
 
const double COLRCV_XYZ_X_MAX_VALUE
 
const double COLRCV_XYZ_Y_MAX_VALUE
 
const double COLRCV_XYZ_Z_MAX_VALUE
 
const double COLRCV_XYZ_X_REF_VALUE
 
const double COLRCV_XYZ_Y_REF_VALUE
 
const double COLRCV_XYZ_Z_REF_VALUE
 

Detailed Description

This header file defines the data types for representing colours in the XYZ model, and functions for manipulating it.

Author
Joshua Saxby <joshua.a.saxby+TNOPLuc8vM==@gmail.com>
Date
2018
Since
v0.1.0

Function Documentation

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 'standard' range for that channel.

Returns
A copy of the given struct with all channels guaranteed to be within range.
Since
v0.4.0
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 'standard' range for that channel.

Returns
A copy of the given struct with the x component guaranteed to be within range.
Since
v0.4.0
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 'standard' range for that channel.

Returns
A copy of the given struct with the y component guaranteed to be within range.
Since
v0.4.0
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 'standard' range for that channel.

Returns
A copy of the given struct with the z component guaranteed to be within range.
Since
v0.4.0
bool colrcv_xyz_is_valid ( colrcv_xyz_t  xyz)

Checks that the components of a given colrcv_xyz_t struct are valid.

Returns
true if it is valid
false if it is not valid
Since
v0.1.0
colrcv_hsl_t colrcv_xyz_to_hsl ( colrcv_xyz_t  xyz)

Converts an XYZ colour to a HSL colour.

Parameters
xyzAn XYZ colour to be converted
Returns
The HSL colour that the XYZ colour was converted to
Since
v0.2.0
colrcv_hsv_t colrcv_xyz_to_hsv ( colrcv_xyz_t  xyz)

Converts an XYZ colour to a HSV colour.

Parameters
xyzAn XYZ colour to be converted
Returns
The HSV colour that the XYZ colour was converted to
Since
v0.2.0
colrcv_lab_t colrcv_xyz_to_lab ( colrcv_xyz_t  xyz)

Converts an XYZ colour to a LAB colour.

Parameters
xyzAn XYZ colour to be converted
Returns
The LAB colour that the XYZ colour was converted to
Since
v0.1.0
colrcv_rgb_t colrcv_xyz_to_rgb ( colrcv_xyz_t  xyz)

Converts an XYZ colour to an RGB colour.

Parameters
xyzAn XYZ colour to be converted
Returns
The RGB colour that the XYZ colour was converted to
Since
v0.1.0
bool colrcv_xyz_x_is_valid ( colrcv_xyz_t  xyz)

Checks that x component of a given colrcv_xyz_t struct is valid.

Returns
true if it is valid
false if it is not valid
Since
v0.1.0
bool colrcv_xyz_y_is_valid ( colrcv_xyz_t  xyz)

Checks that y component of a given colrcv_xyz_t struct is valid.

Returns
true if it is valid
false if it is not valid
Since
v0.1.0
bool colrcv_xyz_z_is_valid ( colrcv_xyz_t  xyz)

Checks that z component of a given colrcv_xyz_t struct is valid.

Returns
true if it is valid
false if it is not valid
Since
v0.1.0

Variable Documentation

const double COLRCV_XYZ_MIN_VALUE

The minimum value that any of the components should have

Since
v0.1.0
const double COLRCV_XYZ_X_MAX_VALUE

The maximum value that the x component should have

Since
v0.1.0
const double COLRCV_XYZ_X_REF_VALUE

Reference X value for an Observer of 2° and an Illuminant of D65

Since
v0.1.0
const double COLRCV_XYZ_Y_MAX_VALUE

The maximum value that the y component should have

Since
v0.1.0
const double COLRCV_XYZ_Y_REF_VALUE

Reference Y value for an Observer of 2° and an Illuminant of D65

Since
v0.1.0
const double COLRCV_XYZ_Z_MAX_VALUE

The maximum value that the z component should have

Since
v0.1.0
const double COLRCV_XYZ_Z_REF_VALUE

Reference Z value for an Observer of 2° and an Illuminant of D65

Since
v0.1.0