void CheckUnknown(CGColorSpace cs) { Assert.That(cs.Components, Is.EqualTo((nint)0), "Unknown-0"); Assert.That(cs.Handle, Is.EqualTo(IntPtr.Zero), "Unknown-Handle"); Assert.That(cs.Model, Is.EqualTo(CGColorSpaceModel.Unknown), "Unknown-Model"); Assert.That(cs.GetColorTable().Length, Is.EqualTo(0), "Unknown-GetColorTable"); }
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"); } }
void CheckIndexedFile(CGImage img) { CGColorSpace cs = img.ColorSpace; Assert.That(cs.Components, Is.EqualTo((nint)1), "Components"); Assert.That(cs.Model, Is.EqualTo(CGColorSpaceModel.Indexed), "GetBaseColorSpace"); var table = cs.GetColorTable(); Assert.That(table.Length, Is.EqualTo(768), "GetColorTable"); cs.Dispose(); }