xamarin-macios/tests/monotouch-test/CoreImage/CIFilter.cs

42 строки
816 B
C#
Исходник Обычный вид История

#if __MACOS__
2016-05-26 16:06:52 +03:00
using NUnit.Framework;
using System;
using AppKit;
using Foundation;
2016-05-26 16:06:52 +03:00
using ObjCRuntime;
using CoreImage;
using CoreGraphics;
namespace Xamarin.Mac.Tests
{
[TestFixture]
[Preserve (AllMembers = true)]
2016-05-26 16:06:52 +03:00
public class CIFilterTests
{
[Test]
public void CIFilterOutputImageTest ()
{
NSImage nsImg = new NSImage (new CGSize (400, 400));
nsImg.LockFocus ();
NSColor.Red.SetFill ();
NSBezierPath.FillRect (new CGRect (0, 0, 400, 400));
nsImg.UnlockFocus ();
CIImage img = CIImage.FromCGImage (nsImg.CGImage);
var gloom = new CIGloom () {
#if NET
InputImage = img,
#else
2016-05-26 16:06:52 +03:00
Image = img,
#endif
2016-05-26 16:06:52 +03:00
Intensity = 5,
Radius = 1
};
var output = gloom.OutputImage;
Assert.IsNotNull (output, "CIFilterOutputImageTest - output was null");
}
}
}
#endif // __MACOS__