from logica.utilidades.Output import Output
from logica.controladores.TextureController import TextureController
import logica.utilidades.utils as ut
import logica.image_preprocessing_logica as logica

tc = TextureController("imagenes_group_procesing")
output = Output("preprocessing")

def set_output(new_output):
    output.set_output(new_output)

def seleccionar_folder():
    return ut.seleccionar_folder_callback(output)

def cargar_imagenes(folder):
    return tc.cargar_imagenes(folder)

def eliminar_imagenes(output):
    return ut.deleteImages(output)

def resize_images(ancho, alto):
    logica.paralized_resize_images_callback(ancho, alto)

def adjust_brightness_contrast(brightness_factor=1.0, contrast_factor=1.0, color_factor=1.0):
    logica.adjust_brightness_contrast(brightness_factor, contrast_factor, color_factor)

def denoise_images(radio):
    logica.denoise_image(radio)

def get_group_tag():
    return tc.get_group_tag()

def remove_blurry_images(threshold):
    logica.remove_blurry_images(threshold)

def add_noise_image(noise_type, intensity):
    logica.add_noise(noise_type, intensity)

def init_main_view_output():
    output.main_view()

def copy_images_to_output():
    logica.copy_images_to_output()

def init_texture_controller(folder):
    result = tc.main_view(folder)
    if result:
        output.set_output(result)