Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="parallel"></param>
        /// <returns></returns>
        public GridVectorField2d GetGradient(bool parallel = false)
        {
            GridVectorField2d result = new GridVectorField2d(this);

            GetGradient(result.Values, parallel);
            return(result);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public GridVectorField2d Duplicate(bool copyValues)
        {
            var result = new GridVectorField2d(this);

            if (copyValues)
            {
                result.Set(this);
            }
            return(result);
        }
Ejemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="bitmap"></param>
        /// <param name="mapper"></param>
        /// <param name="interval"></param>
        /// <returns></returns>
        public static GridVectorField2d CreateFromImage(Bitmap bitmap, Func <Color, Vec2d> mapper, Interval2d interval)
        {
            int nx = bitmap.Width;
            int ny = bitmap.Height;

            var result = new GridVectorField2d(interval, nx, ny);

            FieldIO.ReadFromImage(bitmap, result, mapper);

            return(result);
        }