Exemplo n.º 1
0
 private void K_ValueChanged(object sender, RoutedPropertyChangedEventArgs <object> e)
 {
     if (kInput.Value.HasValue)
     {
         this.K = kInput.Value.Value;
         algorithm?.Apply(K, K, K);
     }
 }
Exemplo n.º 2
0
        private void AverageDitheringRadio_Checked(object sender, RoutedEventArgs e)
        {
            SetBitmapImage();
            this.algorithm = new AverageDitheringAlgorithm(algorithmBitmap);
            algorithm.Apply(Kr, Kg, Kb);

            OpenNewWindow();
        }
Exemplo n.º 3
0
        private void PopularityAlgorithmRadio_Checked(object sender, RoutedEventArgs e)
        {
            SetBitmapImage();
            this.algorithm = new PopularityAlgorithm(algorithmBitmap);
            algorithm.Apply(K, K, K);

            OpenNewWindow();

            SetColorInputsVisibility(Visibility.Hidden);
        }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            // General

            Initialize();

            /*************************
            *    Leemos el fichero   *
            *************************/

            FileStream   fs = new FileStream(inputPath, FileMode.Open, FileAccess.Read);
            StreamReader sr = new StreamReader(fs, Encoding.ASCII);

            // Leemos la línea 1

            LoadInformationFromLine1(sr);

            // Leemos la línea 2

            LoadBookScoreFromLine2(sr);

            // Leemos el resto de líneas con librerías

            LoadLibrariesFromOtherLines(sr);

            /*************************
            * Aplicamos el algoritmo *
            *************************/

            Output output = Algorithm.Apply(_input);

            /*************************
            *  Guardamos la salida   *
            *************************/

            SaveFileWithOutput(output);

            // Para evitar cerrar la consola
            Console.ReadLine();
        }