예제 #1
0
        /// <summary>
        /// Push multiple elements to the sequence
        /// </summary>
        /// <param name="data">The data to push to the sequence</param>
        /// <param name="backOrFront">Specify if pushing to the back or front</param>
        public void PushMulti(T[] data, CvEnum.BackOrFront backOrFront)
        {
            GCHandle handle = GCHandle.Alloc(data, GCHandleType.Pinned);

            CvInvoke.cvSeqPushMulti(Ptr, handle.AddrOfPinnedObject(), data.Length, backOrFront);
            handle.Free();
        }
예제 #2
0
        /// <summary>
        /// Pop multiple elements from the sequence
        /// </summary>
        /// <param name="count">The number of elements to be poped</param>
        /// <param name="backOrFront">The location the pop operation is started</param>
        /// <returns>The elements poped from the sequence</returns>
        public T[] PopMulti(int count, CvEnum.BackOrFront backOrFront)
        {
            count = Math.Min(count, Total);
            T[]      res    = new T[count];
            GCHandle handle = GCHandle.Alloc(res, GCHandleType.Pinned);

            CvInvoke.cvSeqPopMulti(Ptr, handle.AddrOfPinnedObject(), count, backOrFront);
            handle.Free();
            return(res);
        }