Passed
Pull Request — master (#1)
by Konstantinos
01:08
created

ImageProcessor.process()   A

Complexity

Conditions 2

Size

Total Lines 6
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 2
nop 3
1
from typing import List, Callable
2
from numpy.typing import NDArray
3
4
5
class ImageProcessor:
6
    def process(self, image: NDArray, pipeline: List[Callable[[NDArray], NDArray]]) -> NDArray:
7
        if len(pipeline) > 0:
8
            processor = pipeline[0]
9
            pipeline = pipeline[1:]
10
            return self.process(processor(image), pipeline)
11
        return image
12