File indexing completed on 2024-05-12 15:59:33

0001 /*
0002  *  SPDX-FileCopyrightText: 2021 Wolthera van Hövell tot Westerflier <griffinvalley@gmail.com>
0003  *
0004  *  SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 
0007 #ifndef KOCOLORPROFILECONSTANTS_H
0008 #define KOCOLORPROFILECONSTANTS_H
0009 
0010 
0011 /**
0012  * @brief The colorPrimaries enum
0013  * Enum of colorants, follows ITU H.273 for values 0 to 255,
0014  * and has extra known quantities starting at 256.
0015  *
0016  * This is used for profile generation and file encoding.
0017  */
0018 enum ColorPrimaries {
0019     //0 is resevered
0020     PRIMARIES_ITU_R_BT_709_5 = 1, // sRGB, rec 709
0021     PRIMARIES_UNSPECIFIED = 2,
0022     //3 is reserved
0023     PRIMARIES_ITU_R_BT_470_6_SYSTEM_M = 4,
0024     PRIMARIES_ITU_R_BT_470_6_SYSTEM_B_G,
0025     PRIMARIES_ITU_R_BT_601_6,
0026     PRIMARIES_SMPTE_240M, // Old HDTv standard.
0027     PRIMARIES_GENERIC_FILM, // H.273 says 'color filters using illuminant C'
0028     PRIMARIES_ITU_R_BT_2020_2_AND_2100_0,
0029     PRIMARIES_SMPTE_ST_428_1, // XYZ
0030     PRIMARIES_SMPTE_RP_431_2, //DCI P3, or Digital Cinema Projector
0031     PRIMARIES_SMPTE_EG_432_1, //Display P3
0032     // 13-21 are reserved.
0033     PRIMARIES_EBU_Tech_3213_E = 22,
0034     // 23-255 are reserved by ITU/ISO
0035     PRIMARIES_ADOBE_RGB_1998 = 256,
0036     PRIMARIES_PROPHOTO
0037 };
0038 
0039 /**
0040  * @brief The transferCharacteristics enum
0041  * Enum of transfer characteristics, follows ITU H.273 for values 0 to 255,
0042  * and has extra known quantities starting at 256.
0043  *
0044  * This is used for profile generation and file encoding.
0045  */
0046 enum TransferCharacteristics {
0047     // 0 is reserved.
0048     TRC_ITU_R_BT_709_5 = 1, //Different from sRGB, officially HDTV
0049     TRC_UNSPECIFIED, // According to H.273: Image characteristics are unknown or are determined by the application.
0050     // 3 is reserved.
0051     TRC_ITU_R_BT_470_6_SYSTEM_M = 4, //Assumed gamma 2.2
0052     TRC_ITU_R_BT_470_6_SYSTEM_B_G, // Assume gamma 2.8
0053     TRC_ITU_R_BT_601_6, //SDTV
0054     TRC_SMPTE_240M,
0055     TRC_LINEAR,
0056     TRC_LOGARITHMIC_100,
0057     TRC_LOGARITHMIC_100_sqrt10,
0058     TRC_IEC_61966_2_4, //xvYCC, not to be confused with sRGB and scRGB.
0059     TRC_ITU_R_BT_1361, // H.273: "Extended color gamut system (historical)"
0060     TRC_IEC_61966_2_1, //sRGB, different from rec709
0061     TRC_ITU_R_BT_2020_2_10bit, //formally, rec 709, can also be gamma 2.4 UHDTV
0062     TRC_ITU_R_BT_2020_2_12bit, //formally, a precise version of rec 709. UHDTV
0063     TRC_ITU_R_BT_2100_0_PQ, //Perceptual Quantizer, cannot be represented in icc 4, also named SMPTE 2048 curve, HDR
0064     TRC_SMPTE_ST_428_1, //O = (48 * I / 52.37) ^ (1 / 2.6), cannot be represented in icc 4
0065     TRC_ITU_R_BT_2100_0_HLG, //Hybrid Log Gamma, cannot be represented in icc 4, HDR
0066     // 19-255 are reserved by ITU/ISO
0067     TRC_GAMMA_1_8 = 256, //Gamma 1.8
0068     TRC_GAMMA_2_4, //Gamma 2.4
0069     TRC_PROPHOTO, //Gamma 1.8 unless under 16/512
0070     TRC_A98, // Gamma of 256/563
0071     TRC_LAB_L // L* transfer curve
0072 };
0073 
0074 #endif // KOCOLORPROFILECONSTANTS_H
0075