34 private const int _numberOfRows = 3;
35 private const int _numberOfColumns = 3;
36 private readonly
string _name =
"Matrix";
74 { matrix.m_00, matrix.m_01, matrix.m_02 },
75 { matrix.m_10, matrix.m_11, matrix.m_12 },
76 { matrix.m_20, matrix.m_21, matrix.m_22 }
85 public new static IEqualityComparer<ColorCorrectionMatrix>
Comparer {
get; } =
new MatrixEqualityComparer();
100 archive.
SetDoubleArray(_name, Flatten().Select(x => (
double) x).ToArray());
121 $
"ColorCorrectionMatrix requires exactly 9 elements, but {values.Count} values were given.");
124 Values = To2DArray(values.Select(x => (
float) x).ToArray(),
Rows,
Columns);
139 var data =
new float[9];
140 for (var i = 0; i < _numberOfRows; i++)
142 data[i * _numberOfRows + i] = value;
Occurs when reading from a file or stream that is incomplete, damaged, or in an unexpected format.
void Serialize(IArchive archive)
Serializes the object's internal state into the provided archive.
ColorCorrectionMatrix(string name, float[,] data)
Creates an instance of class ColorCorrectionMatrix.
ColorCorrectionMatrix(float[] data)
Creates an instance of class ColorCorrectionMatrix with data .
ColorCorrectionMatrix(float[,] data)
Creates an instance of class ColorCorrectionMatrix with data .
static ColorCorrectionMatrix Identity()
Constructs a uniform identity matrix.
void Deserialize(IArchive archive)
Restores the object's state from the provided archive.
static ColorCorrectionMatrix Diagonal(float value)
Constructs a uniform diagonal matrix.
static new IEqualityComparer< ColorCorrectionMatrix > Comparer
Gets a default equality comparer for comparing ColorCorrectionMatrix data values.
Represents a generic 2D matrix of elements with a specified number of rows and columns.
Represents a hierarchical, strongly-typed key-value archive.
IReadOnlyList< double > GetDoubleArray(string key)
Retrieves an array of double-precision floating-point values by key.
void SetDoubleArray(string key, IEnumerable< double > value)
Stores an array of double-precision floating-point values under the specified key.
Interface for objects that can be serialized to and deserialized from an archive.