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

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

#include <stdbool.h>
#include "types.h"
Include dependency graph for hsv.h:

Go to the source code of this file.

Data Structures

struct  colrcv_hsv_t
 Used to represent a HSV colour. More...
 

Functions

bool colrcv_hsv_h_is_valid (colrcv_hsv_t hsv)
 Checks that hue component of a given colrcv_hsv_t struct is valid. More...
 
bool colrcv_hsv_s_is_valid (colrcv_hsv_t hsv)
 Checks that saturation component of a given colrcv_hsv_t struct is valid. More...
 
bool colrcv_hsv_v_is_valid (colrcv_hsv_t hsv)
 Checks that value component of a given colrcv_hsv_t struct is valid. More...
 
bool colrcv_hsv_is_valid (colrcv_hsv_t hsv)
 Checks that the components of a given colrcv_hsv_t struct are valid. More...
 
colrcv_hsv_t colrcv_hsv_clamp (colrcv_hsv_t hsv)
 Makes all of the channels of a given colrcv_hsv_t struct fit within the 'standard' range for that channel. More...
 
colrcv_hsv_t colrcv_hsv_clamp_h (colrcv_hsv_t hsv)
 Makes the hue channel of a given colrcv_hsv_t struct fit within the 'standard' range for that channel. More...
 
colrcv_hsv_t colrcv_hsv_clamp_s (colrcv_hsv_t hsv)
 Makes the saturation channel of a given colrcv_hsv_t struct fit within the 'standard' range for that channel. More...
 
colrcv_hsv_t colrcv_hsv_clamp_v (colrcv_hsv_t hsv)
 Makes the value channel of a given colrcv_hsv_t struct fit within the 'standard' range for that channel. More...
 
colrcv_rgb_t colrcv_hsv_to_rgb (colrcv_hsv_t hsv)
 Converts a HSV colour to an RGB colour. More...
 
colrcv_hsl_t colrcv_hsv_to_hsl (colrcv_hsv_t hsv)
 Converts a HSV colour to a HSL colour. More...
 
colrcv_lab_t colrcv_hsv_to_lab (colrcv_hsv_t hsv)
 Converts a HSV colour to a LAB colour. More...
 
colrcv_xyz_t colrcv_hsv_to_xyz (colrcv_hsv_t hsv)
 Converts a HSV colour to an XYZ colour. More...
 

Variables

const double COLRCV_HSV_MIN_VALUE
 
const double COLRCV_HSV_H_MAX_VALUE
 
const double COLRCV_HSV_S_MAX_VALUE
 
const double COLRCV_HSV_V_MAX_VALUE
 

Detailed Description

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

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

Function Documentation

colrcv_hsv_t colrcv_hsv_clamp ( colrcv_hsv_t  hsv)

Makes all of the channels of a given colrcv_hsv_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_hsv_t colrcv_hsv_clamp_h ( colrcv_hsv_t  hsv)

Makes the hue channel of a given colrcv_hsv_t struct fit within the 'standard' range for that channel.

Returns
A copy of the given struct with the hue channel guaranteed to be within range.
Since
v0.4.0
colrcv_hsv_t colrcv_hsv_clamp_s ( colrcv_hsv_t  hsv)

Makes the saturation channel of a given colrcv_hsv_t struct fit within the 'standard' range for that channel.

Returns
A copy of the given struct with the saturation channel guaranteed to be within range.
Since
v0.4.0
colrcv_hsv_t colrcv_hsv_clamp_v ( colrcv_hsv_t  hsv)

Makes the value channel of a given colrcv_hsv_t struct fit within the 'standard' range for that channel.

Returns
A copy of the given struct with the value channel guaranteed to be within range.
Since
v0.4.0
bool colrcv_hsv_h_is_valid ( colrcv_hsv_t  hsv)

Checks that hue component of a given colrcv_hsv_t struct is valid.

Returns
true if it is valid
false if it is not valid
Since
v0.1.0
bool colrcv_hsv_is_valid ( colrcv_hsv_t  hsv)

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

Returns
true if it is valid
false if it is not valid
Since
v0.1.0
bool colrcv_hsv_s_is_valid ( colrcv_hsv_t  hsv)

Checks that saturation component of a given colrcv_hsv_t struct is valid.

Returns
true if it is valid
false if it is not valid
Since
v0.1.0
colrcv_hsl_t colrcv_hsv_to_hsl ( colrcv_hsv_t  hsv)

Converts a HSV colour to a HSL colour.

Parameters
hsvA HSV colour to be converted
Returns
The HSL colour that the HSV colour was converted to
Since
v0.1.0
colrcv_lab_t colrcv_hsv_to_lab ( colrcv_hsv_t  hsv)

Converts a HSV colour to a LAB colour.

Parameters
hsvA HSV colour to be converted
Returns
The LAB colour that the HSV colour was converted to
Since
v0.1.0
colrcv_rgb_t colrcv_hsv_to_rgb ( colrcv_hsv_t  hsv)

Converts a HSV colour to an RGB colour.

Parameters
hsvA HSV colour to be converted
Returns
The RGB colour that the HSV colour was converted to
Since
v0.1.0
colrcv_xyz_t colrcv_hsv_to_xyz ( colrcv_hsv_t  hsv)

Converts a HSV colour to an XYZ colour.

Parameters
hsvA HSV colour to be converted
Returns
The XYZ colour that the HSV colour was converted to
Since
v0.1.0
bool colrcv_hsv_v_is_valid ( colrcv_hsv_t  hsv)

Checks that value component of a given colrcv_hsv_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_HSV_H_MAX_VALUE

The maximum value that the h component should have

Since
v0.1.0
const double COLRCV_HSV_MIN_VALUE

The minimum value that any of the components should have

Since
v0.1.0
const double COLRCV_HSV_S_MAX_VALUE

The maximum value that the s component should have

Since
v0.1.0
const double COLRCV_HSV_V_MAX_VALUE

The maximum value that the v component should have

Since
v0.1.0