# coding: utf-8

from __future__ import print_function, unicode_literals, absolute_import

import cv2

from .base import rpartial, BaseScaleCase
from .cv2 import Cv2TestCase


class ScaleCase(BaseScaleCase, Cv2TestCase):
    def runner(self, im):
        cv2.resize(im, self.dest_size, interpolation=self.filter)


cases = [
    rpartial(ScaleCase, scale, cv2.INTER_AREA, hpass=hpass, vpass=vpass)
    for hpass, vpass in [
        # (True, False),
        # (False, True),
        (True, True),
    ] for scale in [
        0.01,
        0.125,
        0.8,
    ]
] + [
    rpartial(ScaleCase, 2.14, flt, hpass=hpass, vpass=vpass)
    for hpass, vpass in [
        # (True, False),
        # (False, True),
        (True, True),
    ] for flt in [
        # cv2.INTER_NEAREST,
        cv2.INTER_LINEAR,
        cv2.INTER_CUBIC,
        cv2.INTER_LANCZOS4,
    ]
]

@@ -353,22 +353,11 @@
 le, 
-cv2.INTER_AREA
+flt
 , hp
@@ -541,16 +541,88 @@
    0.8,%0A
+    %5D for flt in %5B%0A        # cv2.INTER_NEAREST,%0A        cv2.INTER_AREA,%0A
     %5D%0A%5D 
@@ -653,12 +653,13 @@
 se, 
-2.14
+scale
 , fl
@@ -777,32 +777,67 @@
   (True, True),%0A
+    %5D for scale in %5B%0A        2.14,%0A
     %5D for flt in

add INTER_NEAREST to cv2_scale