Coverage for models/rgb/datasets/gopro.py: 0%

24 statements  

« prev     ^ index     » next       coverage.py v7.11.0, created at 2025-11-16 22:49 +1300

1""" 

2GoPro Colourspaces 

3================== 

4 

5Define the *GoPro* colourspaces: 

6 

7- :attr:`colour.models.RGB_COLOURSPACE_PROTUNE_NATIVE`. 

8 

9Notes 

10----- 

11- The *Protune Native* colourspace primaries were derived using the method 

12 outlined in :cite:`Mansencal2015d` followed with a chromatic adaptation 

13 step to *CIE Standard Illuminant D Series D65* using 

14 :func:`colour.chromatically_adapted_primaries` definition. 

15 

16References 

17---------- 

18- :cite:`GoPro2016a` : GoPro, Duiker, H.-P., & Mansencal, T. (2016). 

19 gopro.py. Retrieved April 12, 2017, from 

20 https://github.com/hpd/OpenColorIO-Configs/blob/master/aces_1.0.3/python/\ 

21aces_ocio/colorspaces/gopro.py 

22- :cite:`Mansencal2015d` : Mansencal, T. (2015). RED Colourspaces Derivation. 

23 Retrieved May 20, 2015, from 

24 https://www.colour-science.org/posts/red-colourspaces-derivation 

25""" 

26 

27from __future__ import annotations 

28 

29import typing 

30 

31import numpy as np 

32 

33from colour.colorimetry import CCS_ILLUMINANTS 

34 

35if typing.TYPE_CHECKING: 

36 from colour.hints import NDArrayFloat 

37 

38from colour.models.rgb import ( 

39 RGB_Colourspace, 

40 log_decoding_Protune, 

41 log_encoding_Protune, 

42 normalised_primary_matrix, 

43) 

44 

45__author__ = "Colour Developers" 

46__copyright__ = "Copyright 2013 Colour Developers" 

47__license__ = "BSD-3-Clause - https://opensource.org/licenses/BSD-3-Clause" 

48__maintainer__ = "Colour Developers" 

49__email__ = "colour-developers@colour-science.org" 

50__status__ = "Production" 

51 

52__all__ = [ 

53 "PRIMARIES_PROTUNE_NATIVE", 

54 "WHITEPOINT_NAME_PROTUNE_NATIVE", 

55 "CCS_WHITEPOINT_PROTUNE_NATIVE", 

56 "MATRIX_PROTUNE_NATIVE_TO_XYZ", 

57 "MATRIX_XYZ_TO_PROTUNE_NATIVE", 

58 "RGB_COLOURSPACE_PROTUNE_NATIVE", 

59] 

60 

61PRIMARIES_PROTUNE_NATIVE: NDArrayFloat = np.array( 

62 [ 

63 [0.698480461493841, 0.193026445370121], 

64 [0.329555378387345, 1.024596624134644], 

65 [0.108442631407675, -0.034678569754016], 

66 ] 

67) 

68"""*Protune Native* colourspace primaries.""" 

69 

70WHITEPOINT_NAME_PROTUNE_NATIVE: str = "D65" 

71"""*Protune Native* colourspace whitepoint name.""" 

72 

73CCS_WHITEPOINT_PROTUNE_NATIVE: NDArrayFloat = CCS_ILLUMINANTS[ 

74 "CIE 1931 2 Degree Standard Observer" 

75][WHITEPOINT_NAME_PROTUNE_NATIVE] 

76"""*Protune Native* colourspace whitepoint chromaticity coordinates.""" 

77 

78MATRIX_PROTUNE_NATIVE_TO_XYZ: NDArrayFloat = normalised_primary_matrix( 

79 PRIMARIES_PROTUNE_NATIVE, CCS_WHITEPOINT_PROTUNE_NATIVE 

80) 

81"""*Protune Native* colourspace to *CIE XYZ* tristimulus values matrix.""" 

82 

83MATRIX_XYZ_TO_PROTUNE_NATIVE: NDArrayFloat = np.linalg.inv(MATRIX_PROTUNE_NATIVE_TO_XYZ) 

84"""*CIE XYZ* tristimulus values to *Protune Native* colourspace matrix.""" 

85 

86RGB_COLOURSPACE_PROTUNE_NATIVE: RGB_Colourspace = RGB_Colourspace( 

87 "Protune Native", 

88 PRIMARIES_PROTUNE_NATIVE, 

89 CCS_WHITEPOINT_PROTUNE_NATIVE, 

90 WHITEPOINT_NAME_PROTUNE_NATIVE, 

91 MATRIX_PROTUNE_NATIVE_TO_XYZ, 

92 MATRIX_XYZ_TO_PROTUNE_NATIVE, 

93 log_encoding_Protune, 

94 log_decoding_Protune, 

95) 

96RGB_COLOURSPACE_PROTUNE_NATIVE.__doc__ = """ 

97*Protune Native* colourspace. 

98 

99References 

100---------- 

101:cite:`GoPro2016a`, :cite:`Mansencal2015d` 

102"""