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

This is the main header file. More...

#include <stdbool.h>
#include <stdint.h>
Include dependency graph for colrcv.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  colrcv_version_t
 Used to represent a version of colrcv. More...
 

Typedefs

typedef struct colrcv_version_t colrcv_version_t
 Used to represent a version of colrcv. More...
 

Functions

bool colrcv_range_valid (double min, double val, double max)
 A utility function for checking that a given value is in a given range. More...
 
double colrcv_min (double a, double b)
 Get the smallest of two given values. More...
 
double colrcv_max (double a, double b)
 Get the largest of two given values. More...
 
double colrcv_clamp (double value, double min, double max)
 Clamp a given value to be within a given range. More...
 

Variables

const colrcv_version_t COLRCV_VERSION
 Stores the current version of colrcv. More...
 

Detailed Description

This is the main header file.

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

Typedef Documentation

Used to represent a version of colrcv.

Versions are of the format <MAJOR.MINOR.patch>

Since
v0.1.0

Function Documentation

double colrcv_clamp ( double  value,
double  min,
double  max 
)

Clamp a given value to be within a given range.

Parameters
valueThe value to clamp
minThe minimum value
maxThe maximum value
Returns
clamped version of value, guaranteed to be within the range min -> max
Since
v0.4.0
double colrcv_max ( double  a,
double  b 
)

Get the largest of two given values.

Returns
The largest value
Since
v0.1.0
double colrcv_min ( double  a,
double  b 
)

Get the smallest of two given values.

Returns
The smallest value
Since
v0.1.0
bool colrcv_range_valid ( double  min,
double  val,
double  max 
)

A utility function for checking that a given value is in a given range.

Checks that the condition min <= val <= max is true

Returns
true if the condition is satisfied
false if the condition is not satisfied
Since
v0.1.0

Variable Documentation

const colrcv_version_t COLRCV_VERSION

Stores the current version of colrcv.

Since
v0.1.0