Zephyr Scientific Library (zscilib)
Data Structures | Enumerations | Functions
colorimetry.h File Reference

API header file for colorimetry in zscilib. More...

#include <stddef.h>
#include <stdint.h>
#include <zsl/zsl.h>
#include <zsl/matrices.h>

Go to the source code of this file.

Data Structures

struct  zsl_clr_xyz
 CIE 1931 XYZ tristimulus values. More...
 
struct  zsl_clr_xyy
 CIE 1931 xyY chromaticity coordinates. More...
 
struct  zsl_clr_uv60
 CIE 1960 UCS chromaticity coordinates. More...
 
struct  zsl_clr_uv76
 CIE 1976 UCS chromaticity coordinates. More...
 
struct  zsl_clr_rgbf
 RGBA color using floating-space notation from 0.0 .. 1.0. More...
 
struct  zsl_clr_rgb8
 RGBA color using 8-bit values. More...
 
struct  zsl_clr_rgb16
 RGBA color using 16-bit values. More...
 
struct  zsl_clr_cct
 Data representing a single CIE 1960 CCT, Duv value pair. More...
 
struct  zsl_clr_illum_data
 CIE 1931 XYZ tristimulus values for a standard illuminant. More...
 
struct  zsl_clr_obs_data
 CIE 1931 XYZ tristimulus values for a standard observer model in 5 nm steps from 360-830 nm (95 steps). More...
 
struct  zsl_clr_spd
 Spectral power distribution for a specific illumination. More...
 

Enumerations

enum  zsl_clr_obs {
  ZSL_CLR_OBS_2_DEG = 0,
  ZSL_CLR_OBS_10_DEG
}
 List of supported CIE standard observer models. All models cover the 360 nm to 830 nm range in 5 nm steps. More...
 
enum  zsl_clr_illum {
  ZSL_CLR_ILLUM_A = 0,
  ZSL_CLR_ILLUM_B,
  ZSL_CLR_ILLUM_C,
  ZSL_CLR_ILLUM_D50,
  ZSL_CLR_ILLUM_D55,
  ZSL_CLR_ILLUM_D65,
  ZSL_CLR_ILLUM_E,
  ZSL_CLR_ILLUM_ICC
}
 List of supported CIE standard illuminants. More...
 
enum  zsl_clr_lef {
  ZSL_CLR_LEF_CIE88_PHOTOPIC = 0,
  ZSL_CLR_LEF_CIE51_SCOTOPIC = 1
}
 List of supported CIE luminous efficiency functions. All functions cover the 380 nm to 780 nm range in 5 nm steps. More...
 
enum  zsl_clr_rgb_ccm {
  ZSL_CLR_RGB_CCM_SRGB_D65 = 0,
  ZSL_CLR_RGB_CCM_SRGB_D50,
  ZSL_CLR_RGB_CCM_ADOBERGB98,
  ZSL_CLR_RGB_CCM_SONY_SGAMUT3_CINE,
  ZSL_CLR_RGB_CCM_NTSC,
  ZSL_CLR_RGB_CCM_PAL_SECAM,
  ZSL_CLR_RGB_CCM_BT_709,
  ZSL_CLR_RGB_CCM_BT_2020,
  ZSL_CLR_RGB_CCM_ACES_P0,
  ZSL_CLR_RGB_CCM_ACES_P1,
  ZSL_CLR_RGB_CCM_DCI_P3,
  ZSL_CLR_RGB_CCM_DCI_P3_PLUS,
  ZSL_CLR_RGB_CCM_CIE_RGB
}
 List of included 3x3 XYZ to RGB color space correlation matrices. More...
 
enum  zsl_clr_uv_cct_method {
  ZSL_CLR_UV_CCT_METHOD_MCCAMY,
  ZSL_CLR_UV_CCT_METHOD_OHNO2011,
  ZSL_CLR_UV_CCT_METHOD_OHNO2014
}
 The algorithm to use when converting a CIE 1960 UV value to CCT, Duv. More...
 

Functions

int zsl_clr_conv_spd_xyz (const struct zsl_clr_spd *spd, enum zsl_clr_obs obs, struct zsl_clr_xyz *xyz)
 Converts the supplied spectral power distribution data into it's equivalent XYZ tristimulus using the specified standard observer model. More...
 
int zsl_clr_conv_xyy_xyz (struct zsl_clr_xyy *xyy, struct zsl_clr_xyz *xyz)
 Converts a CIE 1931 xyY chromaticity to its XYZ tristimulus equivalent. More...
 
int zsl_clr_conv_xyz_xyy (struct zsl_clr_xyz *xyz, struct zsl_clr_xyy *xyy)
 Converts CIE 1931 XYZ tristimulus values to the xyY chromaticity equivalent. More...
 
int zsl_clr_conv_xyy_uv60 (struct zsl_clr_xyy *xyy, struct zsl_clr_uv60 *uv)
 Converts a CIE 1931 xyY chromaticity to its CIE 1960 uv equivalent. More...
 
int zsl_clr_conv_xyz_uv60 (struct zsl_clr_xyz *xyz, struct zsl_clr_uv60 *uv)
 Converts CIE 1931 XYZ tristimulus values to its CIE 1960 uv equivalent. More...
 
int zsl_clr_conv_uv60_xyz (struct zsl_clr_uv60 *uv, struct zsl_clr_xyz *xyz)
 Converts a CIE 1960 uv value to its CIE 1931 XYZ tristimulus equivalent. More...
 
int zsl_clr_conv_uv60_xyy (struct zsl_clr_uv60 *uv, struct zsl_clr_xyy *xyy)
 Converts a CIE 1960 uv value to its CIE 1931 xyY chromaticity equivalent. More...
 
int zsl_clr_conv_uv60_uv76 (struct zsl_clr_uv60 *uv60, struct zsl_clr_uv76 *uv76)
 Converts a CIE 1960 uv value to its CIE 1976 u'v' equivalent. More...
 
int zsl_clr_conv_uv76_uv60 (struct zsl_clr_uv76 *uv76, struct zsl_clr_uv60 *uv60)
 Converts a CIE 1976 u'v' value to its CIE 1960 uv equivalent. More...
 
int zsl_clr_conv_ct_uv60 (zsl_real_t ct, enum zsl_clr_obs obs, struct zsl_clr_uv60 *uv)
 
int zsl_clr_conv_ct_xyz (zsl_real_t ct, enum zsl_clr_obs obs, struct zsl_clr_xyz *xyz)
 Converts an exact CIE 1960 CCT (Duv = 0.0) to a CIE 1931 XYZ tristimulus. More...
 
int zsl_clr_conv_ct_rgb8 (zsl_real_t ct, enum zsl_clr_obs obs, struct zsl_mtx *mtx, struct zsl_clr_rgb8 *rgb)
 Converts an exact CIE 1960 CCT (Duv = 0.0) to an 8-bit RGBA value using the supplied XYZ to RGB color space correlation matrix. More...
 
int zsl_clr_conv_ct_rgbf (zsl_real_t ct, enum zsl_clr_obs obs, struct zsl_mtx *mtx, struct zsl_clr_rgbf *rgb)
 Converts an exact CIE 1960 CCT (Duv = 0.0) to an floating point RGBA value using the supplied XYZ to RGB color space correlation matrix. More...
 
int zsl_clr_conv_cct_xyy (struct zsl_clr_cct *cct, enum zsl_clr_obs obs, struct zsl_clr_xyy *xyy)
 Converts a CIE 1960 CCT and Duv pair to a CIE 1931 xyY chromaticity. More...
 
int zsl_clr_conv_cct_xyz (struct zsl_clr_cct *cct, enum zsl_clr_obs obs, struct zsl_clr_xyz *xyz)
 Converts a CIE 1960 CCT and Duv pair to a CIE 1931 XYZ tristimulus. More...
 
int zsl_clr_conv_uv60_cct (enum zsl_clr_uv_cct_method method, struct zsl_clr_uv60 *uv, struct zsl_clr_cct *cct)
 Converts a CIE 1960 (u, v) pair to a CIE 1960 CCT and Duv pair using the specified conversion algorithm. More...
 
int zsl_clr_conv_xyz_rgb8 (struct zsl_clr_xyz *xyz, struct zsl_mtx *mtx, struct zsl_clr_rgb8 *rgb)
 Converts a CIE 1931 XYZ tristimulus to an 8-bit RGBA value using the supplied XYZ to RGB color space correlation matrix. More...
 
int zsl_clr_conv_xyz_rgbf (struct zsl_clr_xyz *xyz, struct zsl_mtx *mtx, struct zsl_clr_rgbf *rgb)
 Converts a CIE 1931 XYZ tristimulus to an floating point RGBA value using the supplied XYZ to RGB color space correlation matrix. More...
 
int zsl_clr_norm_spd (struct zsl_clr_spd *spd)
 Normalises the supplied spectral power distribution data to a 1.0 range. This function call is destructive to the input zsl_clr_spd data. More...
 
int zsl_clr_illum_get (enum zsl_clr_obs obs, enum zsl_clr_illum illum, const struct zsl_clr_illum_data **data)
 Retrieves a pointer to the zsl_clr_illum_data for the specified illuminant. More...
 
void zsl_clr_obs_get (enum zsl_clr_obs obs, const struct zsl_clr_obs_data **data)
 Retrieves a pointer to the zsl_clr_obs_data for the specified CIE standard observer model. More...
 
void zsl_clr_lef_get (enum zsl_clr_lef lef, const struct zsl_clr_spd **data)
 Retrieves a pointer to the zsl_clr_spd data for the specified CIE luminous efficiency function. More...
 
int zsl_clr_lef_lerp (enum zsl_clr_lef lef, unsigned int nm, zsl_real_t *val)
 Interpolates a single value from the specified CIE luminous efficiency function using linear interpolation. More...
 
void zsl_clr_rgbccm_get (enum zsl_clr_rgb_ccm ccm, struct zsl_mtx **mtx)
 Retrieves a pointer to a standard 3x3 XYZ to RGB color space correlation matrix. More...
 

Detailed Description

API header file for colorimetry in zscilib.

This file contains the entry points to the colorimetry APIs.

Definition in file colorimetry.h.