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

1"""

2 GoPro Colourspaces

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

4

5 Define the *GoPro* colourspaces:

6

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

8

9 Notes

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

16 References

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/\

21 aces_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

27 from __future__ import annotations

28

29 import typing

30

31 import numpy as np

32

33 from colour.colorimetry import CCS_ILLUMINANTS

34

35 if typing.TYPE_CHECKING:

36 from colour.hints import NDArrayFloat

37

38 from 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

61 PRIMARIES_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

70 WHITEPOINT_NAME_PROTUNE_NATIVE: str = "D65"

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

72

73 CCS_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

78 MATRIX_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

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

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

85

86 RGB_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)

96 RGB_COLOURSPACE_PROTUNE_NATIVE.__doc__ = """

97*Protune Native* colourspace.

98

99 References

100----------

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

102"""