/// <summary>
        /// Detects all markers in the bitmap.
        /// </summary>
        /// <param name="bitmap">The WriteableBitmap which should be searched for markers.</param>
        /// <returns>The results of the detection.</returns>
        public DetectionResults DetectAllMarkers(WriteableBitmap bitmap)
        {
            // Check argument
            if (bitmap == null)
            {
                throw new ArgumentNullException("bitmap");
            }

            // Update buffer and check size
            writeableBitmapReader.Bitmap = bitmap;
            buffer.XrgbReader            = writeableBitmapReader;
            if (!filteredBuffer.getSize().isEqualSize(buffer.getSize()))
            {
                throw new ArgumentException("The size of the xrgbReader differs from the initialized size.", "bitmap");
            }

            // Detect markers
            return(DetectAllMarkers(buffer));
        }
Beispiel #2
0
        /// <summary>
        /// Detects all markers in the buffer.
        /// </summary>
        /// <param name="buffer">The buffer containing byte brightness values which should be searched for markers.</param>
        /// <param name="width">The width of the buffer.</param>
        /// <param name="height">The height of the buffer.</param>
        /// <returns>The results of the detection.</returns>
        public DetectionResults DetectAllMarkers(byte[] buffer, int width, int height)
        {
            // Check argument
            if (buffer == null)
            {
                throw new ArgumentNullException("buffer");
            }

            // Update buffer and check size
            grayBufferReader.Buffer = buffer;
            grayBufferReader.Width  = width;
            grayBufferReader.Height = height;
            raster.XrgbReader       = grayBufferReader;
            if (!filteredBuffer.getSize().isEqualSize(raster.getSize()))
            {
                throw new ArgumentException("The size of the GrayReader differs from the initialized size.", "buffer");
            }

            // Detect markers
            return(DetectAllMarkers(raster));
        }