AJA NTV2 SDK  17.5.0.1242
NTV2 SDK 17.5.0.1242
ntv2csclut.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
8 #include "ntv2card.h"
9 #include "ntv2devicefeatures.h"
10 #include "ntv2utils.h"
11 #include "ntv2registerexpert.h"
12 #include "ajabase/system/debug.h"
13 #include <math.h>
14 #include <assert.h>
15 #if defined (AJALinux)
17 #elif defined (MSWindows)
18  #pragma warning(disable: 4800)
19 #endif
20 #include <deque>
21 
22 #define HEX16(__x__) "0x" << hex << setw(16) << setfill('0') << uint64_t(__x__) << dec
23 #define INSTP(_p_) HEX16(uint64_t(_p_))
24 #define CSCFAIL(__x__) AJA_sERROR (AJA_DebugUnit_CSC, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
25 #define CSCWARN(__x__) AJA_sWARNING(AJA_DebugUnit_CSC, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
26 #define CSCNOTE(__x__) AJA_sNOTICE (AJA_DebugUnit_CSC, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
27 #define CSCINFO(__x__) AJA_sINFO (AJA_DebugUnit_CSC, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
28 #define CSCDBG(__x__) AJA_sDEBUG (AJA_DebugUnit_CSC, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
29 
30 #define LUTFAIL(__x__) AJA_sERROR (AJA_DebugUnit_LUT, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
31 #define LUTWARN(__x__) AJA_sWARNING(AJA_DebugUnit_LUT, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
32 #define LUTNOTE(__x__) AJA_sNOTICE (AJA_DebugUnit_LUT, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
33 #define LUTINFO(__x__) AJA_sINFO (AJA_DebugUnit_LUT, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
34 #define LUTDBG(__x__) AJA_sDEBUG (AJA_DebugUnit_LUT, INSTP(this) << "::" << AJAFUNC << ": " << __x__)
35 
36 using namespace std;
37 
38 
39 
40 // These static tables eliminate a lot of switch statements.
41 // CAUTION: These are predicated on NTV2Channel being ordinal (NTV2_CHANNEL1==0, NTV2_CHANNEL2==1, etc.)
42 
45 
48 
51 
54 
57 
60 
63 
64 
66 // OEM Color Correction Methods (KHD-22 only )
67 //
69 {
70  if (IS_CHANNEL_INVALID(inChannel))
71  return false;
72  return WriteRegister (inChannel == NTV2_CHANNEL1 ? kRegCh1ColorCorrectionControl : kRegCh2ColorCorrectionControl,
74 
75 }
76 
78 {
79  if (IS_CHANNEL_INVALID (inChannel))
80  return false;
83 }
84 
85 bool CNTV2Card::SetColorCorrectionOutputBank (const NTV2Channel inChannel, const ULWord inBank)
86 {
87  if (IS_CHANNEL_INVALID(inChannel))
88  return false;
89  if (GetNumSupported(kDeviceGetLUTVersion) == 2)
90  return SetLUTV2OutputBank(inChannel, inBank);
91  switch(inChannel)
92  {
98  default: return false;
99  }
100 }
101 
102 bool CNTV2Card::SetLUTV2OutputBank (const NTV2Channel inChannel, const ULWord inBank)
103 {
104  if (IS_CHANNEL_INVALID(inChannel))
105  return false;
106  switch (inChannel)
107  {
116  default: return false;
117  }
118 }
119 
121 {
122  if (IS_CHANNEL_INVALID (inChannel))
123  return false;
124  if (GetNumSupported(kDeviceGetLUTVersion) == 2)
125  return GetLUTV2OutputBank(inChannel, outBank);
126  switch(inChannel)
127  {
133  default: return false;
134  }
135 }
136 
137 bool CNTV2Card::GetLUTV2OutputBank (const NTV2Channel inChannel, ULWord & outBank)
138 {
139  if (IS_CHANNEL_INVALID(inChannel))
140  return false;
141  switch(inChannel)
142  {
151  default: return false;
152  }
153 }
154 
156 {
157  if (GetNumSupported(kDeviceGetLUTVersion) == 2)
158  return SetLUTV2HostAccessBank(inValue);
159 
160  switch(inValue)
161  {
166  if (::NTV2DeviceGetNumLUTs(GetDeviceID()) == 5 || GetDeviceID() == DEVICE_ID_IO4KUFC)
168  return false;
169  //Configure LUTs 1 and 2
172 
177  if (::NTV2DeviceGetNumLUTs(GetDeviceID()) == 5 || GetDeviceID() == DEVICE_ID_IO4KUFC)
179  return false;
180  //Configure LUTs 3 and 4
183 
190 
191  default: return false;
192  }
193 }
194 
196 {
197  switch(inValue)
198  {
201 
204 
207 
210 
213 
216 
219 
222 
223  default: return false;
224  }
225 }
226 
228 {
229  if (IS_CHANNEL_INVALID(inChannel))
230  return false;
231  if (GetNumSupported(kDeviceGetLUTVersion) == 2)
232  return GetLUTV2HostAccessBank(outValue, inChannel);
233 
234  bool result (false);
235  ULWord regValue(0);
236  switch(inChannel)
237  {
238  case NTV2_CHANNEL1:
239  case NTV2_CHANNEL2:
241 
242  case NTV2_CHANNEL3:
243  case NTV2_CHANNEL4:
246  break;
247 
248  case NTV2_CHANNEL5:
251  break;
252 
253  default: break;
254  }
255  return result;
256 }
257 
259 {
260  if (IS_CHANNEL_INVALID(inChannel))
261  return false;
262 
263  ULWord tempVal (0);
264  bool result (false);
265  switch(inChannel)
266  {
267  case NTV2_CHANNEL1:
269  break;
270 
271  case NTV2_CHANNEL2:
274  break;
275 
276  case NTV2_CHANNEL3:
279  break;
280 
281  case NTV2_CHANNEL4:
284  break;
285 
286  case NTV2_CHANNEL5:
289  break;
290 
291  case NTV2_CHANNEL6:
294  break;
295 
296  case NTV2_CHANNEL7:
299  break;
300 
301  case NTV2_CHANNEL8:
304  break;
305 
306  default: break;
307  }
308  return result;
309 }
310 
311 bool CNTV2Card::SetColorCorrectionSaturation (const NTV2Channel inChannel, const ULWord inValue)
312 {
313  if (IS_CHANNEL_INVALID(inChannel))
314  return false;
315 
316  return WriteRegister (inChannel == NTV2_CHANNEL1 ? kRegCh1ColorCorrectionControl : kRegCh2ColorCorrectionControl,
318 }
319 
321 {
322  if (IS_CHANNEL_INVALID(inChannel))
323  return false;
324 
325  return ReadRegister (inChannel == NTV2_CHANNEL1 ? kRegCh1ColorCorrectionControl : kRegCh2ColorCorrectionControl,
327 }
328 
330 {
331  return WriteRegister(kRegCh1ColorCorrectionControl, (ULWord)lutSelect, kRegMaskLUTSelect, kRegShiftLUTSelect);
332 }
333 
335 {
337 }
338 
340 {
341  ULWord has12BitLUTSupport(0);
342  return ReadRegister(kRegLUTV2Control, has12BitLUTSupport, kRegMask12BitLUTSupport, kRegShift12BitLUTSupport) && (has12BitLUTSupport ? true : false);
343 }
344 
346 {
347  if(!Has12BitLUTSupport())
348  return false;
349 
350  return WriteRegister(kRegLUTV2Control, inLUTPlaneSelect, kRegMask12BitLUTPlaneSelect, kRegShift12BitLUTPlaneSelect);
351 }
352 
354 {
355  if(!Has12BitLUTSupport())
356  return false;
357 
359 }
360 
362 
363 
364 bool CNTV2Card::SetColorSpaceMethod (const NTV2ColorSpaceMethod inCSCMethod, const NTV2Channel inChannel)
365 {
366  if (IS_CHANNEL_INVALID (inChannel))
367  return false;
368  if (::NTV2DeviceGetNumCSCs (_boardID) == 0)
369  return false;
370 
371  if (::NTV2DeviceCanDoEnhancedCSC (_boardID))
372  {
373  ULWord value (0);
374 
375  switch (inCSCMethod)
376  {
378  // Disable enhanced mode and 4K
379  break;
381  // Enable enhanced mode, but not 4K
383  break;
385  // 4K mode uses a block of four CSCs. You must set the first converter in the group.
386  if ((inChannel != NTV2_CHANNEL1) && (inChannel != NTV2_CHANNEL5))
387  return false;
388  // Enable both enhanced mode and 4K
390  break;
391  default:
392  return false;
393  }
394 
395  // Send the new control value to the hardware
397 
398  return true;
399  }
400  else
401  {
402  // It's not an error to set the original converters to the original method
403  if (inCSCMethod == NTV2_CSC_Method_Original)
404  return true;
405  }
406 
407  return false;
408 }
409 
411 {
412  outMethod = NTV2_CSC_Method_Unimplemented;
413  if (IS_CHANNEL_INVALID(inChannel))
414  return false;
415  if (!::NTV2DeviceGetNumCSCs(_boardID))
416  return false;
417 
418  outMethod = NTV2_CSC_Method_Original;
419  if (!::NTV2DeviceCanDoEnhancedCSC(_boardID))
420  return true;
421 
422  ULWord tempVal (0);
423 
424  // Check the group leader first, since that's where the 4K status bit is for all...
426  return false;
427 
429  {
430  outMethod = NTV2_CSC_Method_Enhanced_4K; // The leader is in 4K, so the other group members are as well
431  return true;
432  }
433 
434  // Each CSC is operating independently, so read the control bits for the given channel
436  return false;
437 
438  if (tempVal & kK2RegMaskEnhancedCSCEnable)
439  outMethod = NTV2_CSC_Method_Enhanced;
440  return true;
441 }
442 
443 
445 {
447  GetColorSpaceMethod(result, inChannel);
448  return result;
449 }
450 
451 
453 {
454  if (IS_CHANNEL_INVALID (channel))
455  return false;
457 }
458 
459 
461 {
462  if (IS_CHANNEL_INVALID(inChannel))
463  return false;
465 }
466 
467 
468 // STATIC:
469 bool CNTV2Card::GenerateGammaTable (const NTV2LutType inLUTType, const int inBank, NTV2DoubleArray & outTable, const NTV2LutBitDepth inBitDepth)
470 {
471  static const double kGammaMac(1.8);
472  double gamma1(0.0), gamma2(0.0), scale(0.0), fullWhite(0.0), fullBlack(0.0), smpteWhite(0.0), smpteBlack(0.0);
473  uint32_t tableSize(0);
474 
475  // 10 Bit Notes
476  // 1020 / 0x3FC is full-range white on the wire since 0x3FF/1023 is illegal
477  // 4 / 0x4 is full-range black on the wire since 0x0/0 is illegal
478  // 940 / 0x3AC is smpte-range white
479  // 64 / 0x40 is smpte-range black
480 
481  // 12 Bit Notes
482  // 4080 / 0xFF0 is full-range white on the wire since 0xFFC/4092 is illegal
483  // 16 / 0x10 is full-range black on the wire since 0x0/0 is illegal
484  // 3760 / 0xEB0 is smpte-range white
485  // 256 / 0x100 is smpte-range black
486 
487  switch(inBitDepth)
488  {
489  default:
490  case NTV2_LUT10Bit:
491  fullWhite = 1023.0;
492  fullBlack = 0.0;
493  smpteWhite = 940.0;
494  smpteBlack = 64.0;
495  tableSize = 1024;
496  outTable.reserve(tableSize);
497  while (outTable.size() < tableSize)
498  outTable.push_back(double(0.0));
499  break;
500  case NTV2_LUT12Bit:
501  fullWhite = 4092.0;
502  fullBlack = 0.0;
503  smpteWhite = 3760.0;
504  smpteBlack = 256.0;
505  tableSize = 4096;
506  outTable.reserve(tableSize);
507  while (outTable.size() < tableSize)
508  outTable.push_back(double(0.0));
509  break;
510  }
511 
512  double smpteScale = (smpteWhite - smpteBlack) - 1.0;
513 
514 
515  switch (inLUTType)
516  {
517  // Linear
518  case NTV2_LUTLinear:
519  case NTV2_LUTUnknown: // huh?
520  case NTV2_LUTCustom:
521  default:
522  for (size_t ndx = 0; ndx < tableSize; ndx++)
523  outTable[ndx] = double(ndx);
524  break;
525 
526  // RGB Full Range <=> SMPTE Range
528  if (inBank == kLUTBank_FULL2SMPTE)
529  {
530  scale = (smpteWhite - smpteBlack) / (fullWhite - fullBlack);
531 
532  for (size_t ndx = 0; ndx < tableSize; ndx++)
533  outTable[ndx] = (double(ndx) * scale) + (smpteBlack - (scale * fullBlack));
534  }
535  else // inBank == kLUTBank_SMPTE2FULL
536  {
537  scale = (fullWhite - fullBlack) / (smpteWhite - smpteBlack);
538 
539  for (size_t ndx = 0; ndx < (uint32_t)smpteBlack; ndx++)
540  outTable[ndx] = fullBlack;
541 
542  for (size_t ndx = (uint32_t)smpteBlack; ndx < (uint32_t)smpteWhite; ndx++)
543  outTable[ndx] = (double(ndx) * scale) + ((uint32_t)fullBlack - (scale * (uint32_t)smpteBlack));
544 
545  for (size_t ndx = (uint32_t)smpteWhite; ndx < tableSize; ndx++)
546  outTable[ndx] = fullWhite;
547  }
548  break; // NTV2_LUTRGBRangeFull_SMPTE
549 
550  // kGammaMac <=> Rec 601 Gamma - Full Range
552  // "gamma" (the exponent) = srcGamma / dstGamma
553  gamma1 = (inBank == kLUTBank_RGB2YUV ? (kGammaMac / 2.2) : (2.2 / kGammaMac) );
554  for (size_t ndx = 0; ndx < tableSize; ndx++)
555  outTable[ndx] = fullWhite * ::pow(double(ndx) / fullWhite, gamma1);
556  break;
557 
558  // kGammaMac <=> Rec 601 Gamma - SMPTE Range
560  // "gamma" (the exponent) = srcGamma / dstGamma
561  gamma1 = (inBank == kLUTBank_RGB2YUV ? (kGammaMac / 2.2) : (2.2 / kGammaMac) );
562  for (size_t ndx = 0; ndx < tableSize; ndx++)
563  {
564  if (ndx <= (uint32_t)smpteBlack || ndx >= (uint32_t)smpteWhite)
565  outTable[ndx] = double(ndx);
566  else
567  outTable[ndx] = smpteScale * ::pow((double(ndx) - smpteBlack) / smpteScale, gamma1) + smpteBlack;
568  }
569  break; // NTV2_LUTGamma18_Rec601_SMPTE
570 
571  // kGammaMac <=> Rec 709 Gamma - Full Range
573  if (inBank == kLUTBank_RGB2YUV)
574  {
575  gamma1 = kGammaMac;
576  gamma2 = 0.45;
577  for (size_t ndx = 0; ndx < tableSize; ndx++)
578  { // remove the kGammaMac power gamma
579  double f(::pow(double(ndx) / fullWhite, gamma1));
580 
581  // add the Rec 709 gamma
582  if (f < 0.018)
583  outTable[ndx] = fullWhite * (f * 4.5);
584  else
585  outTable[ndx] = fullWhite * ((1.099 * ::pow(f, gamma2)) - 0.099);
586  }
587  }
588  else
589  {
590  gamma1 = 1.0 / 0.45;
591  gamma2 = 1.0 / kGammaMac;
592  for (size_t ndx = 0; ndx < tableSize; ndx++)
593  {
594  double f(double(ndx) / fullWhite);
595  // remove the Rec 709 gamma
596  if (f < 0.081)
597  f = f / 4.5;
598  else
599  f = ::pow((f + 0.099) / 1.099, gamma1);
600 
601  // add the kGammaMac Power gamma
602  outTable[ndx] = fullWhite * ::pow(f, gamma2);
603  }
604  }
605  break; // NTV2_LUTGamma18_Rec709
606 
607  // kGammaMac <=> Rec 709 Gamma - SMPTE Range
609  if (inBank == kLUTBank_RGB2YUV)
610  {
611  gamma1 = kGammaMac;
612  gamma2 = 0.45;
613  for (size_t ndx = 0; ndx < tableSize; ndx++)
614  {
615  if (ndx <= (uint32_t)smpteBlack || ndx >= (uint32_t)smpteWhite)
616  outTable[ndx] = double(ndx); // linear portion - outside SMPTE range
617  else
618  { // remove the kGammaMac power gamma
619  double f(::pow((double(ndx) - smpteBlack) / 875.0, gamma1));
620 
621  // add the Rec 709 gamma
622  if (f < 0.018)
623  outTable[ndx] = smpteScale * (f * 4.5) + smpteBlack;
624  else
625  outTable[ndx] = smpteScale * ((1.099 * ::pow(f, gamma2)) - 0.099) + smpteBlack;
626  }
627  }
628  }
629  else
630  {
631  gamma1 = 1.0 / 0.45;
632  gamma2 = 1.0 / kGammaMac;
633  for (size_t ndx = 0; ndx < tableSize; ndx++)
634  {
635  if (ndx <= (uint32_t)smpteBlack || ndx >= (uint32_t)smpteWhite)
636  outTable[ndx] = double(ndx); // linear portion - outside SMPTE range
637  else
638  {
639  double f ((double(ndx) - smpteBlack) / 875.0);
640  // remove the Rec 709 gamma
641  if (f < 0.081)
642  f = f / 4.5;
643  else
644  f = ::pow((f + 0.099) / 1.099, gamma1);
645 
646  // add the kGammaMac Power gamma
647  outTable[ndx] = smpteScale * ::pow(f, gamma2) + smpteBlack;
648  }
649  }
650  }
651  break; // NTV2_LUTGamma18_Rec709_SMPTE
652  } // switch on inLUTType
653  return true;
654 } // GenerateGammaTable
655 
656 static inline ULWord intClamp (const int inMin, const int inValue, const int inMax)
657 {
658  return ULWord(inValue < inMin ? inMin : (inValue > inMax ? inMax : inValue));
659 }
660 
661 bool CNTV2Card::GenerateGammaTable (const NTV2LutType inLUTType, const int inBank, UWordSequence & outTable, const NTV2LutBitDepth inBitDepth)
662 {
663  NTV2DoubleArray dblTable;
664  size_t nonzeroes(0);
665  uint32_t tableSize = inBitDepth == NTV2_LUT10Bit ? 1024 : 4096;
666  if (!CNTV2Card::GenerateGammaTable (inLUTType, inBank, dblTable, inBitDepth))
667  return false;
668  if (dblTable.size() < tableSize)
669  return false;
670  outTable.reserve(tableSize);
671  while (outTable.size() < tableSize)
672  outTable.push_back(0);
673  for (size_t ndx(0); ndx < tableSize; ndx++)
674  {
675  if ((outTable.at(ndx) = UWord(intClamp(0, int(dblTable.at(ndx) + 0.5), tableSize-1))))
676  nonzeroes++;
677  }
678  if (nonzeroes >= tableSize)
679  {AJA_sWARNING(AJA_DebugUnit_LUT, AJAFUNC << ": " << DEC(nonzeroes) << " non-zero values -- at least " << DEC(tableSize-1)); return false;}
680  return nonzeroes >= tableSize;
681 }
682 
688 
689 static const size_t kLUTArraySize (NTV2_COLORCORRECTOR_WORDSPERTABLE * 2);
691 
692 
693 
694 // this allows for three 1024-entry LUTs that we're going to download to all four channels
695 bool CNTV2Card::DownloadLUTToHW (const NTV2DoubleArray & inRedLUT, const NTV2DoubleArray & inGreenLUT, const NTV2DoubleArray & inBlueLUT,
696  const NTV2Channel inLUT, const int inBank)
697 {
698  if (inRedLUT.size() < kLUTArraySize || inGreenLUT.size() < kLUTArraySize || inBlueLUT.size() < kLUTArraySize)
699  {LUTFAIL("Size error (< 1024): R=" << DEC(inRedLUT.size()) << " G=" << DEC(inGreenLUT.size()) << " B=" << DEC(inBlueLUT.size())); return false;}
700 
701  if (IS_CHANNEL_INVALID(inLUT))
702  {LUTFAIL("Bad LUT/channel (> 7): " << DEC(inLUT)); return false;}
703 
704  if (inBank != 0 && inBank != 1)
705  {LUTFAIL("Bad bank value (> 1): " << DEC(inBank)); return false;}
706 
707  if (::NTV2DeviceGetNumLUTs(_boardID) == 0)
708  return true; // It's no sin to have been born with no LUTs
709 
710  bool bResult = SetLUTEnable(true, inLUT);
711  if (bResult)
712  {
713  // Set up Host Access...
714  bResult = SetColorCorrectionHostAccessBank (NTV2ColorCorrectionHostAccessBank (gLUTBank0[inLUT] + inBank));
715  if (bResult)
716  bResult = LoadLUTTables (inRedLUT, inGreenLUT, inBlueLUT);
717  SetLUTEnable (false, inLUT);
718  }
719  return bResult;
720 }
721 
722 bool CNTV2Card::Download12BitLUTToHW (const NTV2DoubleArray & inRedLUT, const NTV2DoubleArray & inGreenLUT, const NTV2DoubleArray & inBlueLUT,
723  const NTV2Channel inLUT, const int inBank)
724 {
725  if (inRedLUT.size() < k12BitLUTArraySize || inGreenLUT.size() < k12BitLUTArraySize || inBlueLUT.size() < k12BitLUTArraySize)
726  {LUTFAIL("Size error (< 4096): R=" << DEC(inRedLUT.size()) << " G=" << DEC(inGreenLUT.size()) << " B=" << DEC(inBlueLUT.size())); return false;}
727 
728  if (IS_CHANNEL_INVALID(inLUT))
729  {LUTFAIL("Bad LUT/channel (> 7): " << DEC(inLUT)); return false;}
730 
731  if (inBank != 0 && inBank != 1)
732  {LUTFAIL("Bad bank value (> 1): " << DEC(inBank)); return false;}
733 
734  if (!Has12BitLUTSupport())
735  return false;
736 
737  if (::NTV2DeviceGetNumLUTs(_boardID) == 0)
738  return false;
739 
740  bool bResult = SetLUTEnable(true, inLUT);
741  if (bResult)
742  {
743  // Set up Host Access...
744  bResult = SetColorCorrectionHostAccessBank (NTV2ColorCorrectionHostAccessBank (gLUTBank0[inLUT] + inBank));
745  if (bResult)
746  bResult = Load12BitLUTTables (inRedLUT, inGreenLUT, inBlueLUT);
747  SetLUTEnable (false, inLUT);
748  }
749  return bResult;
750 }
751 
752 bool CNTV2Card::DownloadLUTToHW (const UWordSequence & inRedLUT, const UWordSequence & inGreenLUT, const UWordSequence & inBlueLUT,
753  const NTV2Channel inLUT, const int inBank)
754 {
755  if (inRedLUT.size() < kLUTArraySize || inGreenLUT.size() < kLUTArraySize || inBlueLUT.size() < kLUTArraySize)
756  {LUTFAIL("Size error (< 1024): R=" << DEC(inRedLUT.size()) << " G=" << DEC(inGreenLUT.size()) << " B=" << DEC(inBlueLUT.size())); return false;}
757 
758  if (IS_CHANNEL_INVALID(inLUT))
759  {LUTFAIL("Bad LUT/channel (> 7): " << DEC(inLUT)); return false;}
760 
761  if (inBank != 0 && inBank != 1)
762  {LUTFAIL("Bad bank value (> 1): " << DEC(inBank)); return false;}
763 
764  if (::NTV2DeviceGetNumLUTs(_boardID) == 0)
765  return true; // It's no sin to have been born with no LUTs
766 
767  bool bResult = SetLUTEnable(true, inLUT);
768  if (bResult)
769  {
770  // Set up Host Access...
771  bResult = SetColorCorrectionHostAccessBank (NTV2ColorCorrectionHostAccessBank (gLUTBank0[inLUT] + inBank));
772  if (bResult)
773  bResult = WriteLUTTables (inRedLUT, inGreenLUT, inBlueLUT);
774  SetLUTEnable (false, inLUT);
775  }
776  return bResult;
777 }
778 
779 bool CNTV2Card::Download12BitLUTToHW (const UWordSequence & inRedLUT, const UWordSequence & inGreenLUT, const UWordSequence & inBlueLUT,
780  const NTV2Channel inLUT, const int inBank)
781 {
782  if (inRedLUT.size() < k12BitLUTArraySize || inGreenLUT.size() < k12BitLUTArraySize || inBlueLUT.size() < k12BitLUTArraySize)
783  {LUTFAIL("Size error (< 4096): R=" << DEC(inRedLUT.size()) << " G=" << DEC(inGreenLUT.size()) << " B=" << DEC(inBlueLUT.size())); return false;}
784 
785  if (IS_CHANNEL_INVALID(inLUT))
786  {LUTFAIL("Bad LUT/channel (> 7): " << DEC(inLUT)); return false;}
787 
788  if (inBank != 0 && inBank != 1)
789  {LUTFAIL("Bad bank value (> 1): " << DEC(inBank)); return false;}
790 
791  if (!Has12BitLUTSupport())
792  return false;
793 
794  if (::NTV2DeviceGetNumLUTs(_boardID) == 0)
795  return false;
796 
797  bool bResult = SetLUTEnable(true, inLUT);
798  if (bResult)
799  {
800  // Set up Host Access...
801  bResult = SetColorCorrectionHostAccessBank (NTV2ColorCorrectionHostAccessBank (gLUTBank0[inLUT] + inBank));
802  if (bResult)
803  bResult = Write12BitLUTTables (inRedLUT, inGreenLUT, inBlueLUT);
804  SetLUTEnable (false, inLUT);
805  }
806  return bResult;
807 }
808 
809 bool CNTV2Card::LoadLUTTables (const NTV2DoubleArray & inRedLUT, const NTV2DoubleArray & inGreenLUT, const NTV2DoubleArray & inBlueLUT)
810 {
811  if (inRedLUT.size() < kLUTArraySize || inGreenLUT.size() < kLUTArraySize || inBlueLUT.size() < kLUTArraySize)
812  {LUTFAIL("Size error (< 1024): R=" << DEC(inRedLUT.size()) << " G=" << DEC(inGreenLUT.size()) << " B=" << DEC(inBlueLUT.size())); return false;}
813 
814  UWordSequence redLUT, greenLUT, blueLUT;
815  redLUT.resize(kLUTArraySize);
816  greenLUT.resize(kLUTArraySize);
817  blueLUT.resize(kLUTArraySize);
818  for (size_t ndx(0); ndx < kLUTArraySize; ndx++)
819  {
820  redLUT .at(ndx) = UWord(intClamp(0, int(inRedLUT [ndx] + 0.5), 1023));
821  greenLUT.at(ndx) = UWord(intClamp(0, int(inGreenLUT[ndx] + 0.5), 1023));
822  blueLUT .at(ndx) = UWord(intClamp(0, int(inBlueLUT [ndx] + 0.5), 1023));
823  }
824  return WriteLUTTables(redLUT, greenLUT, blueLUT);
825 }
826 
827 bool CNTV2Card::Load12BitLUTTables (const NTV2DoubleArray & inRedLUT, const NTV2DoubleArray & inGreenLUT, const NTV2DoubleArray & inBlueLUT)
828 {
829  if (inRedLUT.size() < k12BitLUTArraySize || inGreenLUT.size() < k12BitLUTArraySize || inBlueLUT.size() < k12BitLUTArraySize)
830  {LUTFAIL("Size error (< 4096): R=" << DEC(inRedLUT.size()) << " G=" << DEC(inGreenLUT.size()) << " B=" << DEC(inBlueLUT.size())); return false;}
831 
832  UWordSequence redLUT, greenLUT, blueLUT;
833  redLUT.resize(k12BitLUTArraySize);
834  greenLUT.resize(k12BitLUTArraySize);
835  blueLUT.resize(k12BitLUTArraySize);
836  for (size_t ndx(0); ndx < k12BitLUTArraySize; ndx++)
837  {
838  redLUT .at(ndx) = UWord(intClamp(0, int(inRedLUT [ndx] + 0.5), 4095));
839  greenLUT.at(ndx) = UWord(intClamp(0, int(inGreenLUT[ndx] + 0.5), 4095));
840  blueLUT .at(ndx) = UWord(intClamp(0, int(inBlueLUT [ndx] + 0.5), 4095));
841  }
842  return Write12BitLUTTables(redLUT, greenLUT, blueLUT);
843 }
844 
845 bool CNTV2Card::WriteLUTTables (const UWordSequence & inRedLUT, const UWordSequence & inGreenLUT, const UWordSequence & inBlueLUT)
846 {
847  if (inRedLUT.size() < kLUTArraySize || inGreenLUT.size() < kLUTArraySize || inBlueLUT.size() < kLUTArraySize)
848  {LUTFAIL("Size error (< 1024): R=" << DEC(inRedLUT.size()) << " G=" << DEC(inGreenLUT.size()) << " B=" << DEC(inBlueLUT.size())); return false;}
849 
850  size_t errorCount(0), nonzeroes(0);
851  ULWord RTableReg = (Has12BitLUTSupport() ? kColorCorrection12BitLUTOffset_Base : kColorCorrectionLUTOffset_Red) / 4; // Byte offset to LUT in register bar; divide by sizeof (ULWord) to get register number
852  ULWord GTableReg = (Has12BitLUTSupport() ? kColorCorrection12BitLUTOffset_Base : kColorCorrectionLUTOffset_Green) / 4;
853  ULWord BTableReg = (Has12BitLUTSupport() ? kColorCorrection12BitLUTOffset_Base : kColorCorrectionLUTOffset_Blue) / 4;
854 
855  for (size_t ndx(0); ndx < NTV2_COLORCORRECTOR_WORDSPERTABLE; ndx++)
856  {
857  ULWord loRed(ULWord(inRedLUT[2 * ndx + 0]) & 0x3FF);
858  ULWord hiRed(ULWord(inRedLUT[2 * ndx + 1]) & 0x3FF);
859 
860  ULWord loGreen = ULWord(inGreenLUT[2 * ndx + 0]) & 0x3FF;
861  ULWord hiGreen = ULWord(inGreenLUT[2 * ndx + 1]) & 0x3FF;
862 
863  ULWord loBlue = ULWord(inBlueLUT[2 * ndx + 0]) & 0x3FF;
864  ULWord hiBlue = ULWord(inBlueLUT[2 * ndx + 1]) & 0x3FF;
865 
866  if(!Has12BitLUTSupport())
867  {
869  if (tmpRed) nonzeroes++;
870  if (!WriteRegister(RTableReg++, tmpRed))
871  errorCount++;
872 
873  ULWord tmpGreen = (hiGreen << kRegColorCorrectionLUTOddShift) + (loGreen << kRegColorCorrectionLUTEvenShift);
874  if (tmpGreen) nonzeroes++;
875  if (!WriteRegister(GTableReg++, tmpGreen))
876  errorCount++;
877 
878  ULWord tmpBlue = (hiBlue << kRegColorCorrectionLUTOddShift) + (loBlue << kRegColorCorrectionLUTEvenShift);
879  if (tmpBlue) nonzeroes++;
880  if (!WriteRegister(BTableReg++, tmpBlue))
881  errorCount++;
882  }
883  else
884  {
887  if(tmpRedLo || tmpRedHi) nonzeroes++;
888  Set12BitLUTPlaneSelect(NTV2_REDPLANE);
889  if (!WriteRegister(RTableReg++, tmpRedLo))
890  errorCount++;
891  if (!WriteRegister(RTableReg++, tmpRedLo))
892  errorCount++;
893  if (!WriteRegister(RTableReg++, tmpRedHi))
894  errorCount++;
895  if (!WriteRegister(RTableReg++, tmpRedHi))
896  errorCount++;
897 
900  if(tmpGreenLo || tmpGreenHi) nonzeroes++;
901  Set12BitLUTPlaneSelect(NTV2_GREENPLANE);
902  if (!WriteRegister(GTableReg++, tmpGreenLo))
903  errorCount++;
904  if (!WriteRegister(GTableReg++, tmpGreenLo))
905  errorCount++;
906  if (!WriteRegister(GTableReg++, tmpGreenHi))
907  errorCount++;
908  if (!WriteRegister(GTableReg++, tmpGreenHi))
909  errorCount++;
910 
913  if(tmpBlueLo || tmpBlueHi) nonzeroes++;
914  Set12BitLUTPlaneSelect(NTV2_BLUEPLANE);
915  if (!WriteRegister(BTableReg++, tmpBlueLo))
916  errorCount++;
917  if (!WriteRegister(BTableReg++, tmpBlueLo))
918  errorCount++;
919  if (!WriteRegister(BTableReg++, tmpBlueHi))
920  errorCount++;
921  if (!WriteRegister(BTableReg++, tmpBlueHi))
922  errorCount++;
923  }
924  }
925  if (errorCount) LUTFAIL(GetDisplayName() << " " << DEC(errorCount) << " WriteRegister calls failed");
926  else if (!nonzeroes) LUTWARN(GetDisplayName() << " All zero LUT table values!");
927  return !errorCount;
928 }
929 
930 bool CNTV2Card::Write12BitLUTTables (const UWordSequence & inRedLUT, const UWordSequence & inGreenLUT, const UWordSequence & inBlueLUT)
931 {
932  if (inRedLUT.size() < k12BitLUTArraySize || inGreenLUT.size() < k12BitLUTArraySize || inBlueLUT.size() < k12BitLUTArraySize)
933  {LUTFAIL("Size error (< 4096): R=" << DEC(inRedLUT.size()) << " G=" << DEC(inGreenLUT.size()) << " B=" << DEC(inBlueLUT.size())); return false;}
934 
935  if (!Has12BitLUTSupport())
936  return false;
937 
938  size_t errorCount(0), nonzeroes(0);
939  ULWord RTableReg(kColorCorrection12BitLUTOffset_Base / 4); // Byte offset to LUT in register bar; divide by sizeof (ULWord) to get register number
942 
943  Set12BitLUTPlaneSelect(NTV2_REDPLANE);
944  for (size_t ndx(0); ndx < NTV2_12BIT_COLORCORRECTOR_WORDSPERTABLE; ndx++)
945  {
946  ULWord loRed(ULWord(inRedLUT[2 * ndx + 0]) & 0xFFF);
947  ULWord hiRed(ULWord(inRedLUT[2 * ndx + 1]) & 0xFFF);
948 
950  if (tmpRed) nonzeroes++;
951  if (!WriteRegister(RTableReg++, tmpRed))
952  errorCount++;
953  }
954 
955  Set12BitLUTPlaneSelect(NTV2_GREENPLANE);
956  for (size_t ndx(0); ndx < NTV2_12BIT_COLORCORRECTOR_WORDSPERTABLE; ndx++)
957  {
958  ULWord loGreen = ULWord(inGreenLUT[2 * ndx + 0]) & 0xFFF;
959  ULWord hiGreen = ULWord(inGreenLUT[2 * ndx + 1]) & 0xFFF;
960 
962  if (tmpGreen) nonzeroes++;
963  if (!WriteRegister(GTableReg++, tmpGreen))
964  errorCount++;
965  }
966 
967  Set12BitLUTPlaneSelect(NTV2_BLUEPLANE);
968  for (size_t ndx(0); ndx < NTV2_12BIT_COLORCORRECTOR_WORDSPERTABLE; ndx++)
969  {
970  ULWord loBlue = ULWord(inBlueLUT[2 * ndx + 0]) & 0xFFF;
971  ULWord hiBlue = ULWord(inBlueLUT[2 * ndx + 1]) & 0xFFF;
972 
974  if (tmpBlue) nonzeroes++;
975  if (!WriteRegister(BTableReg++, tmpBlue))
976  errorCount++;
977  }
978 
979  if (errorCount) LUTFAIL(GetDisplayName() << " " << DEC(errorCount) << " WriteRegister calls failed");
980  else if (!nonzeroes) LUTWARN(GetDisplayName() << " All zero LUT table values!");
981  return !errorCount;
982 }
983 
984 bool CNTV2Card::GetLUTTables (NTV2DoubleArray & outRedLUT, NTV2DoubleArray & outGreenLUT, NTV2DoubleArray & outBlueLUT)
985 {
986  outRedLUT.clear(); outRedLUT.resize (kLUTArraySize);
987  outGreenLUT.clear(); outGreenLUT.resize(kLUTArraySize);
988  outBlueLUT.clear(); outBlueLUT.resize(kLUTArraySize);
989 
990  UWordSequence red, green, blue;
991  if (!ReadLUTTables(red, green, blue))
992  return false;
993  if (red.size() != green.size() || green.size() != blue.size())
994  {LUTFAIL("Unexpected size mismatch: R(" << DEC(red.size()) << ")!=G(" << DEC(green.size()) << ")!=B(" << DEC(blue.size()) << ")"); return false;}
995  if (red.size() != outRedLUT.size() || green.size() != outGreenLUT.size() || blue.size() != outBlueLUT.size())
996  {LUTFAIL("Unexpected size mismatch: R(" << DEC(red.size()) << ")!=oR(" << DEC(outRedLUT.size())
997  << ") G(" << DEC(green.size()) << ")!=oG(" << DEC(outGreenLUT.size())
998  << ") B(" << DEC(blue.size()) << ")!=oB(" << DEC(outBlueLUT.size())
999  << ")"); return false;}
1000 
1001  for (size_t ndx(0); ndx < kLUTArraySize; ndx++)
1002  {
1003  outRedLUT [ndx] = red[ndx];
1004  outGreenLUT[ndx] = green[ndx];
1005  outBlueLUT [ndx] = blue[ndx];
1006  }
1007  return true;
1008 }
1009 
1010 bool CNTV2Card::Get12BitLUTTables (NTV2DoubleArray & outRedLUT, NTV2DoubleArray & outGreenLUT, NTV2DoubleArray & outBlueLUT)
1011 {
1012  outRedLUT.clear(); outRedLUT.resize (k12BitLUTArraySize);
1013  outGreenLUT.clear(); outGreenLUT.resize(k12BitLUTArraySize);
1014  outBlueLUT.clear(); outBlueLUT.resize(k12BitLUTArraySize);
1015 
1016  if(!Has12BitLUTSupport())
1017  return false;
1018 
1019  UWordSequence red, green, blue;
1020  if (!Read12BitLUTTables(red, green, blue))
1021  return false;
1022  if (red.size() != green.size() || green.size() != blue.size())
1023  {LUTFAIL("Unexpected size mismatch: R(" << DEC(red.size()) << ")!=G(" << DEC(green.size()) << ")!=B(" << DEC(blue.size()) << ")"); return false;}
1024  if (red.size() != outRedLUT.size() || green.size() != outGreenLUT.size() || blue.size() != outBlueLUT.size())
1025  {LUTFAIL("Unexpected size mismatch: R(" << DEC(red.size()) << ")!=oR(" << DEC(outRedLUT.size())
1026  << ") G(" << DEC(green.size()) << ")!=oG(" << DEC(outGreenLUT.size())
1027  << ") B(" << DEC(blue.size()) << ")!=oB(" << DEC(outBlueLUT.size())
1028  << ")"); return false;}
1029 
1030  for (size_t ndx(0); ndx < k12BitLUTArraySize; ndx++)
1031  {
1032  outRedLUT [ndx] = red[ndx];
1033  outGreenLUT[ndx] = green[ndx];
1034  outBlueLUT [ndx] = blue[ndx];
1035  }
1036  return true;
1037 }
1038 
1039 bool CNTV2Card::ReadLUTTables (UWordSequence & outRedLUT, UWordSequence & outGreenLUT, UWordSequence & outBlueLUT)
1040 {
1041  ULWord RTableReg (kColorCorrectionLUTOffset_Red / 4); // Byte offset to LUT in register bar; divide by sizeof (ULWord) to get register number
1042  ULWord GTableReg (kColorCorrectionLUTOffset_Green / 4);
1043  ULWord BTableReg (kColorCorrectionLUTOffset_Blue / 4);
1044  size_t errors(0), nonzeroes(0);
1045 
1046  outRedLUT.clear(); outRedLUT.resize(kLUTArraySize);
1047  outGreenLUT.clear(); outGreenLUT.resize(kLUTArraySize);
1048  outBlueLUT.clear(); outBlueLUT.resize(kLUTArraySize);
1049 
1050  for (size_t ndx(0); ndx < kLUTArraySize; ndx += 2)
1051  {
1052  ULWord temp(0);
1053  if (!ReadRegister(RTableReg++, temp))
1054  errors++;
1055  outRedLUT[ndx + 0] = (temp >> kRegColorCorrectionLUTEvenShift) & 0x3FF;
1056  outRedLUT[ndx + 1] = (temp >> kRegColorCorrectionLUTOddShift ) & 0x3FF;
1057  if (temp) nonzeroes++;
1058 
1059  if (!ReadRegister(GTableReg++, temp))
1060  errors++;
1061  outGreenLUT[ndx + 0] = (temp >> kRegColorCorrectionLUTEvenShift) & 0x3FF;
1062  outGreenLUT[ndx + 1] = (temp >> kRegColorCorrectionLUTOddShift ) & 0x3FF;
1063  if (temp) nonzeroes++;
1064 
1065  if (!ReadRegister(BTableReg++, temp))
1066  errors++;
1067  outBlueLUT[ndx + 0] = (temp >> kRegColorCorrectionLUTEvenShift) & 0x3FF;
1068  outBlueLUT[ndx + 1] = (temp >> kRegColorCorrectionLUTOddShift ) & 0x3FF;
1069  if (temp) nonzeroes++;
1070  }
1071  if (errors) LUTFAIL(GetDisplayName() << " " << DEC(errors) << " ReadRegister calls failed");
1072  else if (!nonzeroes) LUTWARN(GetDisplayName() << " All zero LUT table values!");
1073  return !errors;
1074 }
1075 
1076 bool CNTV2Card::Read12BitLUTTables (UWordSequence & outRedLUT, UWordSequence & outGreenLUT, UWordSequence & outBlueLUT)
1077 {
1078  ULWord RTableReg (kColorCorrection12BitLUTOffset_Base / 4); // Byte offset to LUT in register bar; divide by sizeof (ULWord) to get register number
1081  size_t errors(0), nonzeroes(0);
1082 
1083  if(!Has12BitLUTSupport())
1084  return false;
1085 
1086  outRedLUT.clear(); outRedLUT.resize(k12BitLUTArraySize);
1087  outGreenLUT.clear(); outGreenLUT.resize(k12BitLUTArraySize);
1088  outBlueLUT.clear(); outBlueLUT.resize(k12BitLUTArraySize);
1089 
1090  Set12BitLUTPlaneSelect(NTV2_REDPLANE);
1091  for (size_t ndx(0); ndx < k12BitLUTArraySize; ndx += 2)
1092  {
1093  ULWord temp(0);
1094  if (!ReadRegister(RTableReg++, temp))
1095  errors++;
1096  outRedLUT[ndx + 0] = (temp >> kRegColorCorrection12BitLUTEvenShift) & 0xFFF;
1097  outRedLUT[ndx + 1] = (temp >> kRegColorCorrection12BitLUTOddShift ) & 0xFFF;
1098  if (temp) nonzeroes++;
1099  }
1100 
1101  Set12BitLUTPlaneSelect(NTV2_GREENPLANE);
1102  for (size_t ndx(0); ndx < k12BitLUTArraySize; ndx += 2)
1103  {
1104  ULWord temp(0);
1105  if (!ReadRegister(GTableReg++, temp))
1106  errors++;
1107  outGreenLUT[ndx + 0] = (temp >> kRegColorCorrection12BitLUTEvenShift) & 0xFFF;
1108  outGreenLUT[ndx + 1] = (temp >> kRegColorCorrection12BitLUTOddShift ) & 0xFFF;
1109  if (temp) nonzeroes++;
1110  }
1111 
1112  Set12BitLUTPlaneSelect(NTV2_BLUEPLANE);
1113  for (size_t ndx(0); ndx < k12BitLUTArraySize; ndx += 2)
1114  {
1115  ULWord temp(0);
1116  if (!ReadRegister(BTableReg++, temp))
1117  errors++;
1118  outBlueLUT[ndx + 0] = (temp >> kRegColorCorrection12BitLUTEvenShift) & 0xFFF;
1119  outBlueLUT[ndx + 1] = (temp >> kRegColorCorrection12BitLUTOddShift ) & 0xFFF;
1120  if (temp) nonzeroes++;
1121  }
1122 
1123  if (errors) LUTFAIL(GetDisplayName() << " " << DEC(errors) << " ReadRegister calls failed");
1124  else if (!nonzeroes) LUTWARN(GetDisplayName() << " All zero LUT table values!");
1125  return !errors;
1126 }
1127 
1128 bool CNTV2Card::SetLUTEnable (const bool inEnable, const NTV2Channel inLUT)
1129 {
1134  static const UWord BitCountNibble[] = { 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4};
1135 
1136  if (IS_CHANNEL_INVALID(inLUT))
1137  {LUTFAIL("Bad LUT number (> 7): " << DEC(inLUT)); return false;}
1138  if (GetNumSupported(kDeviceGetLUTVersion) != 2)
1139  return true; // LUT init not needed
1140 
1141  // Sanity check...
1142  const ULWord mask(LUTEnableMasks[inLUT]), shift(LUTEnableShifts[inLUT]); ULWord tmp(0);
1143  if (ReadRegister(kRegLUTV2Control, tmp))
1144  if (((tmp & mask)?true:false) == inEnable)
1145  LUTWARN(GetDisplayName() << " V2 LUT" << DEC(inLUT+1) << " Enable bit already " << (inEnable?"set":"clear"));
1146  tmp &= 0x000000FF;
1147  if (inEnable)
1148  if (BitCountNibble[tmp & 0xF] || BitCountNibble[(tmp >> 4) & 0xF])
1149  LUTWARN(GetDisplayName() << " Setting V2 LUT" << DEC(inLUT+1) << " Enable bit: multiple Enable bits set: " << xHEX0N(tmp,4));
1150 
1151  // Set or Clear the Enable bit...
1152  if (!WriteRegister (kRegLUTV2Control, inEnable ? 1 : 0, mask, shift))
1153  {LUTFAIL(GetDisplayName() << " WriteRegister kRegLUTV2Control failed, enable=" << DEC(UWord(inEnable))); return false;}
1154 
1155  // Sanity check...
1156  if (!inEnable)
1157  if (ReadRegister(kRegLUTV2Control, tmp, 0x000000FF)) // all enable masks
1158  if (tmp)
1159  LUTWARN(GetDisplayName() << " Clearing V2 LUT" << DEC(inLUT+1) << " Enable bit: still has Enable bit(s) set: " << xHEX0N(tmp,4));
1160 
1161  return true;
1162 }
1163 
1164 
1166 {
1167  if (IS_CHANNEL_INVALID (inChannel))
1168  return false;
1169  if (!NTV2_IS_VALID_CSCRGBRANGE(inRange))
1170  return false;
1171  return WriteRegister (gChannelToCSCoeff34RegNum[inChannel], inRange, kK2RegMaskXena2RGBRange, kK2RegShiftXena2RGBRange);
1172 }
1173 
1175 {
1176  outRange = NTV2_CSC_RGB_RANGE_INVALID;
1177  if (IS_CHANNEL_INVALID (inChannel))
1178  return false;
1179  ULWord regValue (0);
1180  if (!ReadRegister (gChannelToCSCoeff34RegNum[inChannel], regValue, kK2RegMaskXena2RGBRange, kK2RegShiftXena2RGBRange))
1181  return false;
1182  outRange = NTV2_CSC_RGB_Range(regValue);
1183  return true;
1184 }
1185 
1186 bool CNTV2Card::SetColorSpaceUseCustomCoefficient (ULWord useCustomCoefficient, const NTV2Channel inChannel)
1187 {
1188  if (IS_CHANNEL_INVALID (inChannel))
1189  return false;
1190  return WriteRegister (gChannelToCSCoeff12RegNum [inChannel], useCustomCoefficient, kK2RegMaskUseCustomCoefSelect, kK2RegShiftUseCustomCoefSelect);
1191 }
1192 
1193 bool CNTV2Card::GetColorSpaceUseCustomCoefficient (ULWord & outUseCustomCoefficient, const NTV2Channel inChannel)
1194 {
1195  return !IS_CHANNEL_INVALID(inChannel)
1196  && ReadRegister (gChannelToCSCoeff12RegNum[inChannel], outUseCustomCoefficient, kK2RegMaskUseCustomCoefSelect, kK2RegShiftUseCustomCoefSelect);
1197 }
1198 
1199 bool CNTV2Card::SetColorSpaceMakeAlphaFromKey (const bool inMakeAlphaFromKey, const NTV2Channel inChannel)
1200 {
1201  return !IS_CHANNEL_INVALID(inChannel)
1202  && WriteRegister (gChannelToCSCoeff12RegNum[inChannel], inMakeAlphaFromKey?1:0, kK2RegMaskMakeAlphaFromKeySelect, kK2RegShiftMakeAlphaFromKeySelect);
1203 }
1204 
1205 bool CNTV2Card::GetColorSpaceMakeAlphaFromKey (ULWord & outMakeAlphaFromKey, const NTV2Channel inChannel)
1206 {
1207  return !IS_CHANNEL_INVALID(inChannel)
1208  && ReadRegister (gChannelToCSCoeff12RegNum[inChannel], outMakeAlphaFromKey, kK2RegMaskMakeAlphaFromKeySelect, kK2RegShiftMakeAlphaFromKeySelect);
1209 }
1210 
1212 {
1213  if (IS_CHANNEL_INVALID(inChannel))
1214  return false;
1215 
1226 }
1227 
1229 {
1230  if (IS_CHANNEL_INVALID (inChannel))
1231  return false;
1232 
1243 }
1244 
1245 // 12/7/2006 To increase accuracy and decrease generational degredation, the width of the coefficients
1246 // for the colorspace converter matrix went from 10 to 12 bit (with the MSB being a sign
1247 // bit). So as not to break existing, compiled code, we added new API calls for use with
1248 // these wider coefficients. The values had to be munged a bit to fit in the register, since
1249 // the low coefficient ended on the 0 bit ... the hi coefficient was simply widened to 13 bits
1250 // total. The 2 LSBs of the low coefficient are written *in front* of the 11 MSBs, hence the
1251 // shifting and masking below. - jac
1253 {
1254  if (IS_CHANNEL_INVALID (inChannel))
1255  return false;
1256 
1257  ULWord MSBs(inCoefficients.Coefficient1 >> 2);
1258  ULWord LSBs(inCoefficients.Coefficient1 & 0x00000003);
1259  if (!WriteRegister (gChannelToCSCoeff12RegNum[inChannel], MSBs | (LSBs << 11), kK2RegMaskCustomCoefficient12BitLow, kK2RegShiftCustomCoefficient12BitLow)
1261  return false;
1262 
1263  MSBs = inCoefficients.Coefficient3 >> 2;
1264  LSBs = inCoefficients.Coefficient3 & 0x00000003;
1265  if (!WriteRegister (gChannelToCSCoeff34RegNum[inChannel], MSBs | (LSBs << 11), kK2RegMaskCustomCoefficient12BitLow, kK2RegShiftCustomCoefficient12BitLow)
1267  return false;
1268 
1269  MSBs = inCoefficients.Coefficient5 >> 2;
1270  LSBs = inCoefficients.Coefficient5 & 0x00000003;
1271  if (!WriteRegister (gChannelToCSCoeff56RegNum[inChannel], MSBs | (LSBs << 11), kK2RegMaskCustomCoefficient12BitLow, kK2RegShiftCustomCoefficient12BitLow)
1273  return false;
1274 
1275  MSBs = inCoefficients.Coefficient7 >> 2;
1276  LSBs = inCoefficients.Coefficient7 & 0x00000003;
1277  if (!WriteRegister (gChannelToCSCoeff78RegNum[inChannel], MSBs | (LSBs << 11), kK2RegMaskCustomCoefficient12BitLow, kK2RegShiftCustomCoefficient12BitLow)
1279  return false;
1280 
1281  MSBs = inCoefficients.Coefficient9 >> 2;
1282  LSBs = inCoefficients.Coefficient9 & 0x00000003;
1283  return WriteRegister (gChannelToCSCoeff910RegNum[inChannel], MSBs | (LSBs << 11), kK2RegMaskCustomCoefficient12BitLow, kK2RegShiftCustomCoefficient12BitLow)
1285 }
1286 
1287 // 12/7/2006 To increase accuracy and decrease generational degredation, the width of the coefficients
1288 // for the colorspace converter matrix went from 10 to 12 bit (with the MSB being a sign
1289 // bit). So as not to break existing, compiled code, we added new API calls for use with
1290 // these wider coefficients. The values had to be munged a bit to fit in the register, since
1291 // the low coefficient ended on the 0 bit ... the hi coefficient was simply widened to 13 bits
1292 // total. The 2 LSBs of the low coefficient are written *in front* of the 11 MSBs, hence the
1293 // shifting and masking below. - jac
1295 {
1296  if (IS_CHANNEL_INVALID (inChannel))
1297  return false;
1298 
1299  ULWord regVal(0), MSBs(0), LSBs(0);
1300 
1302  return false;
1303  LSBs = (regVal >> 11) & 0x00000003;
1304  MSBs = regVal & 0x000007FF;
1305  outCoefficients.Coefficient1 = MSBs | LSBs;
1306 
1309  return false;
1310  LSBs = (regVal >> 11) & 0x00000003;
1311  MSBs = regVal & 0x000007FF;
1312  outCoefficients.Coefficient3 = MSBs | LSBs;
1313 
1316  return false;
1317  LSBs = (regVal >> 11) & 0x00000003;
1318  MSBs = regVal & 0x000007FF;
1319  outCoefficients.Coefficient5 = MSBs | LSBs;
1320 
1323  return false;
1324  LSBs = (regVal >> 11) & 0x00000003;
1325  MSBs = regVal & 0x000007FF;
1326  outCoefficients.Coefficient7 = MSBs | LSBs;
1327 
1330  return false;
1331  LSBs = (regVal >> 11) & 0x00000003;
1332  MSBs = regVal & 0x000007FF;
1333  outCoefficients.Coefficient9 = MSBs | LSBs;
1335 }
1336 
1337 
1338 bool CNTV2Card::GetColorSpaceVideoKeySyncFail (bool & outVideoKeySyncFail, const NTV2Channel inChannel)
1339 {
1340  ULWord value(0);
1341  const bool status (!IS_CHANNEL_INVALID(inChannel) && ReadRegister(gChannelToCSCoeff12RegNum[inChannel], value, kK2RegMaskVidKeySyncStatus, kK2RegShiftVidKeySyncStatus));
1342  outVideoKeySyncFail = (value == 1);
1343  return status;
1344 }
1345 
1347 
1348 
1349 bool CNTV2Card::GenerateGammaTable (const NTV2LutType inLUTType, const int inBank, double * pOutTable)
1350 {
1351  if (!pOutTable)
1352  return false;
1353  NTV2DoubleArray table;
1354  if (!GenerateGammaTable(inLUTType, inBank, table))
1355  return false;
1356  ::memcpy(pOutTable, &table[0], table.size() * sizeof(double));
1357  return true;
1358 }
1359 
1360 // this assumes we have one 1024-entry LUT that we're going to download to all four channels
1361 bool CNTV2Card::DownloadLUTToHW (const double * pInTable, const NTV2Channel inChannel, const int inBank)
1362 {
1363  if (IS_CHANNEL_INVALID (inChannel))
1364  return false; // Invalid channel
1365 
1366  if (!pInTable)
1367  return false; // NULL table pointer
1368 
1369  if (inBank != 0 && inBank != 1)
1370  return false; // Bad bank value (must be 0 or 1)
1371 
1372  if (::NTV2DeviceGetNumLUTs (_boardID) == 0)
1373  return true; // It's no sin to have been born without any LUTs
1374 
1375  bool bResult = SetLUTEnable (true, inChannel);
1376  if (bResult)
1377  {
1378  // Set up Host Access...
1379  bResult = SetColorCorrectionHostAccessBank (NTV2ColorCorrectionHostAccessBank (gLUTBank0 [inChannel] + inBank));
1380  if (bResult)
1381  bResult = LoadLUTTable (pInTable);
1382  SetLUTEnable (false, inChannel);
1383  }
1384  return bResult;
1385 }
1386 
1387 
1388 bool CNTV2Card::LoadLUTTable (const double * pInTable)
1389 {
1390  if (!pInTable)
1391  return false;
1392 
1393  // Hope and pray that the caller's array has at least 1024 elements...
1394  NTV2DoubleArray rgbLUT;
1395  for (size_t ndx(0); ndx < kLUTArraySize; ndx++)
1396  rgbLUT.push_back(pInTable[ndx]);
1397 
1398  // Call the function that accepts NTV2DoubleArrays...
1399  return LoadLUTTables(rgbLUT, rgbLUT, rgbLUT);
1400 }
1401 
1402 bool CNTV2Card::Set3DLUTTableLocation (const ULWord inFrameNumber, ULWord inLUTIndex)
1403 {
1404  ULWord LUTTableIndexOffset = LUTTablePartitionSize * inLUTIndex;
1405  NTV2Framesize hwFrameSize;
1406  GetFrameBufferSize(NTV2_CHANNEL1, hwFrameSize);
1407  ULWord actualFrameSize (::NTV2FramesizeToByteCount(hwFrameSize));
1408  bool quadEnabled(false), quadQuadEnabled(false);
1409  GetQuadFrameEnable(quadEnabled, NTV2_CHANNEL1);
1410  GetQuadQuadFrameEnable(quadQuadEnabled, NTV2_CHANNEL1);
1411  if (quadEnabled)
1412  actualFrameSize *= 4;
1413  if (quadQuadEnabled)
1414  actualFrameSize *= 4;
1415  ULWord lutTableLocation (((actualFrameSize * inFrameNumber)/4) + LUTTableIndexOffset/4);
1416  return WriteRegister(kReg3DLUTLoadControl, lutTableLocation, 0x3FFFFFFF, 0);
1417 }
1418 
1420 {
1421  WriteRegister(kReg3DLUTLoadControl, 0, 0x80000000, 31);
1422  return WriteRegister(kReg3DLUTLoadControl, 1, 0x80000000, 31);
1423 }
1424 
1425 bool CNTV2Card::Set1DLUTTableLocation (const NTV2Channel inChannel, const ULWord inFrameNumber, ULWord inLUTIndex)
1426 {
1427  ULWord LUTTableIndexOffset = LUTTablePartitionSize * inLUTIndex;
1428  NTV2Framesize hwFrameSize;
1429  GetFrameBufferSize(NTV2_CHANNEL1, hwFrameSize);
1430  ULWord actualFrameSize (::NTV2FramesizeToByteCount(hwFrameSize));
1431  bool quadEnabled(false), quadQuadEnabled(false);
1432  GetQuadFrameEnable(quadEnabled, NTV2_CHANNEL1);
1433  GetQuadQuadFrameEnable(quadQuadEnabled, NTV2_CHANNEL1);
1434  if (quadEnabled)
1435  actualFrameSize *= 4;
1436  if (quadQuadEnabled)
1437  actualFrameSize *= 4;
1438  ULWord lutTableLocation (((actualFrameSize * inFrameNumber)/4) + LUTTableIndexOffset/4);
1439  return WriteRegister(gChannelTo1DLutControlRegNum[inChannel], lutTableLocation, kRegMaskLUTAddress, kRegShiftLUTAddress);
1440 }
1441 
1443 {
1444  WriteRegister(gChannelTo1DLutControlRegNum[inChannel], 0, static_cast<ULWord>(kRegMaskLUTLoad), kRegShiftLUTLoad);
1445  return WriteRegister(gChannelTo1DLutControlRegNum[inChannel], 1, static_cast<ULWord>(kRegMaskLUTLoad), kRegShiftLUTLoad);
1446 }
1447 
1448 
1450 
1451 #ifdef MSWindows
1452 #pragma warning(default: 4800)
1453 #endif
kRegShiftLUT3OutputBankSelect
@ kRegShiftLUT3OutputBankSelect
Definition: ntv2publicinterface.h:2484
ColorSpaceConverterCustomCoefficients::Coefficient8
ULWord Coefficient8
Definition: ntv2publicinterface.h:4074
kRegColorCorrection10To12BitLUTEvenShift
#define kRegColorCorrection10To12BitLUTEvenShift
Definition: ntv2publicinterface.h:4181
kRegShiftLUTSelect
@ kRegShiftLUTSelect
Definition: ntv2publicinterface.h:2456
kK2RegMaskUseCustomCoefSelect
@ kK2RegMaskUseCustomCoefSelect
Definition: ntv2publicinterface.h:1838
CNTV2Card::SetColorSpaceMakeAlphaFromKey
virtual bool SetColorSpaceMakeAlphaFromKey(const bool inMakeAlphaFromKey, const NTV2Channel inChannel=NTV2_CHANNEL1)
Specifies whether or not the given CSC will produce alpha channel data from its key input.
Definition: ntv2csclut.cpp:1199
kRegShiftLUT4Enable
@ kRegShiftLUT4Enable
Definition: ntv2publicinterface.h:2469
kRegMaskLUTSelect
@ kRegMaskLUTSelect
Definition: ntv2publicinterface.h:1372
kRegShiftLUT1Enable
@ kRegShiftLUT1Enable
Definition: ntv2publicinterface.h:2466
kRegCS6Coefficients1_2
@ kRegCS6Coefficients1_2
Definition: ntv2publicinterface.h:628
NTV2_LUT12Bit
@ NTV2_LUT12Bit
Definition: ntv2enums.h:3539
kRegMaskLUT8Enable
@ kRegMaskLUT8Enable
Definition: ntv2publicinterface.h:1389
CNTV2Card::Download12BitLUTToHW
virtual bool Download12BitLUTToHW(const NTV2DoubleArray &inRedLUT, const NTV2DoubleArray &inGreenLUT, const NTV2DoubleArray &inBlueLUT, const NTV2Channel inLUT, const int inBank)
Definition: ntv2csclut.cpp:722
NTV2ColorCorrectionHostAccessBank
NTV2ColorCorrectionHostAccessBank
Definition: ntv2enums.h:2033
NTV2DoubleArray
std::vector< double > NTV2DoubleArray
An array of double-precision floating-point values.
Definition: ntv2publicinterface.h:70
kRegEnhancedCSC8Mode
@ kRegEnhancedCSC8Mode
Definition: ntv2publicinterface.h:982
kRegMaskLUTAddress
@ kRegMaskLUTAddress
Definition: ntv2publicinterface.h:2193
CNTV2Card::LoadLUTTables
virtual bool LoadLUTTables(const NTV2DoubleArray &inRedLUT, const NTV2DoubleArray &inGreenLUT, const NTV2DoubleArray &inBlueLUT)
Writes the LUT tables.
Definition: ntv2csclut.cpp:809
kRegCS3Coefficients9_10
@ kRegCS3Coefficients9_10
Definition: ntv2publicinterface.h:419
ColorSpaceConverterCustomCoefficients::Coefficient5
ULWord Coefficient5
Definition: ntv2publicinterface.h:4071
NTV2_CHANNEL8
@ NTV2_CHANNEL8
Specifies channel or Frame Store 8 (or the 8th item).
Definition: ntv2enums.h:1343
ColorSpaceConverterCustomCoefficients::Coefficient6
ULWord Coefficient6
Definition: ntv2publicinterface.h:4072
NTV2_CCHOSTACCESS_CH4BANK1
@ NTV2_CCHOSTACCESS_CH4BANK1
Definition: ntv2enums.h:2042
CNTV2Card::GetColorSpaceCustomCoefficients12Bit
virtual bool GetColorSpaceCustomCoefficients12Bit(NTV2CSCCustomCoeffs &outCustomCoefficients, const NTV2Channel inChannel=NTV2_CHANNEL1)
Definition: ntv2csclut.cpp:1294
NTV2_CSC_Method_Enhanced
@ NTV2_CSC_Method_Enhanced
Definition: ntv2enums.h:3404
NTV2LutBitDepth
NTV2LutBitDepth
This specifies the LUT bit depth.
Definition: ntv2enums.h:3536
kRegMaskLUT3Enable
@ kRegMaskLUT3Enable
Definition: ntv2publicinterface.h:1384
kRegShiftLUT4OutputBankSelect
@ kRegShiftLUT4OutputBankSelect
Definition: ntv2publicinterface.h:2485
NTV2_CHANNEL2
@ NTV2_CHANNEL2
Specifies channel or Frame Store 2 (or the 2nd item).
Definition: ntv2enums.h:1337
kRegCS8Coefficients9_10
@ kRegCS8Coefficients9_10
Definition: ntv2publicinterface.h:644
kRegCS5Coefficients9_10
@ kRegCS5Coefficients9_10
Definition: ntv2publicinterface.h:492
kRegCS5Coefficients3_4
@ kRegCS5Coefficients3_4
Definition: ntv2publicinterface.h:489
NTV2_LUTCONTROL_3_4
@ NTV2_LUTCONTROL_3_4
Definition: ntv2enums.h:3832
kLUTBank_RGB2YUV
#define kLUTBank_RGB2YUV
Definition: ntv2enums.h:3508
kRegMaskLUT8OutputBankSelect
@ kRegMaskLUT8OutputBankSelect
Definition: ntv2publicinterface.h:1405
kK2RegMaskColorSpaceMatrixSelect
@ kK2RegMaskColorSpaceMatrixSelect
Definition: ntv2publicinterface.h:1837
kRegMaskLUT5Select
@ kRegMaskLUT5Select
Definition: ntv2publicinterface.h:1371
kRegMaskLUT2HostAccessBankSelect
@ kRegMaskLUT2HostAccessBankSelect
Definition: ntv2publicinterface.h:1391
ntv2devicefeatures.h
Declares device capability functions.
kRegCS3Coefficients5_6
@ kRegCS3Coefficients5_6
Definition: ntv2publicinterface.h:417
CNTV2Card::GetColorSpaceRGBBlackRange
virtual bool GetColorSpaceRGBBlackRange(NTV2_CSC_RGB_Range &outRange, const NTV2Channel inChannel=NTV2_CHANNEL1)
Answers with the current RGB range being used by a given CSC.
Definition: ntv2csclut.cpp:1174
kRegColorCorrectionLUTOddShift
#define kRegColorCorrectionLUTOddShift
Definition: ntv2publicinterface.h:4167
kRegCS6Coefficients3_4
@ kRegCS6Coefficients3_4
Definition: ntv2publicinterface.h:629
CNTV2Card::Set3DLUTTableLocation
virtual bool Set3DLUTTableLocation(const ULWord inFrameNumber, ULWord inLUTIndex=0)
Definition: ntv2csclut.cpp:1402
CNTV2Card::GetColorCorrectionOutputBank
virtual bool GetColorCorrectionOutputBank(const NTV2Channel inLUTWidget, ULWord &outBank)
Answers with the current LUT bank in use for the given LUT.
Definition: ntv2csclut.cpp:120
CNTV2Card::GetColorSpaceVideoKeySyncFail
virtual bool GetColorSpaceVideoKeySyncFail(bool &outVideoKeySyncFail, const NTV2Channel inChannel=NTV2_CHANNEL1)
Answers whether or not the video signal present at the CSC’s Key Input is in sync with the video sign...
Definition: ntv2csclut.cpp:1338
NTV2DeviceCanDoEnhancedCSC
bool NTV2DeviceCanDoEnhancedCSC(const NTV2DeviceID inDeviceID)
Definition: ntv2devicefeatures.hpp:2593
CNTV2Card::SetColorSpaceCustomCoefficients12Bit
virtual bool SetColorSpaceCustomCoefficients12Bit(const NTV2CSCCustomCoeffs &inCustomCoefficients, const NTV2Channel inChannel=NTV2_CHANNEL1)
Definition: ntv2csclut.cpp:1252
kRegShiftCCOutputBankSelect
@ kRegShiftCCOutputBankSelect
Definition: ntv2publicinterface.h:2451
NTV2Channel
NTV2Channel
These enum values are mostly used to identify a specific widget_framestore. They're also commonly use...
Definition: ntv2enums.h:1334
kRegShiftLUT5OutputBankSelect
@ kRegShiftLUT5OutputBankSelect
Definition: ntv2publicinterface.h:2486
kRegShiftLUT7OutputBankSelect
@ kRegShiftLUT7OutputBankSelect
Definition: ntv2publicinterface.h:2488
CNTV2Card::SetColorCorrectionSaturation
virtual bool SetColorCorrectionSaturation(const NTV2Channel inChannel, const ULWord inValue)
Definition: ntv2csclut.cpp:311
kRegCS3Coefficients7_8
@ kRegCS3Coefficients7_8
Definition: ntv2publicinterface.h:418
kRegCS5Coefficients7_8
@ kRegCS5Coefficients7_8
Definition: ntv2publicinterface.h:491
gChannelToCSCoeff56RegNum
static const ULWord gChannelToCSCoeff56RegNum[]
Definition: ntv2csclut.cpp:52
gChannelToCSCoeff910RegNum
static const ULWord gChannelToCSCoeff910RegNum[]
Definition: ntv2csclut.cpp:58
kRegShiftLUT8HostAccessBankSelect
@ kRegShiftLUT8HostAccessBankSelect
Definition: ntv2publicinterface.h:2481
CNTV2Card::Write12BitLUTTables
virtual bool Write12BitLUTTables(const UWordSequence &inRedLUT, const UWordSequence &inGreenLUT, const UWordSequence &inBlueLUT)
Definition: ntv2csclut.cpp:930
kRegCS2Coefficients9_10
@ kRegCS2Coefficients9_10
Definition: ntv2publicinterface.h:269
NTV2_BLUEPLANE
@ NTV2_BLUEPLANE
Definition: ntv2enums.h:3840
CNTV2Card::Load1DLUTTable
virtual bool Load1DLUTTable(const NTV2Channel inChannel)
Definition: ntv2csclut.cpp:1442
LUTFAIL
#define LUTFAIL(__x__)
Definition: ntv2csclut.cpp:30
NTV2_IS_VALID_CSCRGBRANGE
#define NTV2_IS_VALID_CSCRGBRANGE(__v__)
Definition: ntv2enums.h:3724
kRegColorCorrectionLUTEvenShift
#define kRegColorCorrectionLUTEvenShift
Definition: ntv2publicinterface.h:4168
CNTV2Card::GetColorCorrectionHostAccessBank
virtual bool GetColorCorrectionHostAccessBank(NTV2ColorCorrectionHostAccessBank &outValue, const NTV2Channel inChannel=NTV2_CHANNEL1)
Definition: ntv2csclut.cpp:227
kRegColorCorrection10To12BitLUTOddShift
#define kRegColorCorrection10To12BitLUTOddShift
Definition: ntv2publicinterface.h:4180
ColorSpaceConverterCustomCoefficients
Definition: ntv2publicinterface.h:4065
NTV2_CCHOSTACCESS_CH4BANK0
@ NTV2_CCHOSTACCESS_CH4BANK0
Definition: ntv2enums.h:2041
kRegCS6Coefficients5_6
@ kRegCS6Coefficients5_6
Definition: ntv2publicinterface.h:630
NTV2_LUTLinear
@ NTV2_LUTLinear
Definition: ntv2enums.h:3521
kColorCorrectionLUTOffset_Green
#define kColorCorrectionLUTOffset_Green
Definition: ntv2publicinterface.h:4173
kRegShiftLUT8Enable
@ kRegShiftLUT8Enable
Definition: ntv2publicinterface.h:2473
gChannelToEnhancedCSCRegNum
static const ULWord gChannelToEnhancedCSCRegNum[]
Definition: ntv2csclut.cpp:43
gChannelTo1DLutControlRegNum
static const ULWord gChannelTo1DLutControlRegNum[]
Definition: ntv2csclut.cpp:61
kRegShiftLUT5Select
@ kRegShiftLUT5Select
Definition: ntv2publicinterface.h:2455
kRegMaskLUT2OutputBankSelect
@ kRegMaskLUT2OutputBankSelect
Definition: ntv2publicinterface.h:1399
NTV2LutType
NTV2LutType
This specifies what function(s) are currently loaded into the LUTs.
Definition: ntv2enums.h:3517
ColorSpaceConverterCustomCoefficients::Coefficient7
ULWord Coefficient7
Definition: ntv2publicinterface.h:4073
CNTV2Card::LoadLUTTable
virtual bool LoadLUTTable(const double *pInTable)
Definition: ntv2csclut.cpp:1388
kRegMask12BitLUTSupport
@ kRegMask12BitLUTSupport
Definition: ntv2publicinterface.h:1407
CNTV2Card::Set12BitLUTPlaneSelect
virtual bool Set12BitLUTPlaneSelect(const NTV2LUTPlaneSelect inLUTPlane)
Sets the LUT plane.
Definition: ntv2csclut.cpp:345
kRegCS2Coefficients5_6
@ kRegCS2Coefficients5_6
Definition: ntv2publicinterface.h:267
kRegShift12BitLUTPlaneSelect
@ kRegShift12BitLUTPlaneSelect
Definition: ntv2publicinterface.h:2490
kRegCS4Coefficients9_10
@ kRegCS4Coefficients9_10
Definition: ntv2publicinterface.h:425
CNTV2Card::SetColorCorrectionOutputBank
virtual bool SetColorCorrectionOutputBank(const NTV2Channel inLUTWidget, const ULWord inBank)
Sets the LUT bank to be used for the given LUT.
Definition: ntv2csclut.cpp:85
kRegShiftLUT4HostAccessBankSelect
@ kRegShiftLUT4HostAccessBankSelect
Definition: ntv2publicinterface.h:2477
kReg1DLUTLoadControl2
@ kReg1DLUTLoadControl2
Definition: ntv2publicinterface.h:783
kColorCorrectionLUTOffset_Blue
#define kColorCorrectionLUTOffset_Blue
Definition: ntv2publicinterface.h:4174
CNTV2Card::GetColorSpaceMakeAlphaFromKey
virtual bool GetColorSpaceMakeAlphaFromKey(ULWord &outMakeAlphaFromKey, const NTV2Channel inChannel=NTV2_CHANNEL1)
Answers whether or not the given CSC is set to produce alpha channel data from its key input.
Definition: ntv2csclut.cpp:1205
kReg1DLUTLoadControl8
@ kReg1DLUTLoadControl8
Definition: ntv2publicinterface.h:789
NTV2_CCHOSTACCESS_CH3BANK0
@ NTV2_CCHOSTACCESS_CH3BANK0
Definition: ntv2enums.h:2039
kRegShiftSaturationValue
@ kRegShiftSaturationValue
Definition: ntv2publicinterface.h:2450
kRegEnhancedCSC1Mode
@ kRegEnhancedCSC1Mode
Definition: ntv2publicinterface.h:854
kRegShiftCC5OutputBankSelect
@ kRegShiftCC5OutputBankSelect
Definition: ntv2publicinterface.h:2454
kRegMaskLUT7OutputBankSelect
@ kRegMaskLUT7OutputBankSelect
Definition: ntv2publicinterface.h:1404
NTV2_LUTUnknown
@ NTV2_LUTUnknown
Definition: ntv2enums.h:3519
kReg1DLUTLoadControl7
@ kReg1DLUTLoadControl7
Definition: ntv2publicinterface.h:788
CNTV2Card::SetLUTControlSelect
virtual bool SetLUTControlSelect(const NTV2LUTControlSelect inLUTSelect)
Definition: ntv2csclut.cpp:329
NTV2_LUTGamma18_Rec601_SMPTE
@ NTV2_LUTGamma18_Rec601_SMPTE
Definition: ntv2enums.h:3524
CNTV2Card::Load3DLUTTable
virtual bool Load3DLUTTable(void)
Definition: ntv2csclut.cpp:1419
kRegMaskCC5OutputBankSelect
@ kRegMaskCC5OutputBankSelect
Definition: ntv2publicinterface.h:1370
kRegCS4Coefficients3_4
@ kRegCS4Coefficients3_4
Definition: ntv2publicinterface.h:422
kRegMaskCC4OutputBankSelect
@ kRegMaskCC4OutputBankSelect
Definition: ntv2publicinterface.h:1374
NTV2DeviceGetNumCSCs
UWord NTV2DeviceGetNumCSCs(const NTV2DeviceID inDeviceID)
Definition: ntv2devicefeatures.hpp:10277
kRegShiftCC5HostAccessBankSelect
@ kRegShiftCC5HostAccessBankSelect
Definition: ntv2publicinterface.h:2453
kReg1DLUTLoadControl4
@ kReg1DLUTLoadControl4
Definition: ntv2publicinterface.h:785
kRegMaskCC5HostAccessBankSelect
@ kRegMaskCC5HostAccessBankSelect
Definition: ntv2publicinterface.h:1369
CNTV2Card::SetLUTV2HostAccessBank
virtual bool SetLUTV2HostAccessBank(const NTV2ColorCorrectionHostAccessBank inValue)
Definition: ntv2csclut.cpp:195
NTV2ColorSpaceMethod
NTV2ColorSpaceMethod
Definition: ntv2enums.h:3400
NTV2_CHANNEL1
@ NTV2_CHANNEL1
Specifies channel or Frame Store 1 (or the first item).
Definition: ntv2enums.h:1336
k12BitLUTArraySize
static const size_t k12BitLUTArraySize((2048) *2)
kRegMaskCCOutputBankSelect
@ kRegMaskCCOutputBankSelect
Definition: ntv2publicinterface.h:1367
kRegShiftCCHostAccessBankSelect
@ kRegShiftCCHostAccessBankSelect
Definition: ntv2publicinterface.h:2260
AJA_DebugUnit_LUT
@ AJA_DebugUnit_LUT
Definition: debugshare.h:100
CNTV2Card::SetColorSpaceCustomCoefficients
virtual bool SetColorSpaceCustomCoefficients(const NTV2CSCCustomCoeffs &inCustomCoefficients, const NTV2Channel inChannel=NTV2_CHANNEL1)
Definition: ntv2csclut.cpp:1211
CNTV2Card::Set1DLUTTableLocation
virtual bool Set1DLUTTableLocation(const NTV2Channel inChannel, const ULWord inFrameNumber, ULWord inLUTIndex=0)
Definition: ntv2csclut.cpp:1425
DEVICE_ID_IO4KUFC
@ DEVICE_ID_IO4KUFC
See Io4K (UFC Mode).
Definition: ntv2enums.h:36
NTV2_GREENPLANE
@ NTV2_GREENPLANE
Definition: ntv2enums.h:3839
CNTV2Card::Get12BitLUTTables
virtual bool Get12BitLUTTables(NTV2DoubleArray &outRedLUT, NTV2DoubleArray &outGreenLUT, NTV2DoubleArray &outBlueLUT)
Definition: ntv2csclut.cpp:1010
NTV2FramesizeToByteCount
ULWord NTV2FramesizeToByteCount(const NTV2Framesize inFrameSize)
Converts the given NTV2Framesize value into an exact byte count.
Definition: ntv2utils.cpp:5347
NTV2ColorCorrectionMode
NTV2ColorCorrectionMode
Definition: ntv2enums.h:2054
NTV2_CHANNEL6
@ NTV2_CHANNEL6
Specifies channel or Frame Store 6 (or the 6th item).
Definition: ntv2enums.h:1341
kRegMaskLUT6OutputBankSelect
@ kRegMaskLUT6OutputBankSelect
Definition: ntv2publicinterface.h:1403
kK2RegMaskCustomCoefficientLow
@ kK2RegMaskCustomCoefficientLow
Definition: ntv2publicinterface.h:1857
NTV2_CHANNEL4
@ NTV2_CHANNEL4
Specifies channel or Frame Store 4 (or the 4th item).
Definition: ntv2enums.h:1339
CNTV2Card::GetLUTControlSelect
virtual bool GetLUTControlSelect(NTV2LUTControlSelect &outLUTSelect)
Definition: ntv2csclut.cpp:334
CNTV2Card::DownloadLUTToHW
virtual bool DownloadLUTToHW(const NTV2DoubleArray &inRedLUT, const NTV2DoubleArray &inGreenLUT, const NTV2DoubleArray &inBlueLUT, const NTV2Channel inLUT, const int inBank)
Sends the given color lookup tables (LUTs) to the given LUT and bank.
Definition: ntv2csclut.cpp:695
NTV2_LUTCustom
@ NTV2_LUTCustom
Definition: ntv2enums.h:3520
kRegShiftLUT1OutputBankSelect
@ kRegShiftLUT1OutputBankSelect
Definition: ntv2publicinterface.h:2482
kK2RegMaskCustomCoefficient12BitLow
@ kK2RegMaskCustomCoefficient12BitLow
Definition: ntv2publicinterface.h:1878
CNTV2Card::GetColorSpaceMethod
virtual bool GetColorSpaceMethod(NTV2ColorSpaceMethod &outMethod, const NTV2Channel inChannel=NTV2_CHANNEL1)
Answers with the current operating mode of the given color space converter.
Definition: ntv2csclut.cpp:410
NTV2_CHANNEL5
@ NTV2_CHANNEL5
Specifies channel or Frame Store 5 (or the 5th item).
Definition: ntv2enums.h:1340
CNTV2Card::GetColorSpaceCustomCoefficients
virtual bool GetColorSpaceCustomCoefficients(NTV2CSCCustomCoeffs &outCustomCoefficients, const NTV2Channel inChannel=NTV2_CHANNEL1)
Definition: ntv2csclut.cpp:1228
CNTV2DriverInterface::ReadRegister
virtual bool ReadRegister(const ULWord inRegNum, ULWord &outValue, const ULWord inMask=0xFFFFFFFF, const ULWord inShift=0)
Reads all or part of the 32-bit contents of a specific register (real or virtual) on the AJA device....
Definition: ntv2driverinterface.cpp:429
kRegCS8Coefficients7_8
@ kRegCS8Coefficients7_8
Definition: ntv2publicinterface.h:643
CNTV2Card::GetColorSpaceMatrixSelect
virtual bool GetColorSpaceMatrixSelect(NTV2ColorSpaceMatrixType &outType, const NTV2Channel inChannel=NTV2_CHANNEL1)
Answers with the current matrix type being used for the given CSC.
Definition: ntv2csclut.cpp:460
kRegEnhancedCSC6Mode
@ kRegEnhancedCSC6Mode
Definition: ntv2publicinterface.h:946
kRegCS2Coefficients1_2
@ kRegCS2Coefficients1_2
Definition: ntv2publicinterface.h:265
CNTV2Card::SetColorCorrectionMode
virtual bool SetColorCorrectionMode(const NTV2Channel inChannel, const NTV2ColorCorrectionMode inMode)
Definition: ntv2csclut.cpp:68
kK2RegMaskXena2RGBRange
@ kK2RegMaskXena2RGBRange
Definition: ntv2publicinterface.h:1848
kRegCS4Coefficients7_8
@ kRegCS4Coefficients7_8
Definition: ntv2publicinterface.h:424
NTV2_CCHOSTACCESS_CH6BANK1
@ NTV2_CCHOSTACCESS_CH6BANK1
Definition: ntv2enums.h:2046
kReg1DLUTLoadControl3
@ kReg1DLUTLoadControl3
Definition: ntv2publicinterface.h:784
kRegShiftLUT3HostAccessBankSelect
@ kRegShiftLUT3HostAccessBankSelect
Definition: ntv2publicinterface.h:2476
kRegShiftLUT6Enable
@ kRegShiftLUT6Enable
Definition: ntv2publicinterface.h:2471
ULWord
uint32_t ULWord
Definition: ajatypes.h:255
NTV2_LUTGamma18_Rec709
@ NTV2_LUTGamma18_Rec709
Definition: ntv2enums.h:3523
kReg1DLUTLoadControl1
@ kReg1DLUTLoadControl1
Definition: ntv2publicinterface.h:782
CNTV2Card::SetColorCorrectionHostAccessBank
virtual bool SetColorCorrectionHostAccessBank(const NTV2ColorCorrectionHostAccessBank inValue)
Definition: ntv2csclut.cpp:155
NTV2_CHANNEL7
@ NTV2_CHANNEL7
Specifies channel or Frame Store 7 (or the 7th item).
Definition: ntv2enums.h:1342
kK2RegShiftColorSpaceMatrixSelect
@ kK2RegShiftColorSpaceMatrixSelect
Definition: ntv2publicinterface.h:2908
kRegMaskLUT6HostAccessBankSelect
@ kRegMaskLUT6HostAccessBankSelect
Definition: ntv2publicinterface.h:1395
kRegShiftLUT2OutputBankSelect
@ kRegShiftLUT2OutputBankSelect
Definition: ntv2publicinterface.h:2483
kDeviceGetLUTVersion
@ kDeviceGetLUTVersion
The version number of the LUT(s) on the device.
Definition: ntv2devicefeatures.h:173
kK2RegShiftCustomCoefficientHigh
@ kK2RegShiftCustomCoefficientHigh
Definition: ntv2publicinterface.h:2920
NTV2_LUTCONTROL_1_2
@ NTV2_LUTCONTROL_1_2
Definition: ntv2enums.h:3831
kRegMaskSaturationValue
@ kRegMaskSaturationValue
Definition: ntv2publicinterface.h:1366
UWordSequence
std::vector< uint16_t > UWordSequence
An ordered sequence of UWord (uint16_t) values.
Definition: ntv2publicinterface.h:42
ntv2card.h
Declares the CNTV2Card class.
kRegMaskCCMode
@ kRegMaskCCMode
Definition: ntv2publicinterface.h:1368
ColorSpaceConverterCustomCoefficients::Coefficient2
ULWord Coefficient2
Definition: ntv2publicinterface.h:4068
CNTV2Card::Read12BitLUTTables
virtual bool Read12BitLUTTables(UWordSequence &outRedLUT, UWordSequence &outGreenLUT, UWordSequence &outBlueLUT)
Definition: ntv2csclut.cpp:1076
kRegCS8Coefficients1_2
@ kRegCS8Coefficients1_2
Definition: ntv2publicinterface.h:640
NTV2_12BIT_COLORCORRECTOR_WORDSPERTABLE
#define NTV2_12BIT_COLORCORRECTOR_WORDSPERTABLE
Definition: ntv2publicinterface.h:4139
kRegMaskLUT6Enable
@ kRegMaskLUT6Enable
Definition: ntv2publicinterface.h:1387
kRegShiftLUT5Enable
@ kRegShiftLUT5Enable
Definition: ntv2publicinterface.h:2470
NTV2_LUT10Bit
@ NTV2_LUT10Bit
Definition: ntv2enums.h:3538
CNTV2Card::WriteLUTTables
virtual bool WriteLUTTables(const UWordSequence &inRedLUT, const UWordSequence &inGreenLUT, const UWordSequence &inBlueLUT)
Writes the LUT tables.
Definition: ntv2csclut.cpp:845
kRegLUTV2Control
@ kRegLUTV2Control
Definition: ntv2publicinterface.h:524
NTV2LUTPlaneSelect
NTV2LUTPlaneSelect
Definition: ntv2enums.h:3836
kRegMaskLUT4HostAccessBankSelect
@ kRegMaskLUT4HostAccessBankSelect
Definition: ntv2publicinterface.h:1393
CNTV2Card::Get12BitLUTPlaneSelect
virtual bool Get12BitLUTPlaneSelect(NTV2LUTPlaneSelect &outLUTPlane)
Answers with the current LUT plane.
Definition: ntv2csclut.cpp:353
NTV2_COLORCORRECTOR_WORDSPERTABLE
#define NTV2_COLORCORRECTOR_WORDSPERTABLE
Definition: ntv2publicinterface.h:4133
NTV2DeviceGetNumLUTs
UWord NTV2DeviceGetNumLUTs(const NTV2DeviceID inDeviceID)
Definition: ntv2devicefeatures.hpp:11563
kColorCorrectionLUTOffset_Red
#define kColorCorrectionLUTOffset_Red
Definition: ntv2publicinterface.h:4172
NTV2_CCHOSTACCESS_CH6BANK0
@ NTV2_CCHOSTACCESS_CH6BANK0
Definition: ntv2enums.h:2045
NTV2_CHANNEL3
@ NTV2_CHANNEL3
Specifies channel or Frame Store 3 (or the 3rd item).
Definition: ntv2enums.h:1338
NTV2_CSC_RGB_Range
NTV2_CSC_RGB_Range
Definition: ntv2enums.h:3712
UWord
uint16_t UWord
Definition: ajatypes.h:253
kK2RegShiftUseCustomCoefSelect
@ kK2RegShiftUseCustomCoefSelect
Definition: ntv2publicinterface.h:2909
kLUTArraySize
static const size_t kLUTArraySize((512) *2)
kRegCS3Coefficients3_4
@ kRegCS3Coefficients3_4
Definition: ntv2publicinterface.h:416
ntv2utils.h
Declares numerous NTV2 utility functions.
NTV2_CSC_RGB_RANGE_INVALID
@ NTV2_CSC_RGB_RANGE_INVALID
Definition: ntv2enums.h:3718
NTV2_LUTGamma18_Rec601
@ NTV2_LUTGamma18_Rec601
Definition: ntv2enums.h:3522
NTV2Framesize
NTV2Framesize
Kona2/Xena2 specific enums.
Definition: ntv2enums.h:2091
kRegEnhancedCSC2Mode
@ kRegEnhancedCSC2Mode
Definition: ntv2publicinterface.h:874
ColorSpaceConverterCustomCoefficients::Coefficient1
ULWord Coefficient1
Definition: ntv2publicinterface.h:4067
kRegShiftLUT7HostAccessBankSelect
@ kRegShiftLUT7HostAccessBankSelect
Definition: ntv2publicinterface.h:2480
kRegCSCoefficients7_8
@ kRegCSCoefficients7_8
Definition: ntv2publicinterface.h:262
kRegCS2Coefficients3_4
@ kRegCS2Coefficients3_4
Definition: ntv2publicinterface.h:266
kRegCS3Coefficients1_2
@ kRegCS3Coefficients1_2
Definition: ntv2publicinterface.h:415
kK2RegMaskEnhancedCSCEnable
@ kK2RegMaskEnhancedCSCEnable
Definition: ntv2publicinterface.h:1865
kRegMaskLUT4OutputBankSelect
@ kRegMaskLUT4OutputBankSelect
Definition: ntv2publicinterface.h:1401
kRegCS6Coefficients9_10
@ kRegCS6Coefficients9_10
Definition: ntv2publicinterface.h:632
ColorSpaceConverterCustomCoefficients::Coefficient9
ULWord Coefficient9
Definition: ntv2publicinterface.h:4075
kRegMaskLUT5HostAccessBankSelect
@ kRegMaskLUT5HostAccessBankSelect
Definition: ntv2publicinterface.h:1394
CNTV2Card::GetColorCorrectionMode
virtual bool GetColorCorrectionMode(const NTV2Channel inChannel, NTV2ColorCorrectionMode &outMode)
Definition: ntv2csclut.cpp:77
kRegMaskLUT1HostAccessBankSelect
@ kRegMaskLUT1HostAccessBankSelect
Definition: ntv2publicinterface.h:1390
ntv2linuxpublicinterface.h
Types and defines shared between NTV2 user application interface and Linux device driver.
kRegEnhancedCSC3Mode
@ kRegEnhancedCSC3Mode
Definition: ntv2publicinterface.h:892
kRegCS4Coefficients5_6
@ kRegCS4Coefficients5_6
Definition: ntv2publicinterface.h:423
ColorSpaceConverterCustomCoefficients::Coefficient4
ULWord Coefficient4
Definition: ntv2publicinterface.h:4070
NTV2_CCHOSTACCESS_CH5BANK0
@ NTV2_CCHOSTACCESS_CH5BANK0
Definition: ntv2enums.h:2043
NTV2_CSC_Method_Enhanced_4K
@ NTV2_CSC_Method_Enhanced_4K
Definition: ntv2enums.h:3405
kK2RegShiftXena2RGBRange
@ kK2RegShiftXena2RGBRange
Definition: ntv2publicinterface.h:2911
kK2RegMaskMakeAlphaFromKeySelect
@ kK2RegMaskMakeAlphaFromKeySelect
Definition: ntv2publicinterface.h:1836
CNTV2Card::GetLUTV2OutputBank
virtual bool GetLUTV2OutputBank(const NTV2Channel inLUTWidget, ULWord &outBank)
Definition: ntv2csclut.cpp:137
kRegShiftLUT6HostAccessBankSelect
@ kRegShiftLUT6HostAccessBankSelect
Definition: ntv2publicinterface.h:2479
kRegMaskCC3OutputBankSelect
@ kRegMaskCC3OutputBankSelect
Definition: ntv2publicinterface.h:1373
ColorSpaceConverterCustomCoefficients::Coefficient10
ULWord Coefficient10
Definition: ntv2publicinterface.h:4076
gChannelToCSCoeff34RegNum
static const ULWord gChannelToCSCoeff34RegNum[]
Definition: ntv2csclut.cpp:49
ColorSpaceConverterCustomCoefficients::Coefficient3
ULWord Coefficient3
Definition: ntv2publicinterface.h:4069
kRegCSCoefficients3_4
@ kRegCSCoefficients3_4
Definition: ntv2publicinterface.h:260
NTV2_CSC_Method_Unimplemented
@ NTV2_CSC_Method_Unimplemented
Definition: ntv2enums.h:3402
CNTV2Card::GetColorCorrectionSaturation
virtual bool GetColorCorrectionSaturation(const NTV2Channel inChannel, ULWord &outValue)
Definition: ntv2csclut.cpp:320
LUTTablePartitionSize
const ULWord LUTTablePartitionSize
Definition: ntv2publicinterface.h:84
CNTV2Card::Load12BitLUTTables
virtual bool Load12BitLUTTables(const NTV2DoubleArray &inRedLUT, const NTV2DoubleArray &inGreenLUT, const NTV2DoubleArray &inBlueLUT)
Definition: ntv2csclut.cpp:827
kRegCSCoefficients1_2
@ kRegCSCoefficients1_2
Definition: ntv2publicinterface.h:259
kRegCS7Coefficients7_8
@ kRegCS7Coefficients7_8
Definition: ntv2publicinterface.h:637
kReg1DLUTLoadControl5
@ kReg1DLUTLoadControl5
Definition: ntv2publicinterface.h:786
kRegMaskLUT7Enable
@ kRegMaskLUT7Enable
Definition: ntv2publicinterface.h:1388
kRegEnhancedCSC7Mode
@ kRegEnhancedCSC7Mode
Definition: ntv2publicinterface.h:964
kRegShiftCC4OutputBankSelect
@ kRegShiftCC4OutputBankSelect
Definition: ntv2publicinterface.h:2458
NTV2_CCHOSTACCESS_CH2BANK0
@ NTV2_CCHOSTACCESS_CH2BANK0
Definition: ntv2enums.h:2037
gLUTBank0
static const NTV2ColorCorrectionHostAccessBank gLUTBank0[]
Definition: ntv2csclut.cpp:683
kRegMaskLUT1Enable
@ kRegMaskLUT1Enable
Definition: ntv2publicinterface.h:1382
DEC
#define DEC(__x__)
Definition: ntv2publicinterface.h:5606
CNTV2Card::GetLUTTables
virtual bool GetLUTTables(NTV2DoubleArray &outRedLUT, NTV2DoubleArray &outGreenLUT, NTV2DoubleArray &outBlueLUT)
Reads the LUT tables (as double-precision floating point values).
Definition: ntv2csclut.cpp:984
NTV2_REDPLANE
@ NTV2_REDPLANE
Definition: ntv2enums.h:3838
gChannelToCSCoeff12RegNum
static const ULWord gChannelToCSCoeff12RegNum[]
Definition: ntv2csclut.cpp:46
AJA_sWARNING
#define AJA_sWARNING(_index_, _expr_)
Definition: debug.h:187
kK2RegShiftCustomCoefficient12BitLow
@ kK2RegShiftCustomCoefficient12BitLow
Definition: ntv2publicinterface.h:2942
kK2RegShiftMakeAlphaFromKeySelect
@ kK2RegShiftMakeAlphaFromKeySelect
Definition: ntv2publicinterface.h:2907
CNTV2Card::SetLUTEnable
virtual bool SetLUTEnable(const bool inEnable, const NTV2Channel inLUT)
Enables or disables the given LUT.
Definition: ntv2csclut.cpp:1128
kK2RegShiftVidKeySyncStatus
@ kK2RegShiftVidKeySyncStatus
Definition: ntv2publicinterface.h:2906
kRegShiftLUTAddress
@ kRegShiftLUTAddress
Definition: ntv2publicinterface.h:3254
NTV2_CCHOSTACCESS_CH8BANK1
@ NTV2_CCHOSTACCESS_CH8BANK1
Definition: ntv2enums.h:2050
kRegMaskLUT7HostAccessBankSelect
@ kRegMaskLUT7HostAccessBankSelect
Definition: ntv2publicinterface.h:1396
kRegShiftLUT8OutputBankSelect
@ kRegShiftLUT8OutputBankSelect
Definition: ntv2publicinterface.h:2489
intClamp
static ULWord intClamp(const int inMin, const int inValue, const int inMax)
Definition: ntv2csclut.cpp:656
std
Definition: json.hpp:5362
NTV2_CCHOSTACCESS_CH5BANK1
@ NTV2_CCHOSTACCESS_CH5BANK1
Definition: ntv2enums.h:2044
kRegCS7Coefficients5_6
@ kRegCS7Coefficients5_6
Definition: ntv2publicinterface.h:636
kRegCS2Coefficients7_8
@ kRegCS2Coefficients7_8
Definition: ntv2publicinterface.h:268
NTV2_CCHOSTACCESS_CH2BANK1
@ NTV2_CCHOSTACCESS_CH2BANK1
Definition: ntv2enums.h:2038
kK2RegMaskCustomCoefficientHigh
@ kK2RegMaskCustomCoefficientHigh
Definition: ntv2publicinterface.h:1858
kRegMaskLUT2Enable
@ kRegMaskLUT2Enable
Definition: ntv2publicinterface.h:1383
NTV2_CCHOSTACCESS_CH1BANK1
@ NTV2_CCHOSTACCESS_CH1BANK1
Definition: ntv2enums.h:2036
kRegShiftLUT2HostAccessBankSelect
@ kRegShiftLUT2HostAccessBankSelect
Definition: ntv2publicinterface.h:2475
kK2RegShiftCustomCoefficient12BitHigh
@ kK2RegShiftCustomCoefficient12BitHigh
Definition: ntv2publicinterface.h:2943
CNTV2Card::GenerateGammaTable
static bool GenerateGammaTable(const NTV2LutType inLUTType, const int inBank, NTV2DoubleArray &outTable, const NTV2LutBitDepth inBitDepth=NTV2_LUT10Bit)
Definition: ntv2csclut.cpp:469
NTV2_CCHOSTACCESS_CH8BANK0
@ NTV2_CCHOSTACCESS_CH8BANK0
Definition: ntv2enums.h:2049
kRegCS8Coefficients5_6
@ kRegCS8Coefficients5_6
Definition: ntv2publicinterface.h:642
kRegShiftCCMode
@ kRegShiftCCMode
Definition: ntv2publicinterface.h:2452
kRegMaskLUT5OutputBankSelect
@ kRegMaskLUT5OutputBankSelect
Definition: ntv2publicinterface.h:1402
CNTV2Card::SetColorSpaceUseCustomCoefficient
virtual bool SetColorSpaceUseCustomCoefficient(const ULWord inUseCustomCoefficient, const NTV2Channel inChannel=NTV2_CHANNEL1)
Definition: ntv2csclut.cpp:1186
NTV2_LUTGamma18_Rec709_SMPTE
@ NTV2_LUTGamma18_Rec709_SMPTE
Definition: ntv2enums.h:3525
kRegCSCoefficients5_6
@ kRegCSCoefficients5_6
Definition: ntv2publicinterface.h:261
kRegCS6Coefficients7_8
@ kRegCS6Coefficients7_8
Definition: ntv2publicinterface.h:631
kRegMaskLUT3OutputBankSelect
@ kRegMaskLUT3OutputBankSelect
Definition: ntv2publicinterface.h:1400
true
#define true
Definition: ntv2devicefeatures.h:26
kK2RegMaskVidKeySyncStatus
@ kK2RegMaskVidKeySyncStatus
Definition: ntv2publicinterface.h:1835
kRegMaskCCHostBankSelect
@ kRegMaskCCHostBankSelect
Definition: ntv2publicinterface.h:1175
CNTV2Card::GetColorSpaceUseCustomCoefficient
virtual bool GetColorSpaceUseCustomCoefficient(ULWord &outUseCustomCoefficient, const NTV2Channel inChannel=NTV2_CHANNEL1)
Definition: ntv2csclut.cpp:1193
kRegCS8Coefficients3_4
@ kRegCS8Coefficients3_4
Definition: ntv2publicinterface.h:641
kRegEnhancedCSC5Mode
@ kRegEnhancedCSC5Mode
Definition: ntv2publicinterface.h:928
CNTV2Card::GetLUTV2HostAccessBank
virtual bool GetLUTV2HostAccessBank(NTV2ColorCorrectionHostAccessBank &outValue, const NTV2Channel inChannel)
Definition: ntv2csclut.cpp:258
kRegMaskLUT8HostAccessBankSelect
@ kRegMaskLUT8HostAccessBankSelect
Definition: ntv2publicinterface.h:1397
kRegShiftLUT5HostAccessBankSelect
@ kRegShiftLUT5HostAccessBankSelect
Definition: ntv2publicinterface.h:2478
CNTV2Card::Has12BitLUTSupport
virtual bool Has12BitLUTSupport(void)
Definition: ntv2csclut.cpp:339
kRegShiftLUT2Enable
@ kRegShiftLUT2Enable
Definition: ntv2publicinterface.h:2467
NTV2_CCHOSTACCESS_CH7BANK1
@ NTV2_CCHOSTACCESS_CH7BANK1
Definition: ntv2enums.h:2048
LUTWARN
#define LUTWARN(__x__)
Definition: ntv2csclut.cpp:31
kRegMask12BitLUTPlaneSelect
@ kRegMask12BitLUTPlaneSelect
Definition: ntv2publicinterface.h:1406
NTV2_CCHOSTACCESS_CH7BANK0
@ NTV2_CCHOSTACCESS_CH7BANK0
Definition: ntv2enums.h:2047
kRegMaskLUT1OutputBankSelect
@ kRegMaskLUT1OutputBankSelect
Definition: ntv2publicinterface.h:1398
gChannelToCSCoeff78RegNum
static const ULWord gChannelToCSCoeff78RegNum[]
Definition: ntv2csclut.cpp:55
kRegShiftLUT3Enable
@ kRegShiftLUT3Enable
Definition: ntv2publicinterface.h:2468
kRegCS4Coefficients1_2
@ kRegCS4Coefficients1_2
Definition: ntv2publicinterface.h:421
kRegShiftLUT6OutputBankSelect
@ kRegShiftLUT6OutputBankSelect
Definition: ntv2publicinterface.h:2487
kRegColorCorrection12BitLUTEvenShift
#define kRegColorCorrection12BitLUTEvenShift
Definition: ntv2publicinterface.h:4178
kRegShift12BitLUTSupport
@ kRegShift12BitLUTSupport
Definition: ntv2publicinterface.h:2491
kK2RegMaskCustomCoefficient12BitHigh
@ kK2RegMaskCustomCoefficient12BitHigh
Definition: ntv2publicinterface.h:1879
kRegColorCorrection12BitLUTOddShift
#define kRegColorCorrection12BitLUTOddShift
Definition: ntv2publicinterface.h:4177
kRegCh1ColorCorrectionControl
@ kRegCh1ColorCorrectionControl
Definition: ntv2publicinterface.h:171
kRegMaskLUT5Enable
@ kRegMaskLUT5Enable
Definition: ntv2publicinterface.h:1386
NTV2LUTControlSelect
NTV2LUTControlSelect
Definition: ntv2enums.h:3829
kRegCS7Coefficients1_2
@ kRegCS7Coefficients1_2
Definition: ntv2publicinterface.h:634
NTV2ColorSpaceMatrixType
NTV2ColorSpaceMatrixType
Definition: ntv2enums.h:3411
kColorCorrection12BitLUTOffset_Base
#define kColorCorrection12BitLUTOffset_Base
Definition: ntv2publicinterface.h:4186
NTV2_CCHOSTACCESS_CH3BANK1
@ NTV2_CCHOSTACCESS_CH3BANK1
Definition: ntv2enums.h:2040
xHEX0N
#define xHEX0N(__x__, __n__)
Definition: ntv2publicinterface.h:5605
kRegCS5Coefficients5_6
@ kRegCS5Coefficients5_6
Definition: ntv2publicinterface.h:490
kRegShiftLUT7Enable
@ kRegShiftLUT7Enable
Definition: ntv2publicinterface.h:2472
CNTV2Card::SetColorSpaceMethod
virtual bool SetColorSpaceMethod(const NTV2ColorSpaceMethod inCSCMethod, const NTV2Channel inChannel)
Selects the color space converter operation method.
Definition: ntv2csclut.cpp:364
NTV2_LUTRGBRangeFull_SMPTE
@ NTV2_LUTRGBRangeFull_SMPTE
Definition: ntv2enums.h:3526
kRegShiftLUTLoad
@ kRegShiftLUTLoad
Definition: ntv2publicinterface.h:3255
ntv2registerexpert.h
Declares the CNTV2RegisterExpert class.
AJAFUNC
#define AJAFUNC
Definition: ajatypes.h:325
kK2RegMaskEnhancedCSC4KMode
@ kK2RegMaskEnhancedCSC4KMode
Definition: ntv2publicinterface.h:1866
NTV2_CSC_Method_Original
@ NTV2_CSC_Method_Original
Definition: ntv2enums.h:3403
kRegCS7Coefficients3_4
@ kRegCS7Coefficients3_4
Definition: ntv2publicinterface.h:635
kReg3DLUTLoadControl
@ kReg3DLUTLoadControl
Definition: ntv2publicinterface.h:481
kRegShiftCC3OutputBankSelect
@ kRegShiftCC3OutputBankSelect
Definition: ntv2publicinterface.h:2457
CNTV2Card::ReadLUTTables
virtual bool ReadLUTTables(UWordSequence &outRedLUT, UWordSequence &outGreenLUT, UWordSequence &outBlueLUT)
Reads the LUT tables (as raw, unsigned 10-bit integers).
Definition: ntv2csclut.cpp:1039
kRegMaskLUTLoad
@ kRegMaskLUTLoad
Definition: ntv2publicinterface.h:2195
kRegShiftLUT1HostAccessBankSelect
@ kRegShiftLUT1HostAccessBankSelect
Definition: ntv2publicinterface.h:2474
CNTV2Card::SetLUTV2OutputBank
virtual bool SetLUTV2OutputBank(const NTV2Channel inLUTWidget, const ULWord inBank)
Definition: ntv2csclut.cpp:102
CNTV2Card::SetColorSpaceRGBBlackRange
virtual bool SetColorSpaceRGBBlackRange(const NTV2_CSC_RGB_Range inRange, const NTV2Channel inChannel=NTV2_CHANNEL1)
Sets the RGB range for the given CSC.
Definition: ntv2csclut.cpp:1165
kRegCh2ColorCorrectionControl
@ kRegCh2ColorCorrectionControl
Definition: ntv2publicinterface.h:172
CNTV2Card::SetColorSpaceMatrixSelect
virtual bool SetColorSpaceMatrixSelect(const NTV2ColorSpaceMatrixType inType, const NTV2Channel inChannel=NTV2_CHANNEL1)
Sets the matrix type to be used for the given CSC, typically NTV2_Rec601Matrix or NTV2_Rec709Matrix.
Definition: ntv2csclut.cpp:452
debug.h
Declares the AJADebug class.
kRegEnhancedCSC4Mode
@ kRegEnhancedCSC4Mode
Definition: ntv2publicinterface.h:910
NTV2_CCHOSTACCESS_CH1BANK0
@ NTV2_CCHOSTACCESS_CH1BANK0
Definition: ntv2enums.h:2035
kRegCS5Coefficients1_2
@ kRegCS5Coefficients1_2
Definition: ntv2publicinterface.h:488
kLUTBank_FULL2SMPTE
#define kLUTBank_FULL2SMPTE
Definition: ntv2enums.h:3511
kK2RegShiftCustomCoefficientLow
@ kK2RegShiftCustomCoefficientLow
Definition: ntv2publicinterface.h:2919
kRegMaskLUT4Enable
@ kRegMaskLUT4Enable
Definition: ntv2publicinterface.h:1385
kReg1DLUTLoadControl6
@ kReg1DLUTLoadControl6
Definition: ntv2publicinterface.h:787
kRegCS7Coefficients9_10
@ kRegCS7Coefficients9_10
Definition: ntv2publicinterface.h:638
kRegMaskLUT3HostAccessBankSelect
@ kRegMaskLUT3HostAccessBankSelect
Definition: ntv2publicinterface.h:1392
kRegCSCoefficients9_10
@ kRegCSCoefficients9_10
Definition: ntv2publicinterface.h:263
kRegGlobalControl
@ kRegGlobalControl
Definition: ntv2publicinterface.h:102