Commit d8df2102 authored by Nathan/Eilisha Shiraini's avatar Nathan/Eilisha Shiraini
Browse files

Created a dict to store info on interpolation modes

parent db83f53a
......@@ -12,8 +12,8 @@ class GrayInterpolate(Enum):
]
GRAY = [
(0xF0, 0x00),
(0x0F, 0x00),
(0xA8, 0x00),
(0x57, 0x00),
]
FULL = [
......@@ -51,12 +51,12 @@ class RGBInterpolate(Enum):
((0x00, 0x00, 0xFF), (0x00, 0x00, 0x00)),
]
HALFCHANNEL = [
((0xF0, 0x00, 0x00), (0x00, 0x00, 0x00)),
((0x0F, 0x00, 0x00), (0x00, 0x00, 0x00)),
((0x00, 0xF0, 0x00), (0x00, 0x00, 0x00)),
((0x00, 0x0F, 0x00), (0x00, 0x00, 0x00)),
((0x00, 0x00, 0xF0), (0x00, 0x00, 0x00)),
((0x00, 0x00, 0x0F), (0x00, 0x00, 0x00)),
((0xA8, 0x00, 0x00), (0x00, 0x00, 0x00)),
((0x57, 0x00, 0x00), (0x00, 0x00, 0x00)),
((0x00, 0xA8, 0x00), (0x00, 0x00, 0x00)),
((0x00, 0x57, 0x00), (0x00, 0x00, 0x00)),
((0x00, 0x00, 0xA8), (0x00, 0x00, 0x00)),
((0x00, 0x00, 0x57), (0x00, 0x00, 0x00)),
]
FULL = [
......@@ -86,8 +86,61 @@ class RGBInterpolate(Enum):
((0x00, 0x00, 0x01), (0x00, 0x00, 0x00)),
]
INTERPOLATION_CLASSES = {
'1' : BWInterpolate,
'L' : GrayInterpolate,
'RGB' : RGBInterpolate,
INTERPOLATION_MODES = {
'single' : {
'int' : BWInterpolate.SINGLE,
'mode' : '1',
'maxcodes' : 1,
'desc' : 'For a single code, black squares on white background',
},
'halfgray' : {
'int' : GrayInterpolate.GRAY,
'mode' : 'L',
'maxcodes' : 2,
'desc' : 'Two codes in a grayscale image, using 0%, 34%, 66%, and 100% brightness',
},
'fullgray' : {
'int' : GrayInterpolate.FULL,
'mode' : 'L',
'maxcodes' : 8,
'desc' : 'One code per bit in an 8 bits grayscale image',
},
'redcyan' : {
'int' : RGBInterpolate.RC,
'mode' : 'RGB',
'maxcodes' : 2,
'desc' : 'One code on the red channel, the other on green and blue',
},
'greenmagenta' : {
'int' : RGBInterpolate.GM,
'mode' : 'RGB',
'maxcodes' : 2,
'desc' : 'One code on the green channel, the other on red and blue',
},
'blueyellow' : {
'int' : RGBInterpolate.BY,
'mode' : 'RGB',
'maxcodes' : 2,
'desc' : 'One code on the blue channel, the other on green and red',
},
'rgb' : {
'int' : RGBInterpolate.TRICHANNEL,
'mode' : 'RGB',
'maxcodes' : 3,
'desc' : 'One code per channel, 3 in total',
},
'rgb2' : {
'int' : RGBInterpolate.HALFCHANNEL,
'mode' : 'RGB',
'maxcodes' : 6,
'desc' : 'Two codes per channel (see "halfgray"), 6 in total',
},
'allcolors' : {
'int' : RGBInterpolate.FULL,
'mode' : 'RGB',
'maxcodes' : 24,
'desc' : 'One code per bit on a 24 bits RGB image'
},
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment