IDS peak ICV v1.2.0
Loading...
Searching...
No Matches
debayer_conversion_policy.py
Go to the documentation of this file.
1from __future__ import annotations
2from enum import Enum
3
4from ids_peak_icv.exceptions import NotSupportedException
5
6
8 """!
9 @brief
10 Specifies the conditions under which the debayer module applies color conversion.
11
12 @ingroup ids_peak_icv_python_pipeline_modules
13 @since ids_peak_icv 1.0
14 """
15 BYPASS = 0
16 """!
17 @brief
18 Do not convert images.
19
20 @since ids_peak_icv 1.0
21 """
22
23 BAYER_ONLY = 1
24 """!
25 @brief
26 Convert only Bayer-pattern images.
27
28 @since ids_peak_icv 1.0
29 """
30
31 BAYER_AND_MONO = 2
32 """!
33 @brief
34 Convert both Bayer-pattern and monochrome images.
35
36 @since ids_peak_icv 1.0
37 """
38
39 @property
40 def string_value(self) -> str:
41 """!
42 @brief
43 Return the string identifier for this conversion policy.
44 @since ids_peak_icv 1.0
45 """
46 mapping = {
47 DebayerConversionPolicy.BYPASS: "Bypass",
48 DebayerConversionPolicy.BAYER_ONLY: "BayerOnly",
49 DebayerConversionPolicy.BAYER_AND_MONO: "BayerAndMono",
50 }
51 return mapping[self]
52
53 @staticmethod
54 def create_from_string_value(string_value: str) -> DebayerConversionPolicy:
55 if string_value == "Bypass":
56 return DebayerConversionPolicy.BYPASS
57 if string_value == "BayerOnly":
58 return DebayerConversionPolicy.BAYER_ONLY
59 if string_value == "BayerAndMono":
60 return DebayerConversionPolicy.BAYER_AND_MONO
61
63 f"The given conversion conversion policy is not supported. Given: {string_value}")
Thrown when a requested operation is not implemented or supported.
Definition exceptions.py:71
Specifies the conditions under which the debayer module applies color conversion.
str string_value(self)
Return the string identifier for this conversion policy.