root/lang/cpluspluscli/OpenCvSharp/sample/OpenCvSharpSample/Sample/SeqTest.cs @ 21039

Revision 21039, 0.9 kB (checked in by schima, 5 years ago)

サンプルの構造を色々変更

Line 
1using System;
2using System.Collections.Generic;
3using System.Text;
4using KwsmLab.OpenCvSharp;
5
6namespace KwsmLab.OpenCvSharpSample
7{
8    static partial class Sample
9    {
10        /// <summary>
11        /// CvSeqのテスト
12        /// </summary>
13        unsafe public static void SeqTest()
14        {
15            using (CvMemStorage storage = new CvMemStorage(0)) {
16                CvSeq seq = new CvSeq(SeqType.EltypeS32C1, CvSeq.SizeOf, sizeof(int), storage);
17                for (int i = 0; i < 10; i++) {
18                    int push = seq.Push(i);
19                    Console.WriteLine("{0} is pushed", push);
20                }
21                Console.WriteLine("----------");
22                for (int i = 0; i < 10; i++) {
23                    int pop = seq.Pop<int>();
24                    Console.WriteLine("{0} is popped", pop);
25                }
26                Console.ReadKey();
27            }
28        }
29    }
30}
Note: See TracBrowser for help on using the browser.