# Path: cv_algorithms/colorspace.py
# class Colorspace(enum.IntEnum):
#     BGR = 0 # "Standard" OpenCV colorspace
#     RGB = 1
#     HSV = 2
#     LAB = 3
#     YUV = 4
#     YCrCb = 5
#     HLS = 6
#     LUV = 7
#     XYZ = 8
# 
#     @property
#     def channels(colspace):
#         """
#         Get a tuple of all three ColorspaceChannels
#         for the given colorspace
#         """
#         return (ColorspaceChannel(colspace.value * 3),
#                 ColorspaceChannel(colspace.value * 3 + 1),
#                 ColorspaceChannel(colspace.value * 3 + 2))
# 
# class ColorspaceChannel(enum.IntEnum):
#     """
#     Different types of color channels
#     """
#     # BGR
#     BGR_Blue = 0
#     BGR_Green = 1
#     BGR_Red = 2
#     # RGB
#     RGB_Red = 3
#     RGB_Green = 4
#     RGB_Blue = 5
#     # HSV
#     HSV_Hue = 6
#     HSV_Saturation = 7
#     HSV_Value = 8
#     # LAB
#     LAB_L = 9
#     LAB_a = 10
#     LAB_b = 11
#     # YUV
#     YUV_Luma = 12 # Y
#     YUV_U = 13
#     YUV_V = 14
#     # YCrCb
#     YCrCb_Luma = 15 # Y
#     YCrCb_Cr = 16
#     YCrCb_Cb = 17
#     # HLS
#     HLS_Hue = 18
#     HLS_Lightness = 19
#     HLS_Saturation = 20
#     # LUV
#     LUV_L = 21
#     LUV_U = 22
#     LUV_V = 23
#     # XYZ
#     XYZ_X = 24
#     XYZ_Y = 25
#     XYZ_Z = 26
#     
#     
#     @property
#     def colorspace(self):
#         """
#         Get the colorspace for the current instance
#         """
#         return Colorspace(self.value // 3)
#     
#     @property
#     def channel_idx(self):
#         """
#         Get the channel number for the colorspace (0 to 2)
#         """
#         return self.value % 3
# 
#     @property
#     def channel_name(self):
#         """
#         The name of the channel,
#         not including the colorspace name.
# 
#         Example: RGB_Red => Red
#         """
#         return self.name.partition("_")[2]


import io
import cv2
import cv_algorithms
import numpy as np
from numpy.testing import assert_approx_equal, assert_allclose, assert_array_equal
from nose.tools import assert_equal, assert_true, assert_false, assert_greater, assert_less
from cv_algorithms.colorspace import Colorspace, ColorspaceChannel
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

class TestColorspace(object):
    def test_colorspace_channels(self):
        assert_equal((ColorspaceChannel.RGB_Red,
                      ColorspaceChannel.RGB_Green,
                      ColorspaceChannel.RGB_Blue),
            Colorspace.RGB.channels)

# Path: cv_algorithms/colorspace.py
# class Colorspace(enum.IntEnum):
#     BGR = 0 # "Standard" OpenCV colorspace
#     RGB = 1
#     HSV = 2
#     LAB = 3
#     YUV = 4
#     YCrCb = 5
#     HLS = 6
#     LUV = 7
#     XYZ = 8
# 
#     @property
#     def channels(colspace):
#         """
#         Get a tuple of all three ColorspaceChannels
#         for the given colorspace
#         """
#         return (ColorspaceChannel(colspace.value * 3),
#                 ColorspaceChannel(colspace.value * 3 + 1),
#                 ColorspaceChannel(colspace.value * 3 + 2))
# 
# class ColorspaceChannel(enum.IntEnum):
#     """
#     Different types of color channels
#     """
#     # BGR
#     BGR_Blue = 0
#     BGR_Green = 1
#     BGR_Red = 2
#     # RGB
#     RGB_Red = 3
#     RGB_Green = 4
#     RGB_Blue = 5
#     # HSV
#     HSV_Hue = 6
#     HSV_Saturation = 7
#     HSV_Value = 8
#     # LAB
#     LAB_L = 9
#     LAB_a = 10
#     LAB_b = 11
#     # YUV
#     YUV_Luma = 12 # Y
#     YUV_U = 13
#     YUV_V = 14
#     # YCrCb
#     YCrCb_Luma = 15 # Y
#     YCrCb_Cr = 16
#     YCrCb_Cb = 17
#     # HLS
#     HLS_Hue = 18
#     HLS_Lightness = 19
#     HLS_Saturation = 20
#     # LUV
#     LUV_L = 21
#     LUV_U = 22
#     LUV_V = 23
#     # XYZ
#     XYZ_X = 24
#     XYZ_Y = 25
#     XYZ_Z = 26
#     
#     
#     @property
#     def colorspace(self):
#         """
#         Get the colorspace for the current instance
#         """
#         return Colorspace(self.value // 3)
#     
#     @property
#     def channel_idx(self):
#         """
#         Get the channel number for the colorspace (0 to 2)
#         """
#         return self.value % 3
# 
#     @property
#     def channel_name(self):
#         """
#         The name of the channel,
#         not including the colorspace name.
# 
#         Example: RGB_Red => Red
#         """
#         return self.name.partition("_")[2]


# Path: test/TestColorspace.py
import io
import cv2
import cv_algorithms
import numpy as np
from numpy.testing import assert_approx_equal, assert_allclose, assert_array_equal
from nose.tools import assert_equal, assert_true, assert_false, assert_greater, assert_less
from cv_algorithms.colorspace import Colorspace, ColorspaceChannel

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

class TestColorspace(object):
    def test_colorspace_channels(self):
        assert_equal((ColorspaceChannel.RGB_Red,
                      ColorspaceChannel.RGB_Green,
                      ColorspaceChannel.RGB_Blue),
            Colorspace.RGB.channels)

        assert_equal((ColorspaceChannel.XYZ_X,