Coverage for io/__init__.py: 3%

1 import sys

2

3 from colour.hints import Any

4 from colour.utilities.deprecation import ModuleAPI, build_API_changes

5 from colour.utilities.documentation import is_documentation_building

6

7 from . import luts

8 from .image import (

9 MAPPING_BIT_DEPTH,

10 READ_IMAGE_METHODS,

11 WRITE_IMAGE_METHODS,

12 Image_Specification_Attribute,

13 as_3_channels_image,

14 convert_bit_depth,

15 image_specification_OpenImageIO,

16 read_image,

17 read_image_Imageio,

18 read_image_OpenImageIO,

19 write_image,

20 write_image_Imageio,

21 write_image_OpenImageIO,

22)

23 from .luts import * # noqa: F403

24

25# isort: split

26

27 from .ctl import (

28 ctl_render,

29 process_image_ctl,

30 template_ctl_transform_float,

31 template_ctl_transform_float3,

32)

33 from .fichet2021 import (

34 ComponentsFichet2021,

35 Specification_Fichet2021,

36 read_spectral_image_Fichet2021,

37 sd_to_spectrum_attribute_Fichet2021,

38 spectrum_attribute_to_sd_Fichet2021,

39 write_spectral_image_Fichet2021,

40)

41 from .ocio import process_image_OpenColorIO

42 from .tabular import (

43 read_sds_from_csv_file,

44 read_spectral_data_from_csv_file,

45 write_sds_to_csv_file,

46)

47 from .tm2714 import Header_IESTM2714, SpectralDistribution_IESTM2714

48 from .uprtek_sekonic import (

49 SpectralDistribution_Sekonic,

50 SpectralDistribution_UPRTek,

51)

52 from .xrite import read_sds_from_xrite_file

53

54 __all__ = luts.__all__

55 __all__ += [

56 "MAPPING_BIT_DEPTH",

57 "READ_IMAGE_METHODS",

58 "WRITE_IMAGE_METHODS",

59 "Image_Specification_Attribute",

60 "as_3_channels_image",

61 "convert_bit_depth",

62 "image_specification_OpenImageIO",

63 "read_image",

64 "read_image_Imageio",

65 "read_image_OpenImageIO",

66 "write_image",

67 "write_image_Imageio",

68 "write_image_OpenImageIO",

69]

70 __all__ += [

71 "ctl_render",

72 "process_image_ctl",

73 "template_ctl_transform_float",

74 "template_ctl_transform_float3",

75]

76 __all__ += [

77 "ComponentsFichet2021",

78 "Specification_Fichet2021",

79 "read_spectral_image_Fichet2021",

80 "sd_to_spectrum_attribute_Fichet2021",

81 "spectrum_attribute_to_sd_Fichet2021",

82 "write_spectral_image_Fichet2021",

83]

84 __all__ += [

85 "process_image_OpenColorIO",

86]

87 __all__ += [

88 "read_sds_from_csv_file",

89 "read_spectral_data_from_csv_file",

90 "write_sds_to_csv_file",

91]

92 __all__ += [

93 "Header_IESTM2714",

94 "SpectralDistribution_IESTM2714",

95]

96 __all__ += [

97 "SpectralDistribution_Sekonic",

98 "SpectralDistribution_UPRTek",

99]

100 __all__ += [

101 "read_sds_from_xrite_file",

102]

103

104

105# ----------------------------------------------------------------------------#

106# --- API Changes and Deprecation Management ---#

107# ----------------------------------------------------------------------------#

108 class io(ModuleAPI):

109 """Define a class acting like the *io* module."""

110

111 def __getattr__(self, attribute: str) -> Any:

112 """Return the value from the attribute with the specified name."""

113

114 return super().__getattr__(attribute)

115

116

117# v0.4.5

118 API_CHANGES = {

119 "ObjectRenamed": [

120 [

121 "colour.io.ImageAttribute_Specification",

122 "colour.io.Image_Specification_Attribute",

123 ],

124 ]

125}

126

127"""Defines the *colour.io* sub-package API changes."""

128

129 if not is_documentation_building():

130 sys.modules["colour.io"] = io( # pyright: ignore

131 sys.modules["colour.io"], build_API_changes(API_CHANGES)

132 )

133

134 del ModuleAPI, is_documentation_building, build_API_changes, sys