Пример #1
0
        public void WithMetadataDefaults()
        {
            var options = new CIImageInitializationOptionsWithMetadata();

            Assert.That(options.Dictionary.Count, Is.EqualTo(0), "Count");
            Assert.Null(options.Properties, "Properties");
        }
        public void WithMetadataDefaults()
        {
            TestRuntime.AssertSystemVersion(PlatformName.MacOSX, 10, 8, throwIfOtherPlatform: false);

            var options = new CIImageInitializationOptionsWithMetadata();

            Assert.That(options.Dictionary.Count, Is.EqualTo(0), "Count");
            Assert.Null(options.Properties, "Properties");
        }
Пример #3
0
        public void WithMetadataProperties()
        {
            var suboptions = new CGImageProperties()
            {
                ProfileName = "Xamarin"
            };
            var options = new CIImageInitializationOptionsWithMetadata()
            {
                Properties = suboptions
            };

            Assert.That(options.Dictionary.Count, Is.EqualTo(1), "Count");
            Assert.That(options.Properties.ProfileName, Is.EqualTo("Xamarin"), "Properties");
        }
        public void WithMetadataProperties()
        {
            TestRuntime.AssertSystemVersion(PlatformName.MacOSX, 10, 8, throwIfOtherPlatform: false);

            var suboptions = new CGImageProperties()
            {
                ProfileName = "Xamarin"
            };
            var options = new CIImageInitializationOptionsWithMetadata()
            {
                Properties = suboptions
            };

            Assert.That(options.Dictionary.Count, Is.EqualTo(1), "Count");
            Assert.That(options.Properties.ProfileName, Is.EqualTo("Xamarin"), "Properties");
        }
Пример #5
0
        public void InitializationWithCustomMetadata()
        {
            string file = Path.Combine(NSBundle.MainBundle.ResourcePath, "basn3p08.png");

            using (var dp = new CGDataProvider(file)) {
                using (var img = CGImage.FromPNG(dp, null, false, CGColorRenderingIntent.Default)) {
                    var opt = new CIImageInitializationOptionsWithMetadata()
                    {
                        Properties = new CGImageProperties()
                        {
                            ProfileName = "test profile name"
                        }
                    };

                    using (var ci = new CIImage(img, opt)) {
                        Assert.AreEqual("test profile name", ci.Properties.ProfileName);
                    }
                }
            }
        }