Coverage for characterisation/cameras.py: 7%

1"""

2 Cameras Sensitivities

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

4

5 Define spectral distribution classes for camera sensor characterisation

6 datasets from the :mod:`colour.characterisation.datasets.cameras` module.

7

8- :class:`colour.characterisation.RGB_CameraSensitivities`: Define support

9 for camera *RGB* sensitivities.

10"""

11

12 from __future__ import annotations

13

14 import typing

15

16 from colour.colorimetry import (

17 MultiSpectralDistributions,

18 SpectralDistribution,

19 SpectralShape,

20)

21

22 if typing.TYPE_CHECKING:

23 from collections.abc import KeysView, ValuesView

24 from colour.continuous import MultiSignals, Signal

25 from colour.hints import (

26 Any,

27 ArrayLike,

28 Sequence,

29 )

30

31 from colour.utilities import is_pandas_installed

32

33 if typing.TYPE_CHECKING or is_pandas_installed():

34 from pandas import DataFrame, Series # pragma: no cover

35 else: # pragma: no cover

36 from unittest import mock

37

38 DataFrame = mock.MagicMock()

39 Series = mock.MagicMock()

40

41 __author__ = "Colour Developers"

42 __copyright__ = "Copyright 2013 Colour Developers"

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

44 __maintainer__ = "Colour Developers"

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

46 __status__ = "Production"

47

48 __all__ = [

49 "RGB_CameraSensitivities",

50]

51

52

53 class RGB_CameraSensitivities(MultiSpectralDistributions):

54 """

55 Define a container for camera *RGB* spectral sensitivities.

56

57 Parameters

58 ----------

59 data

60 Data to be stored in the multi-spectral distributions.

61 domain

62 Values to initialise the multiple

63 :class:`colour.SpectralDistribution` class instances

64 :attr:`colour.continuous.Signal.wavelengths` attribute with. If

65 both ``data`` and ``domain`` arguments are defined, the latter will

66 be used to initialise the

67 :attr:`colour.continuous.Signal.wavelengths` property.

68 labels

69 Names to use for the :class:`colour.SpectralDistribution` class

70 instances.

71

72 Other Parameters

73 ----------------

74 extrapolator

75 Extrapolator class type to use as extrapolating function for the

76 :class:`colour.SpectralDistribution` class instances.

77 extrapolator_kwargs

78 Arguments to use when instantiating the extrapolating function of

79 the :class:`colour.SpectralDistribution` class instances.

80 interpolator

81 Interpolator class type to use as interpolating function for the

82 :class:`colour.SpectralDistribution` class instances.

83 interpolator_kwargs

84 Arguments to use when instantiating the interpolating function of

85 the :class:`colour.SpectralDistribution` class instances.

86 name

87 Multi-spectral distributions name.

88 display_labels

89 Multi-spectral distributions labels for figures, default to

90 :attr:`colour.colorimetry.RGB_CameraSensitivities.labels` property

91 value.

92 """

93

94 def __init__(

95 self,

96 data: (

97 ArrayLike

98 | DataFrame

99 | dict

100 | MultiSignals

101 | MultiSpectralDistributions

102 | Sequence

103 | Series

104 | Signal

105 | SpectralDistribution

106 | ValuesView

107 | None

108 ) = None,

109 domain: ArrayLike | SpectralShape | KeysView | None = None,

110 labels: Sequence | None = None, # noqa: ARG002

111 **kwargs: Any,

112 ) -> None:

113 super().__init__(data, domain, labels=("red", "green", "blue"), **kwargs)