예제 #1
0
        public void Create()
        {
            var vector = new StdVector <ChipDetails>();

            this.DisposeAndCheckDisposedState(vector);
        }
예제 #2
0
파일: Interface.cs 프로젝트: rtshadow/miscs
        private D3D10.Sprite sprite; //2D sprite which is used to draw interface modules (only to speed up the whole process)

        #endregion Fields

        #region Constructors

        //Interface creation classes
        /// <summary>
        /// Private constructor, 'cos it is a singleton. It makes basic preparations for drawing/using the user interface
        /// </summary>
        /// <param name="d">Instance of DX10 device</param>
        private Interface()
        {
            sprite = new SlimDX.Direct3D10.Sprite(Game.gameClass.GetDevice(), 100);
            modules = new StdVector<InterfaceModule>(10);
            modulesNames = new Dictionary<string, InterfaceModule>();
        }
        public void Create()
        {
            var vector = new StdVector <Matrix <ushort> >();

            this.DisposeAndCheckDisposedState(vector);
        }
예제 #4
0
        public void Create()
        {
            var vector = new StdVector <Point>();

            this.DisposeAndCheckDisposedState(vector);
        }
예제 #5
0
 public Enumerator(ref StdVector <T> vector)
 {
     mVector = vector;
 }
예제 #6
0
        public void Operator <T>(
            uint numCrops,
            IEnumerable <Matrix <T> > images,
            IEnumerable <IEnumerable <MModRect> > rects,
            out IEnumerable <Matrix <T> > crops,
            out IEnumerable <IEnumerable <MModRect> > cropRects)
            where T : struct
        {
            if (images == null)
            {
                throw new ArgumentNullException(nameof(images));
            }
            if (rects == null)
            {
                throw new ArgumentNullException(nameof(rects));
            }

            var count   = images.Count();
            var numRect = rects.Count();

            if (count != numRect)
            {
                throw new ArgumentException();
            }

            List <StdVector <MModRect> > listOfVectorOfMModRect = null;

            try
            {
                listOfVectorOfMModRect = rects.Select(r => new StdVector <MModRect>(r)).ToList();

                using (var matrix = new Matrix <T>())
                    using (var inImages = new StdVector <Matrix <T> >(images))
                        using (var inRects = new StdVector <StdVector <MModRect> >(listOfVectorOfMModRect))
                            using (var outCrops = new StdVector <Matrix <T> >())
                                using (var outCropRects = new StdVector <StdVector <MModRect> >())
                                {
                                    var type = matrix.MatrixElementType.ToNativeMatrixElementType();
                                    var ret  = Native.random_cropper_operator(this.NativePtr,
                                                                              numCrops,
                                                                              type,
                                                                              inImages.NativePtr,
                                                                              inRects.NativePtr,
                                                                              outCrops.NativePtr,
                                                                              outCropRects.NativePtr);
                                    if (ret == Dlib.Native.ErrorType.MatrixElementTypeNotSupport)
                                    {
                                        throw new ArgumentException($"{type} is not supported.");
                                    }

                                    crops     = outCrops.ToArray();
                                    cropRects = outCropRects.ToArray().Select(box => box.ToArray()).ToList();
                                }
            }
            finally
            {
                if (listOfVectorOfMModRect != null)
                {
                    foreach (var stdVector in listOfVectorOfMModRect)
                    {
                        stdVector?.Dispose();
                    }
                }
            }
        }
        public void Create()
        {
            var vector = new StdVector <StdVector <Rectangle> >();

            this.DisposeAndCheckDisposedState(vector);
        }