예제 #1
0
        public static int Homogenize( List<string> args )
        {
            if ( args.Count == 0 ) {
                Console.WriteLine( "HomogenizePalette in.gim [out.gim]" );
                Console.WriteLine( "Overwrites in.gim when no out.gim is provided." );
            }

            string infilename = args[0];
            string outfilename = args.Count > 1 ? args[1] : args[0];

            GIM gim = new GIM ( infilename );
            gim.HomogenizePalette();
            System.IO.File.WriteAllBytes( outfilename, gim.Serialize() );

            return 0;
        }
예제 #2
0
        public static int Homogenize(List <string> args)
        {
            if (args.Count == 0)
            {
                Console.WriteLine("HomogenizePalette in.gim [out.gim]");
                Console.WriteLine("Overwrites in.gim when no out.gim is provided.");
            }

            string infilename  = args[0];
            string outfilename = args.Count > 1 ? args[1] : args[0];

            GIM gim = new GIM(infilename);

            gim.HomogenizePalette();
            System.IO.File.WriteAllBytes(outfilename, gim.Serialize());


            return(0);
        }
예제 #3
0
        public static int Split(List <string> args)
        {
            string Filename = args[0];

            GIM[] gims = new GIM[3];
            gims[0] = new GIM(Filename);;
            gims[1] = new GIM(Filename);;
            gims[2] = new GIM(Filename);;
            System.IO.File.WriteAllBytes(
                System.IO.Path.GetDirectoryName(Filename) + System.IO.Path.DirectorySeparatorChar + System.IO.Path.GetFileNameWithoutExtension(Filename) + "_resave" + System.IO.Path.GetExtension(Filename),
                gims[0].Serialize());

            for (int i = 0; i < gims.Length; ++i)
            {
                GIM gim = gims[i];
                gim.ReduceToOneImage(i);
                System.IO.File.WriteAllBytes(
                    System.IO.Path.GetDirectoryName(Filename) + System.IO.Path.DirectorySeparatorChar + System.IO.Path.GetFileNameWithoutExtension(Filename) + i.ToString() + System.IO.Path.GetExtension(Filename),
                    gim.Serialize());
            }

            return(0);
        }