6 public static partial class ArithmeticsOperations
20 float[] Data = M.
Data;
23 for (y = 0; y < h; y++, Index += Skip)
25 for (x = 0; x < w; x++)
28 Data[Index++] = v * Scale + Offset;
42 M.ScalarLinearTransform(Scale, PreOffset * Scale + PostOffset);
53 int ScaleDenominator,
int Offset)
60 int sd2 = ScaleDenominator >> 1;
63 for (y = 0; y < h; y++, Index += Skip)
65 for (x = 0; x < w; x++)
68 Data[Index++] = (int)((((
long)v) * ScaleNumerator + sd2) / ScaleDenominator) + Offset;
82 int ScaleNumerator,
int ScaleDenominator,
int PostOffset)
84 PostOffset = (int)((((
long)PreOffset) * ScaleNumerator + (PostOffset >> 1)) / ScaleDenominator) + PostOffset;
85 M.ScalarLinearTransform(ScaleNumerator, ScaleDenominator, PostOffset);
static void ScalarLinearTransform(this Matrix< float > M, float Scale, float Offset)
Performs a scalar linear transform (x*Scale+Offset) on each element in the matrix.
static void ScalarLinearTransform(this Matrix< int > M, int ScaleNumerator, int ScaleDenominator, int Offset)
Performs a scalar linear transform (x*Scale+Offset) on each element in the matrix.
static void ScalarLinearTransform(this Matrix< float > M, float PreOffset, float Scale, float PostOffset)
Performs a scalar linear transform ((x+PreOffset)*Scale+PostOffset) on each element in the matrix.
static void ScalarLinearTransform(this Matrix< int > M, int PreOffset, int ScaleNumerator, int ScaleDenominator, int PostOffset)
Performs a scalar linear transform ((x+PreOffset)*Scale+PostOffset) on each element in the matrix.
Implements a Matrix, basic component for computations in Image Processing and Computer Vision.
int Height
Height of matrix (number of rows)
T[] Data
Underlying data on which the matrix is defined.
int Width
Width of matrix (number of columns)
int Skip
Number of elements to skip from the right edge in the underlying data to the left edge of the new row...
int Start
Start offset of matrix in underlying data.