def test_hsvratio_average_value(h, s, v, ratio, val, expected): r = image.HSVRatio(hue=h, saturation=s, value=v, ratio=ratio) r.average_value(val) assert r.h == h assert r.s == s assert r.v == expected assert r.ratio == ratio
def test_hsvratio_init(): ratio = image.HSVRatio() assert ratio.h == 0.0 assert ratio.s == 0.0 assert ratio.v == 0.0 assert ratio.ratio == 0.0
def test_hsvratio_init_params(): ratio = image.HSVRatio(hue=15.2, saturation=99.1, value=54.3, ratio=1.0) assert ratio.h == 15.2 assert ratio.s == 99.1 assert ratio.v == 54.3 assert ratio.ratio == 1.0
def test_hsvratio_average(h, s, v, ratio, th, ts, tv, eh, es, ev, eratio): r = image.HSVRatio(hue=h, saturation=s, value=v, ratio=ratio) r.average(th, ts, tv) assert r.h == eh assert r.s == es assert r.v == ev assert r.ratio == eratio
def test_hsvratio_hue(h, s, v, ratio, fullspectrum, bri_min, bri_max, expected): r = image.HSVRatio(hue=h, saturation=s, value=v, ratio=ratio) assert r.hue(fullspectrum, bri_min, bri_max) == expected