コード例 #1
0
        public void Create()
        {
            // 0 is not defined
            Assert.Null(CVPixelFormatDescription.Create(0), "0");

            using (var dict = CVPixelFormatDescription.Create(CVPixelFormatType.CV16Gray)) {
                Assert.NotNull(dict, "CV16Gray");
            }

            using (var dict = CVPixelFormatDescription.Create(CVPixelFormatType.CV32ARGB)) {
                Assert.NotNull(dict, "CV32ARGB");
            }
        }
コード例 #2
0
        public void Register()
        {
            if (registerDone)
            {
                Assert.Ignore("This test can only be executed once, it modifies global state.");
            }
            registerDone = true;

            Assert.Null(CVPixelFormatDescription.Create((CVPixelFormatType)3), "3a");

            using (var dict = CVPixelFormatDescription.Create(CVPixelFormatType.CV24RGB)) {
                Assert.NotNull(dict, "CV24RGB");
                CVPixelFormatDescription.Register(dict, (CVPixelFormatType)3);
            }

            Assert.NotNull(CVPixelFormatDescription.Create((CVPixelFormatType)3), "3b");
        }