AJA NTV2 SDK  17.0.1.1246
NTV2 SDK 17.0.1.1246
ntv2cscmatrix.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
8 #ifndef NTV2_CSCMATRIX_H
9 #define NTV2_CSCMATRIX_H
10 
11 
12 #include "ajatypes.h"
13 #include "ajaexport.h"
14 #include "ntv2enums.h"
15 #include "ntv2card.h"
16 
17 
18 const int16_t NTV2_CSCMatrix_ZeroOffset = 0x0000;
19 const int16_t NTV2_CSCMatrix_SMPTEYOffset = 0x0800; // 0x10 with added ms sign bit and ls-padded to 16 bits
20 const int16_t NTV2_CSCMatrix_SMPTECOffset = 0x4000; // 0x80 with added ms sign bit and ls-padded to 16 bits
21 
22 
23 typedef enum NTV2CSCCoeff
24 {
28 
32 
37 
38 
39 typedef enum NTV2CSCOffset
40 {
44 
49 
50 
55 const double NTV2CSCMatrix_MaxCoeffDiff = (1.0 / 4096.0);
56 
57 
99 {
100 public:
105  explicit CNTV2CSCMatrix (const NTV2ColorSpaceMatrixType inPreset = NTV2_Unity_Matrix);
106 
107 
111  virtual inline ~CNTV2CSCMatrix () {};
112 
113 
118  virtual void InitMatrix (const NTV2ColorSpaceMatrixType inPreset);
119 
120 
126  virtual double GetCoefficient (const NTV2CSCCoeffIndex inCoeffIndex) const;
127 
128 
134  virtual void SetCoefficient (const NTV2CSCCoeffIndex inCoeffIndex, const double inCoefficient);
135 
136 
142  virtual int16_t GetOffset (const NTV2CSCOffsetIndex inOffsetIndex) const;
143 
144 
150  virtual void SetOffset (const NTV2CSCOffsetIndex inOffsetIndex, const int16_t inOffset);
151 
152 
157  virtual void PreMultiply (const CNTV2CSCMatrix & inPreInstance);
158 
159 
164  virtual void PostMultiply (const CNTV2CSCMatrix & inPostInstance);
165 
166 
173  virtual void SetGain (const double inGain0, const double inGain1, const double inGain2);
174 
175 
181  virtual void SetHueRotate (const double inDegrees);
182 
183 
190  virtual void SetPreOffsets (const int16_t inOffset0, const int16_t inOffset1, const int16_t inOffset2);
191 
192 
199  virtual void AddPreOffsets (const int16_t inIncrement0, const int16_t inIncrement1, const int16_t inIncrement2);
200 
201 
208  virtual void SetPostOffsets (const int16_t inOffsetA, const int16_t inOffsetB, const int16_t inOffsetC);
209 
210 
217  virtual void AddPostOffsets (const int16_t inIncrementA, const int16_t inIncrementB, const int16_t inIncrementC);
218 
219 
225  virtual bool IsUnityMatrix (void);
226 
227 
232  virtual bool operator == (const CNTV2CSCMatrix & rhs) const;
233 
234 
239  virtual inline bool operator != (const CNTV2CSCMatrix & rhs) const {return !(*this == rhs);}
240 
241 
249  virtual bool IsEqual (const CNTV2CSCMatrix & inCSCMatrix, const double inMaxDiff = NTV2CSCMatrix_MaxCoeffDiff);
250 
251 
259  virtual bool CoeffEqual (const double inCoeff1, const double inCoeff2, const double inMaxDiff);
260 
261 
262  // Instance Data
263  private:
264  double mA0;
265  double mA1;
266  double mA2;
267 
268  double mB0;
269  double mB1;
270  double mB2;
271 
272  double mC0;
273  double mC1;
274  double mC2;
275 
276  int16_t mPreOffset0;
277  int16_t mPreOffset1;
278  int16_t mPreOffset2;
279 
280  int16_t mPostOffsetA;
281  int16_t mPostOffsetB;
282  int16_t mPostOffsetC;
283 
284  NTV2ColorSpaceMatrixType mPreset;
285 
286 }; // CNTV2CSCMatrix
287 
288 #endif // NTV2_CSCMATRIX_H
ajaexport.h
Defines the import/export macros for producing DLLs or LIBs.
NTV2CSCOffset
NTV2CSCOffset
Definition: ntv2cscmatrix.h:39
NTV2CSCCoeffIndex_A0
@ NTV2CSCCoeffIndex_A0
Proportion of input component 0 applied to A output.
Definition: ntv2cscmatrix.h:25
NTV2CSCOffsetIndex_Pre1
@ NTV2CSCOffsetIndex_Pre1
Definition: ntv2cscmatrix.h:42
NTV2CSCOffsetIndex_PostC
@ NTV2CSCOffsetIndex_PostC
Definition: ntv2cscmatrix.h:47
CNTV2CSCMatrix
This class supports the color space conversion matrix described below.
Definition: ntv2cscmatrix.h:98
CNTV2CSCMatrix::~CNTV2CSCMatrix
virtual ~CNTV2CSCMatrix()
My destructor.
Definition: ntv2cscmatrix.h:111
NTV2CSCCoeff
NTV2CSCCoeff
Definition: ntv2cscmatrix.h:23
NTV2CSCCoeffIndex_C0
@ NTV2CSCCoeffIndex_C0
Proportion of input component 0 applied to C output.
Definition: ntv2cscmatrix.h:33
NTV2_CSCMatrix_SMPTECOffset
const int16_t NTV2_CSCMatrix_SMPTECOffset
Definition: ntv2cscmatrix.h:20
NTV2CSCMatrix_MaxCoeffDiff
const double NTV2CSCMatrix_MaxCoeffDiff
This is used to compare CSC Matrix coefficients – the default amount by which they can differ and sti...
Definition: ntv2cscmatrix.h:55
ajatypes.h
Declares the most fundamental data types used by NTV2. Since Windows NT was the first principal devel...
NTV2CSCOffsetIndex_PostA
@ NTV2CSCOffsetIndex_PostA
Definition: ntv2cscmatrix.h:45
NTV2_CSCMatrix_SMPTEYOffset
const int16_t NTV2_CSCMatrix_SMPTEYOffset
Definition: ntv2cscmatrix.h:19
ntv2card.h
Declares the CNTV2Card class.
NTV2_CSCMatrix_ZeroOffset
const int16_t NTV2_CSCMatrix_ZeroOffset
Definition: ntv2cscmatrix.h:18
NTV2CSCCoeffIndex_B0
@ NTV2CSCCoeffIndex_B0
Proportion of input component 0 applied to B output.
Definition: ntv2cscmatrix.h:29
ntv2enums.h
Enumerations for controlling NTV2 devices.
NTV2CSCCoeffIndex
enum NTV2CSCCoeff NTV2CSCCoeffIndex
NTV2CSCCoeffIndex_C2
@ NTV2CSCCoeffIndex_C2
Proportion of input component 2 applied to C output.
Definition: ntv2cscmatrix.h:35
NTV2_Unity_Matrix
@ NTV2_Unity_Matrix
Definition: ntv2enums.h:3382
NTV2CSCCoeffIndex_C1
@ NTV2CSCCoeffIndex_C1
Proportion of input component 1 applied to C output.
Definition: ntv2cscmatrix.h:34
NTV2CSCOffsetIndex
enum NTV2CSCOffset NTV2CSCOffsetIndex
NTV2CSCOffsetIndex_Pre0
@ NTV2CSCOffsetIndex_Pre0
Definition: ntv2cscmatrix.h:41
NTV2CSCOffsetIndex_Pre2
@ NTV2CSCOffsetIndex_Pre2
Definition: ntv2cscmatrix.h:43
AJAExport
#define AJAExport
Definition: export.h:33
NTV2ColorSpaceMatrixType
NTV2ColorSpaceMatrixType
Definition: ntv2enums.h:3373
NTV2CSCCoeffIndex_B2
@ NTV2CSCCoeffIndex_B2
Proportion of input component 2 applied to B output.
Definition: ntv2cscmatrix.h:31
NTV2CSCCoeffIndex_A2
@ NTV2CSCCoeffIndex_A2
Proportion of input component 2 applied to A output.
Definition: ntv2cscmatrix.h:27
NTV2CSCCoeffIndex_A1
@ NTV2CSCCoeffIndex_A1
Proportion of input component 1 applied to A output.
Definition: ntv2cscmatrix.h:26
NTV2CSCCoeffIndex_B1
@ NTV2CSCCoeffIndex_B1
Proportion of input component 1 applied to B output.
Definition: ntv2cscmatrix.h:30
NTV2CSCOffsetIndex_PostB
@ NTV2CSCOffsetIndex_PostB
Definition: ntv2cscmatrix.h:46