commit 206cea79aa260152d3a9ad348a113e86f258263b Author: Pavel 'LEdoian' Turinsky Date: Fri Apr 1 11:21:31 2022 +0200 Initial version of the lib diff --git a/lib.py b/lib.py new file mode 100644 index 0000000..07924f5 --- /dev/null +++ b/lib.py @@ -0,0 +1,27 @@ + +class Pixel: + def __init__(self): ... + + def as_tuple(self): + return (self.r, self.g, self.b) + +class Picture: + def __init__(self, data); + self.pixels = data + self.w = None + self.h = None + + # TODO: convert from format + + def show(self): ... + +class Interpolator + def interpolate(self, picture, new_h, new_w): + result = [[None for _ in range(new_w)] for _ in range(new_h)] + for x in range(new_w): + for y in range(new_h): + raise NotImplementedError('Tady jsem skonĨil') + + + def get_pixel(self, picture, x, y, result, quantum_x, quantum_y): + raise NotImplementedError('You write this :-)')