Пример #1
0
 public IntRect(IntPoint2D topleft, RectSize size)
     : this(topleft.X, topleft.Y, size)
 {
     Contract.Requires <ArgumentOutOfRangeException>(size.Width > 0);
     Contract.Requires <ArgumentOutOfRangeException>(size.Height > 0);
     Contract.Ensures(this.Width == size.Width);
     Contract.Ensures(this.Height == size.Height);
     Contract.Ensures(this.Left == topleft.X);
     Contract.Ensures(this.Top == topleft.Y);
 }
Пример #2
0
 public IntRect(int left, int top, RectSize size)
     : this(left, top, size.Width, size.Height)
 {
     Contract.Requires <ArgumentOutOfRangeException>(size.Width > 0);
     Contract.Requires <ArgumentOutOfRangeException>(size.Height > 0);
     Contract.Ensures(this.Width == size.Width);
     Contract.Ensures(this.Height == size.Height);
     Contract.Ensures(this.Left == left);
     Contract.Ensures(this.Top == top);
 }
Пример #3
0
        public override bool Equals(object obj)
        {
            if ((obj == null) || (obj.GetType() != typeof(RectSize)))
            {
                return(false);
            }
            RectSize x = (RectSize)obj;

            return(this.Equals(x));
        }
Пример #4
0
 public void CcdCam_GetSize(int deviceId, out RectSize size)
 {
     size = getCam(deviceId).Size;
 }
Пример #5
0
        void AcqProc()
        {
            reqStopStreaming.Reset();

            Trace.TraceInformation("Setting up 'frame start' output signal lines");
            SetupOutputSignal_FrameStart(rtsiLine: 0);
            //session.SignalEvents.AddSignal("Frame done",
            //    new ImaqSignalEventDescriptor(ImaqSignalStatus.FrameDone,
            //        ImaqSignalState.High));

            RectSize size           = PostBinningRoiSize;
            bool     recycleBuffers = (buffers != null) &&
                                      (buffers.Count == nDriverFrameBuffers) &&
                                      (bufferSize == size);

            if (!recycleBuffers)
            {
                Trace.TraceInformation("Allocating {0} buffers...", nDriverFrameBuffers);
                buffers = session.CreateBufferCollection(nDriverFrameBuffers,
                                                         ImaqBufferCollectionType.PixelValue2D);
                bufferSize = size;
                Trace.TraceInformation("Setting up buffer ring...");
                session.RingSetup(buffers, 0, false);
            }

            Trace.TraceInformation("Starting acquisition...");
            session.Start();


            int frameIndex = -1;

            startedStreaming.Set();
            while (!reqStopStreaming.WaitOne(0))
            {
                uint extractedBufferIndex;

                ImaqBuffer buf = session.Acquisition.Extract(
                    (uint)(frameIndex + 1), out extractedBufferIndex);

                if (extractedBufferIndex != frameIndex + 1)
                {
                    Trace.TraceWarning("Skipped from frame {0} to frame {1}",
                                       frameIndex, extractedBufferIndex);
                }

                frameIndex = (int)extractedBufferIndex;

                RingBufferForOutput.TryCopyIn <NF, VideoFrame>(frameCopierDelegate,
                                                               new NF(frameIndex, buf));


                Action a = Interlocked.Exchange(ref pauseAndExecute, null);
                if (a != null)
                {
                    Trace.TraceInformation("Pausing acquisition to execute an interrupt....");
                    session.Stop();
                    Trace.TraceInformation("Executing...");
                    a();
                    Trace.TraceInformation("Restarting acquisition...");
                    session.Start();
                }
            }

            session.Stop();
        }
Пример #6
0
 public bool Equals(RectSize x)
 {
     return(this == x);
 }
Пример #7
0
        public void DmdCam_GetSize(int screenId, out RectSize size)
        {
            Screen s = validateScreen(screenId);

            size = new RectSize(s.Bounds.Width, s.Bounds.Height);
        }