예제 #1
0
def test_crop_box_vertical_medium():
    s = (1000, 500)
    t = (1000, 200)

    assert crop_box(s, t, 2) == (0, 150, 1000, 350)
예제 #2
0
def test_crop_box_vertical_bottom():
    s = (1000, 500)
    t = (1000, 200)

    assert crop_box(s, t, 3) == (0, 300, 1000, 500)
예제 #3
0
def test_crop_box_vertical_top():
    s = (1000, 500)
    t = (1000, 200)

    assert crop_box(s, t, 1) == (0, 0, 1000, 200)
예제 #4
0
def test_crop_box_same_aspect_ratio():
    s = (640, 480)
    t = (320, 240)

    assert crop_box(s, t) is False
예제 #5
0
def test_crop_box_horizontal_right():
    s = (1000, 500)
    t = (500, 500)

    assert crop_box(s, t, 3) == (500, 0, 1000, 500)
예제 #6
0
def test_crop_box_horizontal_medium():
    s = (1000, 500)
    t = (500, 500)

    assert crop_box(s, t, 2) == (250, 0, 750, 500)
예제 #7
0
def test_crop_box_horizontal_left():
    s = (1000, 500)
    t = (500, 500)

    assert crop_box(s, t, 1) == (0, 0, *t)