Exemple #1
0
        public void Profile()
        {
            var p = new CircularProfile(1500);

            var i = p.RenderImage(1000, 1000, new RectangleF(-2000, -2000, 4000, 4000), ScaleMode.STRETCH, new CircularProfileRenderer(), null);

            var signature = i.Item.GetSignature();
            Assert.AreEqual("B1FF0A62F65DD493C2781D6D9FB57C4F588F9B0E767EEBAC6219E01EA5A5DF4D", signature, "Image hash");
        }
Exemple #2
0
        public static CircularProfile GetTestProfile(double radius, double stepping = 1f, double resolution = 1f)
        {
            var p = new CircularProfile(radius);

            p.AddProfileFlat(-Math.PI / 2, radius - 100, 100, stepping);
            p.AddProfileFlat(7 * Math.PI / 4, radius - 200, 100, stepping);
            //p.AddProfileFlat(-Math.PI / 4, radius - 200, 100, stepping);
            p.AddProfileFlat(0, radius - 300, 100, stepping, resolution);
            p.AddProfileFlat(Math.PI / 3f, radius - 400, 200, stepping, resolution);
            p.AddProfileFlat(2f * Math.PI / 3f, radius - 500, 400, stepping, resolution);

            return p;
        }
Exemple #3
0
        public void ProfileWithFlat()
        {
            var search = new CircularProfile(1000);

            search.AddProfileFlatByLength(0, 1500);
            search.AddProfileFlatByLength(Math.PI, 500, 0.0001, 500);
            search.AddProfileFlat(Math.PI / 2f, 200, 1000);
            search.AddProfileStep(-Math.PI / 4, 1000);
            search.AddProfileStep(-3 * Math.PI / 4, 800);

            var signature =
                search.RenderImage(1000, 1000, new RectangleF(-1000, -1000, 2000, 2000), ScaleMode.STRETCH, new CircularProfileRenderer(), null)
                    .Item.GetSignature();
            Assert.AreEqual("EED4365394FDB98CE5A4566244C50FA9925A28F54F8561533295FAC5E4B91FE4", signature, "Image hash");
        }
Exemple #4
0
        public void ProfileWith0()
        {
            var search = new CircularProfile(1000);

            for (var a = 0; a < 4; a++)
            {
                var a0 = -13f * Math.PI / 12f + a * Math.PI / 2f;
                var a1 = -11f * Math.PI / 12f + a * Math.PI / 2f;
                search.AddProfileStep(a0, 0);
                search.AddProfileStep(a1, 1000);
            }

            var signature =
                search.RenderImage(1000, 1000, new RectangleF(-1000, -1000, 2000, 2000), ScaleMode.STRETCH, new CircularProfileRenderer(), null)
                    .Item.GetSignature();
            Assert.AreEqual("98AE8580E2596469A774C97BEE234564E96281C519BFFED621FBB8CC2A63F6D8", signature, "Image hash");
        }