Ejemplo n.º 1
0
        /// <summary>
        /// Gets a pixel of the sub-aperture image.
        /// </summary>
        /// <param name="x">The x coordinate of the pixel.</param>
        /// <param name="y">The y coordinate of the pixel.</param>
        /// <returns>a pixel of the sub-aperture image at specified location.</returns>
        public ColorRgba128Float this[int x, int y]
        {
            get
            {
                MicroLens lens = _mla[_xMin + x, _yMin + y, _u, _v];

                double rawX = lens.CenterX;
                double rawY = lens.CenterY;
                if (rawX < 0 || rawY < 0 || rawX >= _width || rawY >= _height)
                {
                    return(default(ColorRgba128Float));
                }

                return(_rawImage[rawX, rawY]);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="UVImage"/> class.
        /// </summary>
        /// <param name="rawImage">The raw sensor image.</param>
        /// <param name="lens">The microlens which image to represent.</param>
        public UVImage(ISampled2D <ColorRgb128Float> rawImage, MicroLens lens)
        {
            if (rawImage == null)
            {
                throw new ArgumentNullException("rawImage");
            }

            if (lens == null)
            {
                throw new ArgumentNullException("lens");
            }

            _rawImage = new InterpolatedImage(rawImage);

            _lens   = lens;
            _width  = rawImage.Width;
            _height = rawImage.Height;

            _xMin = -lens.Diameter / 2;
            _yMin = -lens.Diameter / 2;
        }