code stringlengths 66 870k | docstring stringlengths 19 26.7k | func_name stringlengths 1 138 | language stringclasses 1
value | repo stringlengths 7 68 | path stringlengths 5 324 | url stringlengths 46 389 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
def test_convert(self) -> None:
"""Test :func:`colour.graph.conversion.convert` definition."""
RGB_a = convert(
SDS_COLOURCHECKERS["ColorChecker N Ohta"]["dark skin"],
"Spectral Distribution",
"sRGB",
)
np.testing.assert_allclose(
RGB_a,
... | Test :func:`colour.graph.conversion.convert` definition. | test_convert | python | colour-science/colour | colour/graph/tests/test_conversion.py | https://github.com/colour-science/colour/blob/master/colour/graph/tests/test_conversion.py | BSD-3-Clause |
def test_convert_direct_keyword_argument_passing(self) -> None:
"""
Test :func:`colour.graph.conversion.convert` definition behaviour when
direct keyword arguments are passed.
"""
a = np.array([0.20654008, 0.12197225, 0.05136952])
illuminant = CCS_ILLUMINANTS["CIE 1931 2... |
Test :func:`colour.graph.conversion.convert` definition behaviour when
direct keyword arguments are passed.
| test_convert_direct_keyword_argument_passing | python | colour-science/colour | colour/graph/tests/test_conversion.py | https://github.com/colour-science/colour/blob/master/colour/graph/tests/test_conversion.py | BSD-3-Clause |
def ctl_render(
path_input: str | PathLike,
path_output: str | PathLike,
ctl_transforms: Sequence[str] | Dict[str, Sequence[str]],
*args: Any,
**kwargs: Any,
) -> subprocess.CompletedProcess: # pragma: no cover
"""
Invoke *ctlrender* on the specified input image using the specified
*CTL... |
Invoke *ctlrender* on the specified input image using the specified
*CTL* transforms.
Parameters
----------
path_input
Input image path.
path_output
Output image path.
ctl_transforms
Sequence of *CTL* transforms to apply on the image, either paths to
existin... | ctl_render | python | colour-science/colour | colour/io/ctl.py | https://github.com/colour-science/colour/blob/master/colour/io/ctl.py | BSD-3-Clause |
def process_image_ctl(
a: ArrayLike,
ctl_transforms: Sequence[str] | Dict[str, Sequence[str]],
*args: Any,
**kwargs: Any,
) -> NDArrayFloat: # pragma: no cover
"""
Process the specified image data with *ctlrender* using the specified
*CTL* transforms.
Parameters
----------
a
... |
Process the specified image data with *ctlrender* using the specified
*CTL* transforms.
Parameters
----------
a
Image data to process with *ctlrender*.
ctl_transforms
Sequence of *CTL* transforms to apply on the image, either paths to
existing *CTL* transforms, multi-li... | process_image_ctl | python | colour-science/colour | colour/io/ctl.py | https://github.com/colour-science/colour/blob/master/colour/io/ctl.py | BSD-3-Clause |
def template_ctl_transform_float(
R_function: str,
G_function: str | None = None,
B_function: str | None = None,
description: str | None = None,
parameters: Sequence[str] | None = None,
imports: Sequence[str] | None = None,
header: str | None = None,
) -> str:
"""
Generate *CTL* tran... |
Generate *CTL* transform code for testing a function that processes
per-float channels.
Parameters
----------
R_function
Function call to process the *red* channel.
G_function
Function call to process the *green* channel.
B_function
Function call to process the *blu... | template_ctl_transform_float | python | colour-science/colour | colour/io/ctl.py | https://github.com/colour-science/colour/blob/master/colour/io/ctl.py | BSD-3-Clause |
def template_ctl_transform_float3(
RGB_function: str,
description: str | None = None,
parameters: Sequence[str] | None = None,
imports: Sequence[str] | None = None,
header: str | None = None,
) -> str:
"""
Generate *CTL* transform code for testing a function that processes
*RGB* channels... |
Generate *CTL* transform code for testing a function that processes
*RGB* channels.
Parameters
----------
RGB_function
Function call to process the *RGB* channels.
description
Description of the *CTL* transform.
parameters
List of parameters to use with the *CTL* tr... | template_ctl_transform_float3 | python | colour-science/colour | colour/io/ctl.py | https://github.com/colour-science/colour/blob/master/colour/io/ctl.py | BSD-3-Clause |
def match_groups_to_nm(
number: str,
multiplier: Literal[
"Y",
"Z",
"E",
"P",
"T",
"G",
"M",
"k",
"h",
"da",
"",
"d",
"c",
"m",
"u",
"n",
"p",
]
| str,
units: Liter... |
Convert wavelength or frequency match groups to nanometer values.
Parameters
----------
number
Wavelength (or frequency) number to convert.
multiplier
Unit multiplier.
units
Frequency or wavelength.
Returns
-------
:class:`float`
Nanometer value.
... | match_groups_to_nm | python | colour-science/colour | colour/io/fichet2021.py | https://github.com/colour-science/colour/blob/master/colour/io/fichet2021.py | BSD-3-Clause |
def sd_to_spectrum_attribute_Fichet2021(
sd: SpectralDistribution, decimals: int = 7
) -> str:
"""
Convert the specified spectral distribution to a spectrum attribute value
according to *Fichet et al. (2021)*.
Parameters
----------
sd
Spectral distribution to convert.
decimals
... |
Convert the specified spectral distribution to a spectrum attribute value
according to *Fichet et al. (2021)*.
Parameters
----------
sd
Spectral distribution to convert.
decimals
Formatting decimals.
Returns
-------
:class:`str`
Spectrum attribute value.
... | sd_to_spectrum_attribute_Fichet2021 | python | colour-science/colour | colour/io/fichet2021.py | https://github.com/colour-science/colour/blob/master/colour/io/fichet2021.py | BSD-3-Clause |
def spectrum_attribute_to_sd_Fichet2021(
spectrum_attribute: str,
) -> SpectralDistribution:
"""
Convert the specified spectrum attribute value to a spectral distribution
according to *Fichet et al. (2021)*.
Parameters
----------
spectrum_attribute
Spectrum attribute value to conver... |
Convert the specified spectrum attribute value to a spectral distribution
according to *Fichet et al. (2021)*.
Parameters
----------
spectrum_attribute
Spectrum attribute value to convert.
Returns
-------
:class:`SpectralDistribution`
Spectral distribution.
Refere... | spectrum_attribute_to_sd_Fichet2021 | python | colour-science/colour | colour/io/fichet2021.py | https://github.com/colour-science/colour/blob/master/colour/io/fichet2021.py | BSD-3-Clause |
def from_spectral_image(path: str | PathLike) -> Specification_Fichet2021:
"""
Create a *Fichet et al. (2021)* spectral image specification from the
specified image path.
Parameters
----------
path
Image path
Returns
-------
:class:`S... |
Create a *Fichet et al. (2021)* spectral image specification from the
specified image path.
Parameters
----------
path
Image path
Returns
-------
:class:`Specification_Fichet2021`
*Fichet et al. (2021)* spectral image specificati... | from_spectral_image | python | colour-science/colour | colour/io/fichet2021.py | https://github.com/colour-science/colour/blob/master/colour/io/fichet2021.py | BSD-3-Clause |
def read_spectral_image_Fichet2021(
path: str | PathLike,
bit_depth: Literal["float16", "float32"] = "float32",
additional_data: bool = False,
) -> ComponentsFichet2021 | Tuple[ComponentsFichet2021, Specification_Fichet2021]:
"""
Read the *Fichet et al. (2021)* spectral image at the specified path u... |
Read the *Fichet et al. (2021)* spectral image at the specified path using
*OpenImageIO*.
Parameters
----------
path
Image path.
bit_depth
Returned image bit-depth.
additional_data
Whether to return additional data.
Returns
-------
:class:`dict` or :cla... | read_spectral_image_Fichet2021 | python | colour-science/colour | colour/io/fichet2021.py | https://github.com/colour-science/colour/blob/master/colour/io/fichet2021.py | BSD-3-Clause |
def sds_and_msds_to_components_Fichet2021(
sds: Sequence[SpectralDistribution | MultiSpectralDistributions]
| SpectralDistribution
| MultiSpectralDistributions
| ValuesView,
specification: Specification_Fichet2021 = SPECIFICATION_FICHET2021_DEFAULT,
**kwargs: Any,
) -> ComponentsFichet2021:
... |
Convert the specified spectral and multi-spectral distributions to
*Fichet et al. (2021)* components.
The spectral and multi-spectral distributions will be aligned to the
intersection of their spectral shapes.
Parameters
----------
sds
Spectral and multi-spectral distributions to ... | sds_and_msds_to_components_Fichet2021 | python | colour-science/colour | colour/io/fichet2021.py | https://github.com/colour-science/colour/blob/master/colour/io/fichet2021.py | BSD-3-Clause |
def components_to_sRGB_Fichet2021(
components: ComponentsFichet2021,
specification: Specification_Fichet2021 = SPECIFICATION_FICHET2021_DEFAULT,
) -> Tuple[NDArrayFloat | None, Sequence[Image_Specification_Attribute]]:
"""
Convert the specified *Fichet et al. (2021)* components to *sRGB*
colourspace... |
Convert the specified *Fichet et al. (2021)* components to *sRGB*
colourspace values.
Parameters
----------
components
*Fichet et al. (2021)* components to convert.
specification
*Fichet et al. (2021)* spectral image specification, used to perform
the proper conversion ... | components_to_sRGB_Fichet2021 | python | colour-science/colour | colour/io/fichet2021.py | https://github.com/colour-science/colour/blob/master/colour/io/fichet2021.py | BSD-3-Clause |
def write_spectral_image_Fichet2021(
components: Sequence[SpectralDistribution | MultiSpectralDistributions]
| SpectralDistribution
| MultiSpectralDistributions
| ComponentsFichet2021
| ValuesView,
path: str | PathLike,
bit_depth: Literal["float16", "float32"] = "float32",
specification:... |
Write the specified *Fichet et al. (2021)* components to the specified
path using *OpenImageIO*.
Parameters
----------
components
*Fichet et al. (2021)* components.
path
Image path.
bit_depth
Bit-depth to write the image at, the bit-depth conversion behaviour
... | write_spectral_image_Fichet2021 | python | colour-science/colour | colour/io/fichet2021.py | https://github.com/colour-science/colour/blob/master/colour/io/fichet2021.py | BSD-3-Clause |
def add_attributes_to_image_specification_OpenImageIO(
image_specification: ImageSpec, attributes: Sequence
) -> ImageSpec:
"""
Add the specified attributes to the specified *OpenImageIO* image specification.
Parameters
----------
image_specification
*OpenImageIO* image specification.
... |
Add the specified attributes to the specified *OpenImageIO* image specification.
Parameters
----------
image_specification
*OpenImageIO* image specification.
attributes
An array of :class:`colour.io.Image_Specification_Attribute` class
instances used to set attributes of th... | add_attributes_to_image_specification_OpenImageIO | python | colour-science/colour | colour/io/image.py | https://github.com/colour-science/colour/blob/master/colour/io/image.py | BSD-3-Clause |
def image_specification_OpenImageIO(
width: int,
height: int,
channels: int,
bit_depth: Literal[
"uint8", "uint16", "float16", "float32", "float64", "float128"
] = "float32",
attributes: Sequence | None = None,
) -> ImageSpec:
"""
Create an *OpenImageIO* image specification.
... |
Create an *OpenImageIO* image specification.
Parameters
----------
width
Image width.
height
Image height.
channels
Image channel count.
bit_depth
Bit-depth to create the image with, the bit-depth conversion behaviour is
ruled directly by *OpenImageI... | image_specification_OpenImageIO | python | colour-science/colour | colour/io/image.py | https://github.com/colour-science/colour/blob/master/colour/io/image.py | BSD-3-Clause |
def convert_bit_depth(
a: ArrayLike,
bit_depth: Literal[
"uint8", "uint16", "float16", "float32", "float64", "float128"
] = "float32",
) -> NDArrayReal:
"""
Convert the specified array to the specified bit-depth, using the current
bit-depth of the array to determine the appropriate conve... |
Convert the specified array to the specified bit-depth, using the current
bit-depth of the array to determine the appropriate conversion path.
Parameters
----------
a
Array to convert to specified bit-depth.
bit_depth
Bit-depth.
Returns
-------
:class:`numpy.ndarra... | convert_bit_depth | python | colour-science/colour | colour/io/image.py | https://github.com/colour-science/colour/blob/master/colour/io/image.py | BSD-3-Clause |
def read_image_OpenImageIO(
path: str | PathLike,
bit_depth: Literal[
"uint8", "uint16", "float16", "float32", "float64", "float128"
] = "float32",
additional_data: bool = False,
**kwargs: Any,
) -> NDArrayReal | Tuple[NDArrayReal, Tuple[Image_Specification_Attribute, ...]]:
"""
Read... |
Read the image data at the specified path using *OpenImageIO*.
Parameters
----------
path
Image path.
bit_depth
Returned image bit-depth, the bit-depth conversion behaviour is driven
directly by *OpenImageIO*, this definition only converts to the
relevant data type ... | read_image_OpenImageIO | python | colour-science/colour | colour/io/image.py | https://github.com/colour-science/colour/blob/master/colour/io/image.py | BSD-3-Clause |
def read_image_Imageio(
path: str | PathLike,
bit_depth: Literal[
"uint8", "uint16", "float16", "float32", "float64", "float128"
] = "float32",
**kwargs: Any,
) -> NDArrayReal:
"""
Read the image data at the specified path using *Imageio*.
Parameters
----------
path
... |
Read the image data at the specified path using *Imageio*.
Parameters
----------
path
Image path.
bit_depth
Returned image bit-depth, the image data is converted with
:func:`colour.io.convert_bit_depth` definition after reading the
image.
Other Parameters
-... | read_image_Imageio | python | colour-science/colour | colour/io/image.py | https://github.com/colour-science/colour/blob/master/colour/io/image.py | BSD-3-Clause |
def read_image(
path: str | PathLike,
bit_depth: Literal[
"uint8", "uint16", "float16", "float32", "float64", "float128"
] = "float32",
method: Literal["Imageio", "OpenImageIO"] | str = "OpenImageIO",
**kwargs: Any,
) -> NDArrayReal:
"""
Read the image data at the specified path usin... |
Read the image data at the specified path using the specified method.
Parameters
----------
path
Image path.
bit_depth
Returned image bit-depth, for the *Imageio* method, the image data is
converted with :func:`colour.io.convert_bit_depth` definition after
reading t... | read_image | python | colour-science/colour | colour/io/image.py | https://github.com/colour-science/colour/blob/master/colour/io/image.py | BSD-3-Clause |
def write_image_OpenImageIO(
image: ArrayLike,
path: str | PathLike,
bit_depth: Literal[
"uint8", "uint16", "float16", "float32", "float64", "float128"
] = "float32",
attributes: Sequence | None = None,
) -> bool:
"""
Write the specified image data at the specified path using *OpenIm... |
Write the specified image data at the specified path using *OpenImageIO*.
Parameters
----------
image
Image data.
path
Image path.
bit_depth
Bit-depth to write the image at, the bit-depth conversion behaviour is
ruled directly by *OpenImageIO*.
attributes
... | write_image_OpenImageIO | python | colour-science/colour | colour/io/image.py | https://github.com/colour-science/colour/blob/master/colour/io/image.py | BSD-3-Clause |
def write_image_Imageio(
image: ArrayLike,
path: str | PathLike,
bit_depth: Literal[
"uint8", "uint16", "float16", "float32", "float64", "float128"
] = "float32",
**kwargs: Any,
) -> bytes | None:
"""
Write the specified image data at the specified path using *Imageio*.
Paramete... |
Write the specified image data at the specified path using *Imageio*.
Parameters
----------
image
Image data.
path
Image path.
bit_depth
Bit-depth to write the image at, the image data is converted with
:func:`colour.io.convert_bit_depth` definition prior to wri... | write_image_Imageio | python | colour-science/colour | colour/io/image.py | https://github.com/colour-science/colour/blob/master/colour/io/image.py | BSD-3-Clause |
def write_image(
image: ArrayLike,
path: str | PathLike,
bit_depth: Literal[
"uint8", "uint16", "float16", "float32", "float64", "float128"
] = "float32",
method: Literal["Imageio", "OpenImageIO"] | str = "OpenImageIO",
**kwargs: Any,
) -> bool:
"""
Write the specified image data... |
Write the specified image data at the specified path using the specified method.
Parameters
----------
image
Image data.
path
Image path.
bit_depth
Bit-depth to write the image at, for the *Imageio* method, the image
data is converted with :func:`colour.io.conve... | write_image | python | colour-science/colour | colour/io/image.py | https://github.com/colour-science/colour/blob/master/colour/io/image.py | BSD-3-Clause |
def as_3_channels_image(a: ArrayLike) -> NDArrayFloat:
"""
Convert the specified array :math:`a` to a 3-channels image-like
representation.
Parameters
----------
a
Array :math:`a` to convert to a 3-channels image-like
representation.
Returns
-------
:class:`numpy.... |
Convert the specified array :math:`a` to a 3-channels image-like
representation.
Parameters
----------
a
Array :math:`a` to convert to a 3-channels image-like
representation.
Returns
-------
:class:`numpy.ndarray`
3-channels image-like representation of array... | as_3_channels_image | python | colour-science/colour | colour/io/image.py | https://github.com/colour-science/colour/blob/master/colour/io/image.py | BSD-3-Clause |
def process_image_OpenColorIO(a: ArrayLike, *args: Any, **kwargs: Any) -> NDArrayFloat:
"""
Process the specified image data with *OpenColorIO*.
Parameters
----------
a
Image data to process with *OpenColorIO*.
Other Parameters
----------------
config
*OpenColorIO* conf... |
Process the specified image data with *OpenColorIO*.
Parameters
----------
a
Image data to process with *OpenColorIO*.
Other Parameters
----------------
config
*OpenColorIO* config to use for processing. If not defined, the
*OpenColorIO* set defined by the ``$OCIO`... | process_image_OpenColorIO | python | colour-science/colour | colour/io/ocio.py | https://github.com/colour-science/colour/blob/master/colour/io/ocio.py | BSD-3-Clause |
def read_spectral_data_from_csv_file(
path: str | PathLike, **kwargs: Any
) -> Dict[str, NDArrayFloat]:
"""
Read spectral data from the specified *CSV* file in the following form::
390, 4.15003e-04, 3.68349e-04, 9.54729e-03
395, 1.05192e-03, 9.58658e-04, 2.38250e-02
400, 2.40836e-03... |
Read spectral data from the specified *CSV* file in the following form::
390, 4.15003e-04, 3.68349e-04, 9.54729e-03
395, 1.05192e-03, 9.58658e-04, 2.38250e-02
400, 2.40836e-03, 2.26991e-03, 5.66498e-02
...
830, 9.74306e-07, 9.53411e-08, 0.00000
and convert it to a *dic... | read_spectral_data_from_csv_file | python | colour-science/colour | colour/io/tabular.py | https://github.com/colour-science/colour/blob/master/colour/io/tabular.py | BSD-3-Clause |
def read_sds_from_csv_file(
path: str | PathLike, **kwargs: Any
) -> Dict[str, SpectralDistribution]:
"""
Read spectral data from the specified *CSV* file and convert its content to a
*dict* of :class:`colour.SpectralDistribution` class instances.
Parameters
----------
path
*CSV* fi... |
Read spectral data from the specified *CSV* file and convert its content to a
*dict* of :class:`colour.SpectralDistribution` class instances.
Parameters
----------
path
*CSV* file path.
Other Parameters
----------------
kwargs
Keywords arguments passed to :func:`numpy.... | read_sds_from_csv_file | python | colour-science/colour | colour/io/tabular.py | https://github.com/colour-science/colour/blob/master/colour/io/tabular.py | BSD-3-Clause |
def write_sds_to_csv_file(
sds: Dict[str, SpectralDistribution], path: str | PathLike
) -> bool:
"""
Write the specified spectral distributions to the specified *CSV* file.
Parameters
----------
sds
Spectral distributions to write to specified *CSV* file.
path
*CSV* file pat... |
Write the specified spectral distributions to the specified *CSV* file.
Parameters
----------
sds
Spectral distributions to write to specified *CSV* file.
path
*CSV* file path.
Returns
-------
:class:`bool`
Definition success.
Raises
------
ValueEr... | write_sds_to_csv_file | python | colour-science/colour | colour/io/tabular.py | https://github.com/colour-science/colour/blob/master/colour/io/tabular.py | BSD-3-Clause |
def manufacturer(self, value: str | None) -> None:
"""Setter for the **self.manufacturer** property."""
if value is not None:
attest(
isinstance(value, str),
f'"manufacturer" property: "{value}" type is not "str"!',
)
self._manufacturer =... | Setter for the **self.manufacturer** property. | manufacturer | python | colour-science/colour | colour/io/tm2714.py | https://github.com/colour-science/colour/blob/master/colour/io/tm2714.py | BSD-3-Clause |
def description(self, value: str | None) -> None:
"""Setter for the **self.description** property."""
if value is not None:
attest(
isinstance(value, str),
f'"description" property: "{value}" type is not "str"!',
)
self._description = val... | Setter for the **self.description** property. | description | python | colour-science/colour | colour/io/tm2714.py | https://github.com/colour-science/colour/blob/master/colour/io/tm2714.py | BSD-3-Clause |
def comments(self, value: str | None) -> None:
"""Setter for the **self.comments** property."""
if value is not None:
attest(
isinstance(value, str),
f'"comments" property: "{value}" type is not "str"!',
)
self._comments = value | Setter for the **self.comments** property. | comments | python | colour-science/colour | colour/io/tm2714.py | https://github.com/colour-science/colour/blob/master/colour/io/tm2714.py | BSD-3-Clause |
def __str__(self) -> str:
"""
Return a formatted string representation of the header.
Returns
-------
:class:`str`
Formatted string representation.
Examples
--------
>>> print(Header_IESTM2714("colour-science"))
Manufacturer ... |
Return a formatted string representation of the header.
Returns
-------
:class:`str`
Formatted string representation.
Examples
--------
>>> print(Header_IESTM2714("colour-science"))
Manufacturer : colour-science
Catalog Num... | __str__ | python | colour-science/colour | colour/io/tm2714.py | https://github.com/colour-science/colour/blob/master/colour/io/tm2714.py | BSD-3-Clause |
def __repr__(self) -> str:
"""
Generate an evaluable string representation of the header.
Returns
-------
:class:`str`
Evaluable string representation.
Examples
--------
>>> Header_IESTM2714("colour-science")
Header_IESTM2714('colour-... |
Generate an evaluable string representation of the header.
Returns
-------
:class:`str`
Evaluable string representation.
Examples
--------
>>> Header_IESTM2714("colour-science")
Header_IESTM2714('colour-science',
Non... | __repr__ | python | colour-science/colour | colour/io/tm2714.py | https://github.com/colour-science/colour/blob/master/colour/io/tm2714.py | BSD-3-Clause |
def __hash__(self) -> int:
"""
Generate the header hash.
Returns
-------
:class:`int`
Object hash.
"""
return hash(
(
self._manufacturer,
self._catalog_number,
self._description,
... |
Generate the header hash.
Returns
-------
:class:`int`
Object hash.
| __hash__ | python | colour-science/colour | colour/io/tm2714.py | https://github.com/colour-science/colour/blob/master/colour/io/tm2714.py | BSD-3-Clause |
def __eq__(self, other: object) -> bool:
"""
Determine whether the header is equal to specified other object.
Parameters
----------
other
Object to test whether it is equal to the header.
Returns
-------
:class:`bool`
Whether spec... |
Determine whether the header is equal to specified other object.
Parameters
----------
other
Object to test whether it is equal to the header.
Returns
-------
:class:`bool`
Whether specified object is equal to the header.
Exampl... | __eq__ | python | colour-science/colour | colour/io/tm2714.py | https://github.com/colour-science/colour/blob/master/colour/io/tm2714.py | BSD-3-Clause |
def path(self, value: str | PathLike | None) -> None:
"""Setter for the **self.path** property."""
if value is not None:
attest(
isinstance(value, (str, Path)),
f'"path" property: "{value}" type is not "str" or "Path"!',
)
value = str... | Setter for the **self.path** property. | path | python | colour-science/colour | colour/io/tm2714.py | https://github.com/colour-science/colour/blob/master/colour/io/tm2714.py | BSD-3-Clause |
def header(self, value: Header_IESTM2714) -> None:
"""Setter for the **self.header** property."""
attest(
isinstance(value, Header_IESTM2714),
f'"header" property: "{value}" type is not "Header_IESTM2714"!',
)
self._header = value | Setter for the **self.header** property. | header | python | colour-science/colour | colour/io/tm2714.py | https://github.com/colour-science/colour/blob/master/colour/io/tm2714.py | BSD-3-Clause |
def spectral_quantity(
self,
) -> (
Literal[
"absorptance",
"exitance",
"flux",
"intensity",
"irradiance",
"radiance",
"reflectance",
"relative",
"transmittance",
"R-Factor",
... |
Getter and setter property for the spectral quantity.
Parameters
----------
value
Value to set the spectral quantity with.
Returns
-------
:class:`str` or :py:data:`None`
Spectral quantity.
| spectral_quantity | python | colour-science/colour | colour/io/tm2714.py | https://github.com/colour-science/colour/blob/master/colour/io/tm2714.py | BSD-3-Clause |
def reflection_geometry(
self,
) -> (
Literal[
"di:8",
"de:8",
"8:di",
"8:de",
"d:d",
"d:0",
"45a:0",
"45c:0",
"0:45a",
"45x:0",
"0:45x",
"other",
]... |
Getter and setter property for the reflection geometry.
Parameters
----------
value
Value to set the reflection geometry with.
Returns
-------
:class:`str` or :py:data:`None`
Reflection geometry.
| reflection_geometry | python | colour-science/colour | colour/io/tm2714.py | https://github.com/colour-science/colour/blob/master/colour/io/tm2714.py | BSD-3-Clause |
def transmission_geometry(
self,
) -> Literal["0:0", "di:0", "de:0", "0:di", "0:de", "d:d", "other"] | None:
"""
Getter and setter property for the transmission geometry.
Parameters
----------
value
Value to set the transmission geometry with.
Re... |
Getter and setter property for the transmission geometry.
Parameters
----------
value
Value to set the transmission geometry with.
Returns
-------
:class:`str` or :py:data:`None`
Transmission geometry.
| transmission_geometry | python | colour-science/colour | colour/io/tm2714.py | https://github.com/colour-science/colour/blob/master/colour/io/tm2714.py | BSD-3-Clause |
def __str__(self) -> str:
"""
Return a formatted string representation of the *IES TM-27-14*
spectral distribution.
Returns
-------
:class:`str`
Formatted string representation.
Examples
--------
>>> from os.path import dirname, join
... |
Return a formatted string representation of the *IES TM-27-14*
spectral distribution.
Returns
-------
:class:`str`
Formatted string representation.
Examples
--------
>>> from os.path import dirname, join
>>> directory = join(dirname(... | __str__ | python | colour-science/colour | colour/io/tm2714.py | https://github.com/colour-science/colour/blob/master/colour/io/tm2714.py | BSD-3-Clause |
def __repr__(self) -> str:
"""
Generate an evaluable string representation of the *IES TM-27-14*
spectral distribution.
Returns
-------
:class:`str`
Evaluable string representation.
Examples
--------
>>> from os.path import dirname, j... |
Generate an evaluable string representation of the *IES TM-27-14*
spectral distribution.
Returns
-------
:class:`str`
Evaluable string representation.
Examples
--------
>>> from os.path import dirname, join
>>> directory = join(dirna... | __repr__ | python | colour-science/colour | colour/io/tm2714.py | https://github.com/colour-science/colour/blob/master/colour/io/tm2714.py | BSD-3-Clause |
def read(self) -> SpectralDistribution_IESTM2714:
"""
Read and parse the spectral data from the *XML* file path.
Returns
-------
:class:`colour.SpectralDistribution_IESTM2714`
*IES TM-27-14* spectral distribution.
Raises
------
ValueError
... |
Read and parse the spectral data from the *XML* file path.
Returns
-------
:class:`colour.SpectralDistribution_IESTM2714`
*IES TM-27-14* spectral distribution.
Raises
------
ValueError
If the *IES TM-27-14* spectral distribution path is ... | read | python | colour-science/colour | colour/io/tm2714.py | https://github.com/colour-science/colour/blob/master/colour/io/tm2714.py | BSD-3-Clause |
def write(self) -> bool:
"""
Write the spectral distribution spectral data to the *XML* file path.
Returns
-------
:class:`bool`
Definition success.
Raises
------
ValueError
If the *IES TM-27-14* spectral distribution path is unde... |
Write the spectral distribution spectral data to the *XML* file path.
Returns
-------
:class:`bool`
Definition success.
Raises
------
ValueError
If the *IES TM-27-14* spectral distribution path is undefined.
Examples
---... | write | python | colour-science/colour | colour/io/tm2714.py | https://github.com/colour-science/colour/blob/master/colour/io/tm2714.py | BSD-3-Clause |
def __str__(self) -> str:
"""
Generate formatted string representation of the *UPRTek* spectral
distribution.
Returns
-------
:class:`str`
Formatted string representation.
Examples
--------
>>> from os.path import dirname, join
... |
Generate formatted string representation of the *UPRTek* spectral
distribution.
Returns
-------
:class:`str`
Formatted string representation.
Examples
--------
>>> from os.path import dirname, join
>>> from colour import SpectralShap... | __str__ | python | colour-science/colour | colour/io/uprtek_sekonic.py | https://github.com/colour-science/colour/blob/master/colour/io/uprtek_sekonic.py | BSD-3-Clause |
def read(self) -> SpectralDistribution_UPRTek:
"""
Read and parse the spectral data from a specified *UPRTek* *CSV* file.
Returns
-------
:class:`colour.SpectralDistribution_UPRTek`
*UPRTek* spectral distribution.
Raises
------
IOError
... |
Read and parse the spectral data from a specified *UPRTek* *CSV* file.
Returns
-------
:class:`colour.SpectralDistribution_UPRTek`
*UPRTek* spectral distribution.
Raises
------
IOError
If the file cannot be read.
Examples
... | read | python | colour-science/colour | colour/io/uprtek_sekonic.py | https://github.com/colour-science/colour/blob/master/colour/io/uprtek_sekonic.py | BSD-3-Clause |
def __str__(self) -> str:
"""
Generate formatted string representation of the *Sekonic* spectral
distribution.
Returns
-------
:class:`str`
Formatted string representation.
Examples
--------
>>> from os.path import dirname, join
... |
Generate formatted string representation of the *Sekonic* spectral
distribution.
Returns
-------
:class:`str`
Formatted string representation.
Examples
--------
>>> from os.path import dirname, join
>>> from colour import SpectralSha... | __str__ | python | colour-science/colour | colour/io/uprtek_sekonic.py | https://github.com/colour-science/colour/blob/master/colour/io/uprtek_sekonic.py | BSD-3-Clause |
def read(self) -> SpectralDistribution_Sekonic:
"""
Read and parse the spectral data from a specified *Sekonic* *Pseudo-XLS*
file.
Returns
-------
:class:`colour.SpectralDistribution_Sekonic`
*Sekonic* spectral distribution.
Raises
------
... |
Read and parse the spectral data from a specified *Sekonic* *Pseudo-XLS*
file.
Returns
-------
:class:`colour.SpectralDistribution_Sekonic`
*Sekonic* spectral distribution.
Raises
------
IOError
If the file cannot be read.
... | read | python | colour-science/colour | colour/io/uprtek_sekonic.py | https://github.com/colour-science/colour/blob/master/colour/io/uprtek_sekonic.py | BSD-3-Clause |
def read_sds_from_xrite_file(
path: str | PathLike,
) -> Dict[str, SpectralDistribution]:
"""
Read spectral data from the specified *X-Rite* file and convert it to a
*dict* of :class:`colour.SpectralDistribution` class instances.
Parameters
----------
path
Absolute *X-Rite* file pat... |
Read spectral data from the specified *X-Rite* file and convert it to a
*dict* of :class:`colour.SpectralDistribution` class instances.
Parameters
----------
path
Absolute *X-Rite* file path.
Returns
-------
:class:`dict`
*dict* of :class:`colour.SpectralDistribution` ... | read_sds_from_xrite_file | python | colour-science/colour | colour/io/xrite.py | https://github.com/colour-science/colour/blob/master/colour/io/xrite.py | BSD-3-Clause |
def read_LUT_Cinespace(path: str | PathLike) -> LUT3x1D | LUT3D | LUTSequence:
"""
Read the specified *Cinespace* *.csp* *LUT* file.
Parameters
----------
path
*LUT* path.
Returns
-------
:class:`colour.LUT3x1D` or :class:`colour.LUT3D` or \
:class:`colour.LUTSequence`
... |
Read the specified *Cinespace* *.csp* *LUT* file.
Parameters
----------
path
*LUT* path.
Returns
-------
:class:`colour.LUT3x1D` or :class:`colour.LUT3D` or :class:`colour.LUTSequence`
:class:`LUT3x1D` or :class:`LUT3D` or :class:`LUTSequence` class
instance.
... | read_LUT_Cinespace | python | colour-science/colour | colour/io/luts/cinespace_csp.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/cinespace_csp.py | BSD-3-Clause |
def _parse_domain_section(lines: List[str]) -> NDArrayFloat:
"""Parse the domain at specified lines."""
pre_LUT_size = max(int(lines[i]) for i in [0, 3, 6])
pre_LUT = [as_float_array(lines[i].split()) for i in [1, 2, 4, 5, 7, 8]]
pre_LUT_padded = []
for array in pre_LUT:
... | Parse the domain at specified lines. | _parse_domain_section | python | colour-science/colour | colour/io/luts/cinespace_csp.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/cinespace_csp.py | BSD-3-Clause |
def _parse_table_section(lines: list[str]) -> tuple[NDArrayInt, NDArrayFloat]:
"""Parse the table at specified lines."""
size = as_int_array(lines[0].split())
table = as_float_array([line.split() for line in lines[1:]])
return size, table | Parse the table at specified lines. | _parse_table_section | python | colour-science/colour | colour/io/luts/cinespace_csp.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/cinespace_csp.py | BSD-3-Clause |
def write_LUT_Cinespace(
LUT: LUT1D | LUT3x1D | LUT3D | LUTSequence, path: str | PathLike, decimals: int = 7
) -> bool:
"""
Write the specified *LUT* to the specified *Cinespace* *.csp* *LUT* file.
Parameters
----------
LUT
:class:`LUT1D`, :class:`LUT3x1D` or :class:`LUT3D` or
:... |
Write the specified *LUT* to the specified *Cinespace* *.csp* *LUT* file.
Parameters
----------
LUT
:class:`LUT1D`, :class:`LUT3x1D` or :class:`LUT3D` or
:class:`LUTSequence` class instance to write at specified path.
path
*LUT* path.
decimals
Formatting decimal... | write_LUT_Cinespace | python | colour-science/colour | colour/io/luts/cinespace_csp.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/cinespace_csp.py | BSD-3-Clause |
def _ragged_size(table: ArrayLike) -> list:
"""Return the ragged size of specified table."""
R, G, B = tsplit(table)
R_len = R.shape[-1] - np.sum(np.isnan(R))
G_len = G.shape[-1] - np.sum(np.isnan(G))
B_len = B.shape[-1] - np.sum(np.isnan(B))
return [R_len, G_len, B_le... | Return the ragged size of specified table. | _ragged_size | python | colour-science/colour | colour/io/luts/cinespace_csp.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/cinespace_csp.py | BSD-3-Clause |
def path_to_title(path: str | PathLike) -> str:
"""
Convert the specified file path to a title.
Parameters
----------
path
File path to convert to title.
Returns
-------
:class:`str`
File path converted to title.
Examples
--------
>>> path_to_title("colour/... |
Convert the specified file path to a title.
Parameters
----------
path
File path to convert to title.
Returns
-------
:class:`str`
File path converted to title.
Examples
--------
>>> path_to_title("colour/io/luts/tests/resources/sony_spi3d/Colour_Correct.spi3d... | path_to_title | python | colour-science/colour | colour/io/luts/common.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/common.py | BSD-3-Clause |
def read_LUT_IridasCube(path: str | PathLike) -> LUT3x1D | LUT3D:
"""
Read the specified *Iridas* *.cube* *LUT* file.
Parameters
----------
path
*LUT* path.
Returns
-------
:class:`LUT3x1D` or :class:`LUT3D`
:class:`LUT3x1D` or :class:`LUT3D` class instance.
Refere... |
Read the specified *Iridas* *.cube* *LUT* file.
Parameters
----------
path
*LUT* path.
Returns
-------
:class:`LUT3x1D` or :class:`LUT3D`
:class:`LUT3x1D` or :class:`LUT3D` class instance.
References
----------
:cite:`AdobeSystems2013b`
Examples
-----... | read_LUT_IridasCube | python | colour-science/colour | colour/io/luts/iridas_cube.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/iridas_cube.py | BSD-3-Clause |
def write_LUT_IridasCube(
LUT: LUT1D | LUT3x1D | LUT3D | LUTSequence, path: str | PathLike, decimals: int = 7
) -> bool:
"""
Write the specified *LUT* to the specified *Iridas* *.cube* *LUT* file.
Parameters
----------
LUT
:class:`LUT1D`, :class:`LUT3x1D`, :class:`LUT3D` or :class:`LUTS... |
Write the specified *LUT* to the specified *Iridas* *.cube* *LUT* file.
Parameters
----------
LUT
:class:`LUT1D`, :class:`LUT3x1D`, :class:`LUT3D` or :class:`LUTSequence`
class instance to write at specified path.
path
*LUT* path.
decimals
Formatting decimals.
... | write_LUT_IridasCube | python | colour-science/colour | colour/io/luts/iridas_cube.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/iridas_cube.py | BSD-3-Clause |
def __str__(self) -> str:
"""
Return a formatted string representation of the *LUT*.
Returns
-------
:class:`str`
Formatted string representation.
"""
attributes = [
{
"formatter": lambda x: ( # noqa: ARG005
... |
Return a formatted string representation of the *LUT*.
Returns
-------
:class:`str`
Formatted string representation.
| __str__ | python | colour-science/colour | colour/io/luts/lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/lut.py | BSD-3-Clause |
def __repr__(self) -> str:
"""
Return an evaluable string representation of the *LUT*.
Returns
-------
:class:`str`
Evaluable string representation.
"""
attributes = [
{"name": "table"},
{"name": "name"},
{"name": ... |
Return an evaluable string representation of the *LUT*.
Returns
-------
:class:`str`
Evaluable string representation.
| __repr__ | python | colour-science/colour | colour/io/luts/lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/lut.py | BSD-3-Clause |
def __eq__(self, other: object) -> bool:
"""
Return whether the *LUT* is equal to specified other object.
Parameters
----------
other
Object to test whether it is equal to the *LUT*.
Returns
-------
:class:`bool`
Whether specified... |
Return whether the *LUT* is equal to specified other object.
Parameters
----------
other
Object to test whether it is equal to the *LUT*.
Returns
-------
:class:`bool`
Whether specified object is equal to the *LUT*.
| __eq__ | python | colour-science/colour | colour/io/luts/lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/lut.py | BSD-3-Clause |
def arithmetical_operation(
self,
a: ArrayLike | AbstractLUT,
operation: Literal["+", "-", "*", "/", "**"],
in_place: bool = False,
) -> Self:
"""
Perform specified arithmetical operation with :math:`a` operand, the
operation can be either performed on a copy ... |
Perform specified arithmetical operation with :math:`a` operand, the
operation can be either performed on a copy or in-place, must be
reimplemented by sub-classes.
Parameters
----------
a
Operand.
operation
Operation to perform.
i... | arithmetical_operation | python | colour-science/colour | colour/io/luts/lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/lut.py | BSD-3-Clause |
def _validate_table(self, table: ArrayLike) -> NDArrayFloat:
"""
Validate specified table according to *LUT* dimensions.
Parameters
----------
table
Table to validate.
Returns
-------
:class:`numpy.ndarray`
Validated table as a :c... |
Validate specified table according to *LUT* dimensions.
Parameters
----------
table
Table to validate.
Returns
-------
:class:`numpy.ndarray`
Validated table as a :class:`ndarray` instance.
| _validate_table | python | colour-science/colour | colour/io/luts/lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/lut.py | BSD-3-Clause |
def _validate_domain(self, domain: ArrayLike) -> NDArrayFloat:
"""
Validate specified domain according to *LUT* dimensions.
Parameters
----------
domain
Domain to validate.
Returns
-------
:class:`numpy.ndarray`
Validated domain a... |
Validate specified domain according to *LUT* dimensions.
Parameters
----------
domain
Domain to validate.
Returns
-------
:class:`numpy.ndarray`
Validated domain as a :class:`ndarray` instance.
| _validate_domain | python | colour-science/colour | colour/io/luts/lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/lut.py | BSD-3-Clause |
def is_domain_explicit(self) -> bool:
"""
Return whether the *LUT* domain is explicit (or implicit).
An implicit domain is defined by its shape only::
[[0 1]
[0 1]
[0 1]]
While an explicit domain defines every single discrete samples::
... |
Return whether the *LUT* domain is explicit (or implicit).
An implicit domain is defined by its shape only::
[[0 1]
[0 1]
[0 1]]
While an explicit domain defines every single discrete samples::
[[0.0 0.0 0.0]
[0.1 0.1 0.1]
... | is_domain_explicit | python | colour-science/colour | colour/io/luts/lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/lut.py | BSD-3-Clause |
def linear_table(
size: ArrayLike | None = None,
domain: ArrayLike | None = None,
) -> NDArrayFloat:
"""
Return a linear table of specified size according to *LUT* dimensions.
Parameters
----------
size
Expected table size, for a 1D *LUT*, the num... |
Return a linear table of specified size according to *LUT* dimensions.
Parameters
----------
size
Expected table size, for a 1D *LUT*, the number of output samples
:math:`n` is equal to ``size``, for a 3x1D *LUT* :math:`n` is equal
to ``size * 3`` or... | linear_table | python | colour-science/colour | colour/io/luts/lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/lut.py | BSD-3-Clause |
def invert(self, **kwargs: Any) -> AbstractLUT:
"""
Compute and return an inverse copy of the *LUT*.
Other Parameters
----------------
kwargs
Keywords arguments.
Returns
-------
:class:`colour.io.luts.lut.AbstractLUT`
Inverse *LUT... |
Compute and return an inverse copy of the *LUT*.
Other Parameters
----------------
kwargs
Keywords arguments.
Returns
-------
:class:`colour.io.luts.lut.AbstractLUT`
Inverse *LUT* class instance.
| invert | python | colour-science/colour | colour/io/luts/lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/lut.py | BSD-3-Clause |
def apply(self, RGB: ArrayLike, **kwargs: Any) -> NDArrayFloat:
"""
Apply the *LUT* to specified *RGB* colourspace array using specified method.
Parameters
----------
RGB
*RGB* colourspace array to apply the *LUT* onto.
Other Parameters
-------------... |
Apply the *LUT* to specified *RGB* colourspace array using specified method.
Parameters
----------
RGB
*RGB* colourspace array to apply the *LUT* onto.
Other Parameters
----------------
direction
Whether the *LUT* should be applied in th... | apply | python | colour-science/colour | colour/io/luts/lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/lut.py | BSD-3-Clause |
def convert(
self,
cls: Type[AbstractLUT],
force_conversion: bool = False,
**kwargs: Any,
) -> AbstractLUT:
"""
Convert the *LUT* to specified ``cls`` class instance.
Parameters
----------
cls
*LUT* class instance.
force_co... |
Convert the *LUT* to specified ``cls`` class instance.
Parameters
----------
cls
*LUT* class instance.
force_conversion
Whether to force the conversion as it might be destructive.
Other Parameters
----------------
interpolator
... | convert | python | colour-science/colour | colour/io/luts/lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/lut.py | BSD-3-Clause |
def _validate_table(self, table: ArrayLike) -> NDArrayFloat:
"""
Validate specified table is a 1D array.
Parameters
----------
table
Table to validate.
Returns
-------
:class:`numpy.ndarray`
Validated table as a :class:`ndarray` i... |
Validate specified table is a 1D array.
Parameters
----------
table
Table to validate.
Returns
-------
:class:`numpy.ndarray`
Validated table as a :class:`ndarray` instance.
| _validate_table | python | colour-science/colour | colour/io/luts/lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/lut.py | BSD-3-Clause |
def _validate_domain(self, domain: ArrayLike) -> NDArrayFloat:
"""
Validate specified domain.
Parameters
----------
domain
Domain to validate.
Returns
-------
:class:`numpy.ndarray`
Validated domain as a :class:`ndarray` instance.... |
Validate specified domain.
Parameters
----------
domain
Domain to validate.
Returns
-------
:class:`numpy.ndarray`
Validated domain as a :class:`ndarray` instance.
| _validate_domain | python | colour-science/colour | colour/io/luts/lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/lut.py | BSD-3-Clause |
def linear_table(
size: ArrayLike | None = None,
domain: ArrayLike | None = None,
) -> NDArrayFloat:
"""
Return a linear table, the number of output samples :math:`n` is equal
to ``size``.
Parameters
----------
size
Expected table size, de... |
Return a linear table, the number of output samples :math:`n` is equal
to ``size``.
Parameters
----------
size
Expected table size, default to 10.
domain
Domain of the table.
Returns
-------
:class:`numpy.ndarray`
... | linear_table | python | colour-science/colour | colour/io/luts/lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/lut.py | BSD-3-Clause |
def invert(self, **kwargs: Any) -> LUT1D: # noqa: ARG002
"""
Compute and return an inverse copy of the *LUT*.
Other Parameters
----------------
kwargs
Keywords arguments, only specified for signature compatibility with
the :meth:`AbstractLUT.invert` meth... |
Compute and return an inverse copy of the *LUT*.
Other Parameters
----------------
kwargs
Keywords arguments, only specified for signature compatibility with
the :meth:`AbstractLUT.invert` method.
Returns
-------
:class:`colour.LUT1D`
... | invert | python | colour-science/colour | colour/io/luts/lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/lut.py | BSD-3-Clause |
def apply(self, RGB: ArrayLike, **kwargs: Any) -> NDArrayFloat:
"""
Apply the *LUT* to specified *RGB* colourspace array using specified method.
Parameters
----------
RGB
*RGB* colourspace array to apply the *LUT* onto.
Other Parameters
-------------... |
Apply the *LUT* to specified *RGB* colourspace array using specified method.
Parameters
----------
RGB
*RGB* colourspace array to apply the *LUT* onto.
Other Parameters
----------------
direction
Whether the *LUT* should be applied in th... | apply | python | colour-science/colour | colour/io/luts/lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/lut.py | BSD-3-Clause |
def _validate_table(self, table: ArrayLike) -> NDArrayFloat:
"""
Validate specified table is a 3x1D array.
Parameters
----------
table
Table to validate.
Returns
-------
:class:`numpy.ndarray`
Validated table as a :class:`ndarray`... |
Validate specified table is a 3x1D array.
Parameters
----------
table
Table to validate.
Returns
-------
:class:`numpy.ndarray`
Validated table as a :class:`ndarray` instance.
| _validate_table | python | colour-science/colour | colour/io/luts/lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/lut.py | BSD-3-Clause |
def linear_table(
size: ArrayLike | None = None,
domain: ArrayLike | None = None,
) -> NDArrayFloat:
"""
Return a linear table, the number of output samples :math:`n` is equal
to ``size * 3`` or ``size[0] + size[1] + size[2]``.
Parameters
----------
s... |
Return a linear table, the number of output samples :math:`n` is equal
to ``size * 3`` or ``size[0] + size[1] + size[2]``.
Parameters
----------
size
Expected table size, default to 10.
domain
Domain of the table.
Returns
-------... | linear_table | python | colour-science/colour | colour/io/luts/lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/lut.py | BSD-3-Clause |
def invert(self, **kwargs: Any) -> LUT3x1D: # noqa: ARG002
"""
Compute and return an inverse copy of the *LUT*.
Other Parameters
----------------
kwargs
Keywords arguments, only specified for signature compatibility with
the :meth:`AbstractLUT.invert` me... |
Compute and return an inverse copy of the *LUT*.
Other Parameters
----------------
kwargs
Keywords arguments, only specified for signature compatibility with
the :meth:`AbstractLUT.invert` method.
Returns
-------
:class:`colour.LUT3x1D`
... | invert | python | colour-science/colour | colour/io/luts/lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/lut.py | BSD-3-Clause |
def apply(self, RGB: ArrayLike, **kwargs: Any) -> NDArrayFloat:
"""
Apply the *LUT* to specified *RGB* colourspace array using specified method.
Parameters
----------
RGB
*RGB* colourspace array to apply the *LUT* onto.
Other Parameters
-------------... |
Apply the *LUT* to specified *RGB* colourspace array using specified method.
Parameters
----------
RGB
*RGB* colourspace array to apply the *LUT* onto.
Other Parameters
----------------
direction
Whether the *LUT* should be applied in th... | apply | python | colour-science/colour | colour/io/luts/lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/lut.py | BSD-3-Clause |
def _validate_table(self, table: ArrayLike) -> NDArrayFloat:
"""
Validate specified table is a 4D array and that its dimensions are equal.
Parameters
----------
table
Table to validate.
Returns
-------
:class:`numpy.ndarray`
Valid... |
Validate specified table is a 4D array and that its dimensions are equal.
Parameters
----------
table
Table to validate.
Returns
-------
:class:`numpy.ndarray`
Validated table as a :class:`ndarray` instance.
| _validate_table | python | colour-science/colour | colour/io/luts/lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/lut.py | BSD-3-Clause |
def _validate_domain(self, domain: ArrayLike) -> NDArrayFloat:
"""
Validate specified domain.
Parameters
----------
domain
Domain to validate.
Returns
-------
:class:`numpy.ndarray`
Validated domain as a :class:`ndarray` instance.... |
Validate specified domain.
Parameters
----------
domain
Domain to validate.
Returns
-------
:class:`numpy.ndarray`
Validated domain as a :class:`ndarray` instance.
Notes
-----
- A :class:`LUT3D` class instance ... | _validate_domain | python | colour-science/colour | colour/io/luts/lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/lut.py | BSD-3-Clause |
def linear_table(
size: ArrayLike | None = None,
domain: ArrayLike | None = None,
) -> NDArrayFloat:
"""
Return a linear table, the number of output samples :math:`n` is equal
to ``size**3 * 3`` or ``size[0] * size[1] * size[2] * 3``.
Parameters
----------
... |
Return a linear table, the number of output samples :math:`n` is equal
to ``size**3 * 3`` or ``size[0] * size[1] * size[2] * 3``.
Parameters
----------
size
Expected table size, default to 33.
domain
Domain of the table.
Returns
... | linear_table | python | colour-science/colour | colour/io/luts/lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/lut.py | BSD-3-Clause |
def invert(self, **kwargs: Any) -> LUT3D:
"""
Compute and return an inverse copy of the *LUT*.
Other Parameters
----------------
extrapolate
Whether to extrapolate the *LUT* when computing its inverse.
Extrapolation is performed by reflecting the *LUT* cu... |
Compute and return an inverse copy of the *LUT*.
Other Parameters
----------------
extrapolate
Whether to extrapolate the *LUT* when computing its inverse.
Extrapolation is performed by reflecting the *LUT* cube along its 8
faces. Note that the domai... | invert | python | colour-science/colour | colour/io/luts/lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/lut.py | BSD-3-Clause |
def apply(self, RGB: ArrayLike, **kwargs: Any) -> NDArrayFloat:
"""
Apply the *LUT* to specified *RGB* colourspace array using specified method.
Parameters
----------
RGB
*RGB* colourspace array to apply the *LUT* onto.
Other Parameters
-------------... |
Apply the *LUT* to specified *RGB* colourspace array using specified method.
Parameters
----------
RGB
*RGB* colourspace array to apply the *LUT* onto.
Other Parameters
----------------
direction
Whether the *LUT* should be applied in th... | apply | python | colour-science/colour | colour/io/luts/lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/lut.py | BSD-3-Clause |
def LUT_to_LUT(
LUT: AbstractLUT,
cls: Type[AbstractLUT],
force_conversion: bool = False,
**kwargs: Any,
) -> AbstractLUT:
"""
Convert specified *LUT* to specified ``cls`` class instance.
Parameters
----------
LUT
*LUT* to convert.
cls
*LUT* class instance.
f... |
Convert specified *LUT* to specified ``cls`` class instance.
Parameters
----------
LUT
*LUT* to convert.
cls
*LUT* class instance.
force_conversion
Whether to force the conversion if destructive.
Other Parameters
----------------
channel_weights
Cha... | LUT_to_LUT | python | colour-science/colour | colour/io/luts/lut.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/lut.py | BSD-3-Clause |
def apply(self, RGB: ArrayLike, *args: Any, **kwargs: Any) -> NDArrayFloat:
"""
Apply the *LUT* sequence operator to the specified *RGB* colourspace array.
Parameters
----------
RGB
*RGB* colourspace array to apply the *LUT* sequence operator onto.
Other Par... |
Apply the *LUT* sequence operator to the specified *RGB* colourspace array.
Parameters
----------
RGB
*RGB* colourspace array to apply the *LUT* sequence operator onto.
Other Parameters
----------------
args
Arguments.
kwargs
... | apply | python | colour-science/colour | colour/io/luts/operator.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/operator.py | BSD-3-Clause |
def matrix(self, value: ArrayLike) -> None:
"""Setter for the **self.matrix** property."""
value = as_float_array(value)
shape_t = value.shape[-1]
value = np.reshape(value, (shape_t, shape_t))
attest(
value.shape in [(3, 3), (4, 4)],
f'"matrix" propert... | Setter for the **self.matrix** property. | matrix | python | colour-science/colour | colour/io/luts/operator.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/operator.py | BSD-3-Clause |
def offset(self, value: ArrayLike) -> None:
"""Setter for the **self.offset** property."""
value = as_float_array(value)
shape_t = value.shape[-1]
attest(
value.shape in [(3,), (4,)],
f'"offset" property: "{value}" shape is not (3, ) or (4, )!',
)
... | Setter for the **self.offset** property. | offset | python | colour-science/colour | colour/io/luts/operator.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/operator.py | BSD-3-Clause |
def __str__(self) -> str:
"""
Return a formatted string representation of the *LUT* operator.
Returns
-------
:class:`str`
Formatted string representation.
Examples
--------
>>> print(LUTOperatorMatrix()) # doctest: +ELLIPSIS
LUTOper... |
Return a formatted string representation of the *LUT* operator.
Returns
-------
:class:`str`
Formatted string representation.
Examples
--------
>>> print(LUTOperatorMatrix()) # doctest: +ELLIPSIS
LUTOperatorMatrix - LUT Sequence Operator ..... | __str__ | python | colour-science/colour | colour/io/luts/operator.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/operator.py | BSD-3-Clause |
def __repr__(self) -> str:
"""
Return an evaluable string representation of the *LUT* operator.
Returns
-------
:class:`str`
Evaluable string representation.
Examples
--------
>>> LUTOperatorMatrix(comments=["A first comment.", "A second comm... |
Return an evaluable string representation of the *LUT* operator.
Returns
-------
:class:`str`
Evaluable string representation.
Examples
--------
>>> LUTOperatorMatrix(comments=["A first comment.", "A second comment."])
... # doctest: +ELLIPS... | __repr__ | python | colour-science/colour | colour/io/luts/operator.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/operator.py | BSD-3-Clause |
def __eq__(self, other: object) -> bool:
"""
Return whether the *LUT* operator is equal to specified other object.
Parameters
----------
other
Object to test whether it is equal to the *LUT* operator.
Returns
-------
:class:`bool`
... |
Return whether the *LUT* operator is equal to specified other object.
Parameters
----------
other
Object to test whether it is equal to the *LUT* operator.
Returns
-------
:class:`bool`
Whether specified object equal to the *LUT* operato... | __eq__ | python | colour-science/colour | colour/io/luts/operator.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/operator.py | BSD-3-Clause |
def apply(
self,
RGB: ArrayLike,
*args: Any, # noqa: ARG002
**kwargs: Any,
) -> NDArrayFloat:
"""
Apply the *LUT* operator to specified *RGB* array.
Parameters
----------
RGB
*RGB* array to apply the *LUT* operator transform to.
... |
Apply the *LUT* operator to specified *RGB* array.
Parameters
----------
RGB
*RGB* array to apply the *LUT* operator transform to.
Other Parameters
----------------
apply_offset_first
Whether to apply the offset first and then the matrix... | apply | python | colour-science/colour | colour/io/luts/operator.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/operator.py | BSD-3-Clause |
def read_LUT_ResolveCube(path: str | PathLike) -> LUT3x1D | LUT3D | LUTSequence:
"""
Read the specified *Resolve* *.cube* *LUT* file.
Parameters
----------
path
*LUT* path.
Returns
-------
:class:`colour.LUT3x1D` or :class:`colour.LUT3D` or \
:class:`colour.LUTSequence`
... |
Read the specified *Resolve* *.cube* *LUT* file.
Parameters
----------
path
*LUT* path.
Returns
-------
:class:`colour.LUT3x1D` or :class:`colour.LUT3D` or :class:`colour.LUTSequence`
:class:`LUT3x1D` or :class:`LUT3D` or :class:`LUTSequence` class
instance.
R... | read_LUT_ResolveCube | python | colour-science/colour | colour/io/luts/resolve_cube.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/resolve_cube.py | BSD-3-Clause |
def write_LUT_ResolveCube(
LUT: LUT1D | LUT3x1D | LUT3D | LUTSequence,
path: str | PathLike,
decimals: int = 7,
) -> bool:
"""
Write the specified *LUT* to specified the *Resolve* *.cube* *LUT* file.
Parameters
----------
LUT
:class:`LUT1D`, :class:`LUT3x1D` or :class:`LUT3D` or... |
Write the specified *LUT* to specified the *Resolve* *.cube* *LUT* file.
Parameters
----------
LUT
:class:`LUT1D`, :class:`LUT3x1D` or :class:`LUT3D` or
:class:`LUTSequence` class instance to write at specified path.
path
*LUT* path.
decimals
Formatting decimals... | write_LUT_ResolveCube | python | colour-science/colour | colour/io/luts/resolve_cube.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/resolve_cube.py | BSD-3-Clause |
def sequence(self, value: Sequence[ProtocolLUTSequenceItem]) -> None:
"""Setter for the **self.sequence** property."""
for item in value:
attest(
isinstance(item, ProtocolLUTSequenceItem),
'"value" items must implement the "ProtocolLUTSequenceItem" '
... | Setter for the **self.sequence** property. | sequence | python | colour-science/colour | colour/io/luts/sequence.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/sequence.py | BSD-3-Clause |
def __setitem__(self, index: int | slice, value: Any) -> None:
"""
Set the *LUT* sequence at specified index (or slice) with specified value.
Parameters
----------
index
Index (or slice) to set the *LUT* sequence value at.
value
Value to set the *... |
Set the *LUT* sequence at specified index (or slice) with specified value.
Parameters
----------
index
Index (or slice) to set the *LUT* sequence value at.
value
Value to set the *LUT* sequence with.
| __setitem__ | python | colour-science/colour | colour/io/luts/sequence.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/sequence.py | BSD-3-Clause |
def __str__(self) -> str:
"""
Return a formatted string representation of the *LUT* sequence.
Returns
-------
:class:`str`
Formatted string representation.
"""
sequence = " --> ".join([a.__class__.__name__ for a in self._sequence])
operation... |
Return a formatted string representation of the *LUT* sequence.
Returns
-------
:class:`str`
Formatted string representation.
| __str__ | python | colour-science/colour | colour/io/luts/sequence.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/sequence.py | BSD-3-Clause |
def __repr__(self) -> str:
"""
Return an evaluable string representation of the *LUT* sequence.
Returns
-------
:class:`str`
Evaluable string representation.
"""
operations = re.sub(
"^",
" " * 4,
",\n".join([repr(... |
Return an evaluable string representation of the *LUT* sequence.
Returns
-------
:class:`str`
Evaluable string representation.
| __repr__ | python | colour-science/colour | colour/io/luts/sequence.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/sequence.py | BSD-3-Clause |
def __eq__(self, other: object) -> bool:
"""
Return whether the *LUT* sequence is equal to specified other object.
Parameters
----------
other
Object to test whether it is equal to the *LUT* sequence.
Returns
-------
:class:`bool`
... |
Return whether the *LUT* sequence is equal to specified other object.
Parameters
----------
other
Object to test whether it is equal to the *LUT* sequence.
Returns
-------
:class:`bool`
Whether specified object is equal to the *LUT* sequ... | __eq__ | python | colour-science/colour | colour/io/luts/sequence.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/sequence.py | BSD-3-Clause |
def insert(self, index: int, value: ProtocolLUTSequenceItem) -> None:
"""
Insert specified *LUT* at specified index into the *LUT* sequence.
Parameters
----------
index
Index to insert the item at into the *LUT* sequence.
value
*LUT* to insert int... |
Insert specified *LUT* at specified index into the *LUT* sequence.
Parameters
----------
index
Index to insert the item at into the *LUT* sequence.
value
*LUT* to insert into the *LUT* sequence.
| insert | python | colour-science/colour | colour/io/luts/sequence.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/sequence.py | BSD-3-Clause |
def apply(self, RGB: ArrayLike, **kwargs: Any) -> NDArrayFloat:
"""
Apply the *LUT* sequence sequentially to specified *RGB* colourspace array.
Parameters
----------
RGB
*RGB* colourspace array to apply the *LUT* sequence
sequentially onto.
Other... |
Apply the *LUT* sequence sequentially to specified *RGB* colourspace array.
Parameters
----------
RGB
*RGB* colourspace array to apply the *LUT* sequence
sequentially onto.
Other Parameters
----------------
kwargs
Keywords ar... | apply | python | colour-science/colour | colour/io/luts/sequence.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/sequence.py | BSD-3-Clause |
def read_LUT_SonySPI1D(path: str | PathLike) -> LUT1D | LUT3x1D:
"""
Read the specified *Sony* *.spi1d* *LUT* file.
Parameters
----------
path
*LUT* path.
Returns
-------
:class:`colour.LUT1D` or :class:`colour.LUT3x1D`
:class:`LUT1D` or :class:`LUT3x1D` class instance.... |
Read the specified *Sony* *.spi1d* *LUT* file.
Parameters
----------
path
*LUT* path.
Returns
-------
:class:`colour.LUT1D` or :class:`colour.LUT3x1D`
:class:`LUT1D` or :class:`LUT3x1D` class instance.
Examples
--------
Reading a 1D *Sony* *.spi1d* *LUT*:
... | read_LUT_SonySPI1D | python | colour-science/colour | colour/io/luts/sony_spi1d.py | https://github.com/colour-science/colour/blob/master/colour/io/luts/sony_spi1d.py | BSD-3-Clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.