Beispiel #1
0
        public static async Task Main(string[] args)
        {
            Console.OutputEncoding = Encoding.Unicode;
            Console.InputEncoding  = Encoding.Unicode;



            var q  = new ImageQuery(@"C:\Users\Deci\Pictures\Test Images\Small1.png");
            var q2 = new ImageQuery("https://i.imgur.com/QtCausw.jpg");
            var i  = new Ascii2DEngine();
            var i2 = i.GetResultAsync(q2);
            var r2 = await i2;

            Console.WriteLine(">> {0}", r2);

            foreach (var result in r2.OtherResults)
            {
                Console.WriteLine($">{result}");
            }
            // var cfg = new SearchConfig() {Query = q, SearchEngines = SearchEngineOptions.All};
            //
            // var cl = new SearchClient(cfg);
            //
            // Console.WriteLine("Search 1");
            // cl.ResultCompleted += OnResult;
            // var r = cl.RunSearchAsync();
            // await r;

            /*foreach (var result in cl.Results) {
             *      Console.WriteLine(result);
             * }
             *
             * Console.WriteLine("--");
             *
             * var i  = new IqdbEngine();
             * var i2 = i.GetResultAsync(q2);
             * var r2 = await i2;
             *
             * Console.WriteLine(">> {0}",r2);
             *
             * cl.Reset();
             *
             * Console.WriteLine("Search 2");
             *
             * r = cl.RunSearchAsync();
             * await r;
             * foreach (var result in cl.Results)
             * {
             *      Console.WriteLine(result);
             * }*/
        }
Beispiel #2
0
        public async Task TestAscii2D(string art)
        {
            var q  = new ImageQuery(art);
            var i  = new Ascii2DEngine();
            var rt = i.GetResultAsync(q);
            var t  = await rt;


            var a = t.IsNonPrimitive;


            var b = t.OtherResults.Any(r =>
            {
                return(r.DetailScore >= 3 && r.Site != null);
            });

            Assert.True(a || b);
        }