コード例 #1
0
        void TestICC(CGColorSpace cs)
        {
            Assert.That(cs.Components, Is.EqualTo((nint)3), "Components");
            Assert.That(cs.Model, Is.EqualTo(CGColorSpaceModel.RGB), "Model");
            Assert.Null(cs.GetBaseColorSpace(), "GetBaseColorSpace");
            // not indexed so no color table
            Assert.That(cs.GetColorTable().Length, Is.EqualTo(0), "GetColorTable");

#if NET
            using (var icc_profile = cs.GetIccProfile())
                Assert.That(icc_profile.Length, Is.EqualTo((nuint)3284), "GetIccProfile");
#else
            using (var icc_profile = cs.GetICCProfile())
                Assert.That(icc_profile.Length, Is.EqualTo((nuint)3284), "GetICCProfile");
#endif

            if (TestRuntime.CheckXcodeVersion(8, 0))
            {
                Assert.Null(cs.Name, "Name");
                Assert.False(cs.IsWideGamutRgb, "IsWideGamutRgb");
                Assert.True(cs.SupportsOutput, "SupportsOutput");
                using (var icc_data = cs.GetIccData())
                    Assert.That(icc_data.Length, Is.EqualTo((nuint)3284), "GetIccData");
            }
        }