Exemplo n.º 1
0
def test_dot_encode_colordepth1():
    dot = Dot()
    dot.encode([1])
    assert dot.getChannels() == (1.0, 1.0, 1.0)

    dot.encode([0])
    assert dot.getChannels() == (0.0, 0.0, 0.0)
Exemplo n.º 2
0
def test_dot_encode_colordepth2():
    dot = Dot()

    dot.encode([0, 0])
    assert dot.getChannels() == (1.0, 1.0, 1.0)

    dot.encode([1, 0])
    assert dot.getChannels() == (0, 1.0, 1.0)

    dot.encode([1, 1])
    assert dot.getChannels() == (1.0, 1.0, 0)

    dot.encode([1, 1, 0, 0])
    assert dot.getChannels() == (0, 1.0 / 3.0, 1.0 / 3.0)
Exemplo n.º 3
0
def test_dot_encode_colordepth3():
    dot = Dot()

    dot.encode([0, 0, 0])
    assert dot.getChannels() == (0.0, 0.0, 0.0)

    dot.encode([1, 0, 1])
    assert dot.getChannels() == (1.0, 0.0, 1.0)

    dot.encode([1, 1, 1])
    assert dot.getChannels() == (1.0, 1.0, 1.0)

    dot.encode([1, 0, 0, 0, 1, 1])
    assert dot.getChannels() == (85.0 / MaxColorVal, 0, 1.0)

    dot.encode([1, 1, 1, 1, 1, 1, 1, 1, 1])
    assert dot.getChannels() == (1.0, 1.0, 1.0)
Exemplo n.º 4
0
def test_dot_encode_colordepth2():
    dot = Dot()

    # White
    dot.encode([0, 0])
    assert dot.getChannels() == (1.0, 1.0, 1.0)

    # Magenta
    dot.encode([0, 1])
    assert dot.getChannels() == (1.0, 0.0, 1.0)

    # Cyan
    dot.encode([1, 0])
    assert dot.getChannels() == (0, 1.0, 1.0)

    # Yellow
    dot.encode([1, 1])
    assert dot.getChannels() == (1.0, 1.0, 0)

    dot.encode([1, 1, 0, 0])
    assert dot.getChannels() == (0, 1.0 / 3.0, 1.0 / 3.0)