Units¶
For converting between things that are the same thing but have different numbers and shapes
Classes:
|
Rescale values from one range to another |
|
An enumeration. |
|
Convert colors using the colorsys module!! |
-
class
Rescale
(in_range: Tuple[float, float] = (0, 1), out_range: Tuple[float, float] = (0, 1), clip=False, *args, **kwargs)[source]¶ Bases:
autopilot.transform.transforms.Transform
Rescale values from one range to another
Attributes:
Methods:
process
(input)Subtract input minimum, multiple by output/input size ratio, add output minimum
-
format_in
= { 'type': ( <class 'numpy.ndarray'>, <class 'float'>, <class 'int'>, <class 'tuple'>, <class 'list'>)}¶
-
format_out
= {'type': <class 'numpy.ndarray'>}¶
-
-
class
Colorspaces
(value)[source]¶ Bases:
enum.Enum
An enumeration.
Attributes:
-
HSV
= 1¶
-
RGB
= 2¶
-
YIQ
= 3¶
-
HLS
= 4¶
-
-
class
Color
(convert_from: autopilot.transform.units.Colorspaces = <Colorspaces.HSV: 1>, convert_to: autopilot.transform.units.Colorspaces = <Colorspaces.RGB: 2>, output_scale=255, *args, **kwargs)[source]¶ Bases:
autopilot.transform.transforms.Transform
Convert colors using the colorsys module!!
Note
All inputs must be scaled (0,1) and all outputs will be (0,1)
Attributes:
Methods:
process
(input, *args)-
format_in
= {'type': <class 'tuple'>}¶
-
format_out
= {'type': <class 'tuple'>}¶
-
CONVERSIONS
= { <Colorspaces.HSV: 1>: { <Colorspaces.RGB: 2>: <function hsv_to_rgb at 0x7f51a5790cb0>}, <Colorspaces.RGB: 2>: { <Colorspaces.HSV: 1>: <function rgb_to_hsv at 0x7f51a5790c20>, <Colorspaces.HLS: 4>: <function rgb_to_hls at 0x7f51a5790a70>, <Colorspaces.YIQ: 3>: <function rgb_to_yiq at 0x7f51a5790440>}, <Colorspaces.HLS: 4>: { <Colorspaces.RGB: 2>: <function hls_to_rgb at 0x7f51a5790b00>}, <Colorspaces.YIQ: 3>: { <Colorspaces.RGB: 2>: <function yiq_to_rgb at 0x7f51a5790320>}}¶
-