def apply_piecewise_linear(self, coordinates_x=[0, 255], coordinates_y=[255, 0]): image = filter.apply_piecewise_linear(self.current_image, coordinates_x, coordinates_y) self.update_memory_images(image) return self.current_image
def apply_piecewise_linear(img, coordinates_x, coordinates_y): r, g, b = rgb.get_rgb_layers(img) r = filter.apply_piecewise_linear(r, coordinates_x, coordinates_y) g = filter.apply_piecewise_linear(g, coordinates_x, coordinates_y) b = filter.apply_piecewise_linear(b, coordinates_x, coordinates_y) return rgb.merge_rgb_layers(r, g, b)