/// <summary>
        /// Use a supplied cubic interpolator to scale the source matrix into the target matrix.
        /// </summary>
        public static void SetScaledCubic(this Matrix <float, C4f> targetMat, Matrix <float, C4f> sourceMat,
                                          Func <double, Tup4 <float> > interpolator)
        {
            var scale = sourceMat.Size.ToV2d() / targetMat.Size.ToV2d();

            targetMat.SetScaled16(sourceMat, scale.X, scale.Y, 0.5 * scale.X - 0.5, 0.5 * scale.Y - 0.5,
                                  interpolator, interpolator, C4f.LinCom, C4f.LinCom,
                                  Tensor.Index4SamplesClamped, Tensor.Index4SamplesClamped);
        }
        /// <summary>
        /// Use a supplied cubic interpolator to scale the source matrix into the target matrix.
        /// </summary>
        public static void SetScaledCubic(this Matrix <byte, C3b> targetMat, Matrix <byte, C3b> sourceMat,
                                          Func <double, Tup4 <float> > interpolator)
        {
            var scale = sourceMat.Size.ToV2d() / targetMat.Size.ToV2d();

            targetMat.SetScaled16(sourceMat, scale.X, scale.Y, 0.5 * scale.X - 0.5, 0.5 * scale.Y - 0.5,
                                  interpolator, interpolator, C3b.LinComRawC3f, C3f.LinCom,
                                  Tensor.Index4SamplesClamped, Tensor.Index4SamplesClamped,
                                  col => col.Map(Col.ByteFromByteInFloatClamped));
        }
        /// <summary>
        /// Use a supplied cubic interpolator to scale the source matrix into the target matrix.
        /// </summary>
        public static void SetScaledCubic(this Matrix <ushort, C4us> targetMat, Matrix <ushort, C4us> sourceMat,
                                          Func <double, Tup4 <float> > interpolator)
        {
            var scale = sourceMat.Size.ToV2d() / targetMat.Size.ToV2d();

            targetMat.SetScaled16(sourceMat, scale.X, scale.Y, 0.5 * scale.X - 0.5, 0.5 * scale.Y - 0.5,
                                  interpolator, interpolator, C4us.LinComRawC4f, C4f.LinCom,
                                  Tensor.Index4SamplesClamped, Tensor.Index4SamplesClamped,
                                  col => col.Map(Col.UShortFromUShortInFloatClamped));
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Use a supplied cubic interpolator to scale the source matrix into the target matrix.
        /// </summary>
        public static void SetScaledCubic(this Matrix <__dtct__> targetMat, Matrix <__dtct__> sourceMat,
                                          Func <double, Tup4 <float> > interpolator)
        {
            var scale = sourceMat.Size.ToV2d() / targetMat.Size.ToV2d();

            targetMat.SetScaled16(sourceMat, scale.X, scale.Y, 0.5 * scale.X - 0.5, 0.5 * scale.Y - 0.5,
                                  interpolator, interpolator, __ct__.LinCom__rfct__, __fct__.LinCom,
                                  Tensor.Index4SamplesClamped, Tensor.Index4SamplesClamped /*#
                                                                                            * if (clampVal) { */,
                                  Col.__dtn__From__dtn__InFloatClamped /*#
                                                                        * } else if (clampMap) { */,
                                  col => col.Map(Col.__dtn__From__dtn__InFloatClamped) /*# } */);
        }