37 #define NTV2UTILS_ENUM_CASE_RETURN_STR(enum_name) case(enum_name): return #enum_name 39 #define NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(condition, retail_name, enum_name)\ 40 case(enum_name): return condition ? retail_name : #enum_name 48 uint32_t rowBytes = 0;
50 switch (inPixelFormat)
54 rowBytes = inPixelWidth * 2;
59 rowBytes = (( inPixelWidth % 48 == 0 ) ? inPixelWidth : (((inPixelWidth / 48 ) + 1) * 48)) * 8 / 3;
69 rowBytes = inPixelWidth * 4;
74 rowBytes = inPixelWidth * 3;
78 rowBytes = inPixelWidth * 2/4;
82 rowBytes = inPixelWidth * 6;
86 rowBytes = inPixelWidth * 36 / 8;
91 rowBytes = inPixelWidth * 20 / 16;
96 rowBytes = inPixelWidth;
100 rowBytes = inPixelWidth * 5;
125 out16BitYUVLine.clear();
126 const ULWord * pInputLine (reinterpret_cast <const ULWord *> (pIn10BitYUVLine));
133 inNumPixels -= inNumPixels % 6;
135 const ULWord totalULWords (inNumPixels * 4 / 6);
136 out16BitYUVLine.reserve(totalULWords * 3);
137 for (
ULWord inputCount (0); inputCount < totalULWords; inputCount++)
139 out16BitYUVLine.push_back ((pInputLine [inputCount] ) & 0x3FF);
140 out16BitYUVLine.push_back ((pInputLine [inputCount] >> 10) & 0x3FF);
141 out16BitYUVLine.push_back ((pInputLine [inputCount] >> 20) & 0x3FF);
149 out16BitYUVLine.clear();
150 const ULWord * pInputLine (reinterpret_cast <const ULWord *> (pIn10BitYUVLine));
161 out16BitYUVLine.reserve(inFormatDesc.
linePitch * 3);
162 for (
ULWord inputCount (0); inputCount < inFormatDesc.
linePitch; inputCount++)
164 out16BitYUVLine.push_back ((pInputLine [inputCount] ) & 0x3FF);
165 out16BitYUVLine.push_back ((pInputLine [inputCount] >> 10) & 0x3FF);
166 out16BitYUVLine.push_back ((pInputLine [inputCount] >> 20) & 0x3FF);
174 out16BitARGBLine.clear();
175 const UByte * pInputLine (reinterpret_cast <const UByte *> (pIn10BitARGBLine));
186 out16BitARGBLine.reserve(inFormatDesc.
linePitch * 4);
187 for (
ULWord inputCount (0); inputCount < inFormatDesc.
linePitch; inputCount++)
189 out16BitARGBLine.push_back ((
UWord(pInputLine[1] & 0x03) << 8) | (
UWord(pInputLine[0] & 0xFF) >> 0));
190 out16BitARGBLine.push_back ((
UWord(pInputLine[2] & 0x0F) << 6) | (
UWord(pInputLine[1] & 0xFC) >> 2));
191 out16BitARGBLine.push_back ((
UWord(pInputLine[3] & 0x3F) << 4) | (
UWord(pInputLine[2] & 0xF0) >> 4));
192 out16BitARGBLine.push_back ((
UWord(pInputLine[4] & 0xFF) << 2) | (
UWord(pInputLine[3] & 0xC0) >> 6));
203 for ( uint32_t sampleCount = 0, dataCount = 0;
204 sampleCount < (numPixels*2) ;
205 sampleCount+=3,dataCount++ )
207 ycbcrBuffer[sampleCount] = packedBuffer[dataCount]&0x3FF;
208 ycbcrBuffer[sampleCount+1] = (packedBuffer[dataCount]>>10)&0x3FF;
209 ycbcrBuffer[sampleCount+2] = (packedBuffer[dataCount]>>20)&0x3FF;
218 for ( uint32_t inputCount=0, outputCount=0;
219 inputCount < (numPixels*2);
220 outputCount += 4, inputCount += 12 )
222 packedBuffer[outputCount] = uint32_t (ycbcrBuffer[inputCount+0]) + uint32_t (ycbcrBuffer[inputCount+1]<<10) + uint32_t (ycbcrBuffer[inputCount+2]<<20);
223 packedBuffer[outputCount+1] = uint32_t (ycbcrBuffer[inputCount+3]) + uint32_t (ycbcrBuffer[inputCount+4]<<10) + uint32_t (ycbcrBuffer[inputCount+5]<<20);
224 packedBuffer[outputCount+2] = uint32_t (ycbcrBuffer[inputCount+6]) + uint32_t (ycbcrBuffer[inputCount+7]<<10) + uint32_t (ycbcrBuffer[inputCount+8]<<20);
225 packedBuffer[outputCount+3] = uint32_t (ycbcrBuffer[inputCount+9]) + uint32_t (ycbcrBuffer[inputCount+10]<<10) + uint32_t (ycbcrBuffer[inputCount+11]<<20);
232 for ( uint32_t count = 0; count < numPixels*2; count+=4 )
236 buffer[count+2] = Cr;
246 for (uint32_t pixel(0); pixel < numPixels * 2; pixel++)
247 ycbcr8BitBuffer[pixel] = uint8_t(ycbcr10BitBuffer[pixel] >> 2);
256 bool bUseSmpteRange,
bool bAlphaFromLuma)
273 ConvertLinetoRGB(unPackedBuffer, reinterpret_cast<RGBAlphaPixel*>(packedBuffer), numPixels, bIsSD, bUseSmpteRange, bAlphaFromLuma);
277 ConvertLinetoRGB(unPackedBuffer, reinterpret_cast<RGBAlphaPixel*>(packedBuffer), numPixels, bIsSD, bUseSmpteRange, bAlphaFromLuma);
282 ConvertLineto10BitRGB(unPackedBuffer, reinterpret_cast<RGBAlpha10BitPixel*>(packedBuffer), numPixels, bIsSD, bUseSmpteRange);
292 ConvertLinetoRGB(unPackedBuffer, reinterpret_cast<RGBAlphaPixel*>(packedBuffer), numPixels, bIsSD, bUseSmpteRange, bAlphaFromLuma);
297 ConvertLineto10BitRGB(unPackedBuffer, reinterpret_cast<RGBAlpha10BitPixel*>(packedBuffer), numPixels, bIsSD, bUseSmpteRange);
306 ConvertLinetoRGB(unPackedBuffer,reinterpret_cast<RGBAlphaPixel*>(packedBuffer), numPixels, bIsSD, bUseSmpteRange);
307 ConvertARGBToRGB(reinterpret_cast<UByte*>(packedBuffer), reinterpret_cast<UByte*>(packedBuffer), numPixels);
311 ConvertLinetoRGB(unPackedBuffer,reinterpret_cast<RGBAlphaPixel*>(packedBuffer), numPixels, bIsSD, bUseSmpteRange);
312 ConvertARGBToBGR(reinterpret_cast<UByte*>(packedBuffer), reinterpret_cast<UByte*>(packedBuffer), numPixels);
316 ConvertLineto10BitRGB(unPackedBuffer, reinterpret_cast<RGBAlpha10BitPixel*>(packedBuffer), numPixels, bIsSD, bUseSmpteRange);
321 ConvertLineto16BitRGB(unPackedBuffer, reinterpret_cast<RGBAlpha16BitPixel*>(packedBuffer), numPixels, bIsSD, bUseSmpteRange);
322 Convert16BitARGBTo16BitRGB(reinterpret_cast<RGBAlpha16BitPixel*>(packedBuffer), reinterpret_cast<UWord*>(packedBuffer), numPixels);
326 ConvertLineto10BitRGB(unPackedBuffer, reinterpret_cast<RGBAlpha10BitPixel*>(packedBuffer), numPixels, bIsSD, bUseSmpteRange);
331 ConvertLineto10BitRGB(unPackedBuffer, reinterpret_cast<RGBAlpha10BitPixel*>(packedBuffer), numPixels, bIsSD, bUseSmpteRange, bAlphaFromLuma);
336 ConvertLineto16BitRGB(unPackedBuffer, reinterpret_cast<RGBAlpha16BitPixel*>(packedBuffer), numPixels, bIsSD, bUseSmpteRange);
372 switch ( signalMask )
375 for ( pixelCount = 0; pixelCount < (numPixels*2); pixelCount += 4 )
384 for ( pixelCount = 0; pixelCount < (numPixels*2); pixelCount += 4 )
392 for ( pixelCount = 0; pixelCount < (numPixels*2); pixelCount += 4 )
401 for ( pixelCount = 0; pixelCount < (numPixels*2); pixelCount += 4 )
409 for ( pixelCount = 0; pixelCount < (numPixels*2); pixelCount += 4 )
419 for ( pixelCount = 0; pixelCount < (numPixels*2); pixelCount += 4 )
427 for ( pixelCount = 0; pixelCount < (numPixels*2); pixelCount += 4 )
450 void StackQuadrants(uint8_t* pSrc, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcRowBytes,
456 uint32_t copyRowBytes = srcRowBytes/2;
457 uint32_t copyHeight = srcHeight/2;
458 uint32_t dstRowBytes = copyRowBytes;
459 uint32_t dstHeight = srcHeight/2;
463 uint32_t srcLHSQuadrantRowBytes = srcRowBytes/2;
465 for (uint32_t quadrant=0; quadrant<4; quadrant++)
471 case 0: srcSample = 0;
break;
472 case 1: srcSample = srcLHSQuadrantRowBytes;
break;
473 case 2: srcSample = (srcRowBytes*copyHeight);
break;
474 case 3: srcSample = (srcRowBytes*copyHeight) + srcLHSQuadrantRowBytes;
break;
478 dstSample = quadrant * dstRowBytes * dstHeight;
480 for (uint32_t row=0; row<copyHeight; row++)
482 memcpy(&pDst[dstSample], &pSrc[srcSample], copyRowBytes);
483 dstSample += dstRowBytes;
484 srcSample += srcRowBytes;
491 void CopyFromQuadrant(uint8_t* srcBuffer, uint32_t srcHeight, uint32_t srcRowBytes, uint32_t srcQuadrant, uint8_t* dstBuffer, uint32_t quad13Offset)
495 ULWord dstHeight = srcHeight / 2;
496 ULWord dstRowBytes = srcRowBytes / 2;
502 case 0: srcSample = 0;
break;
503 case 1: srcSample = dstRowBytes - quad13Offset;
break;
504 case 2: srcSample = srcRowBytes*dstHeight;
break;
505 case 3: srcSample = srcRowBytes*dstHeight + dstRowBytes - quad13Offset;
break;
509 for (
ULWord i=0; i<dstHeight; i++)
511 memcpy(&dstBuffer[dstSample], &srcBuffer[srcSample], dstRowBytes);
512 dstSample += dstRowBytes;
513 srcSample += srcRowBytes;
519 void CopyToQuadrant(uint8_t* srcBuffer, uint32_t srcHeight, uint32_t srcRowBytes, uint32_t dstQuadrant, uint8_t* dstBuffer, uint32_t quad13Offset)
523 ULWord dstRowBytes = srcRowBytes * 2;
529 case 0: dstSample = 0;
break;
530 case 1: dstSample = srcRowBytes - quad13Offset;
break;
531 case 2: dstSample = dstRowBytes*srcHeight;
break;
532 case 3: dstSample = dstRowBytes*srcHeight + srcRowBytes - quad13Offset;
break;
536 for (
ULWord i=0; i<srcHeight; i++)
538 memcpy(&dstBuffer[dstSample], &srcBuffer[srcSample], srcRowBytes);
539 dstSample += dstRowBytes;
540 srcSample += srcRowBytes;
550 NTV2_ASSERT (pIn10BitYUVLine && pOut16BitYUVLine &&
"UnpackLine_10BitYUVto16BitYUV -- NULL buffer pointer(s)");
551 NTV2_ASSERT (inNumPixels &&
"UnpackLine_10BitYUVto16BitYUV -- Zero pixel count");
553 for (
ULWord outputCount = 0, inputCount = 0;
554 outputCount < (inNumPixels * 2);
555 outputCount += 3, inputCount++)
557 pOut16BitYUVLine [outputCount ] = pIn10BitYUVLine [inputCount] & 0x3FF;
558 pOut16BitYUVLine [outputCount + 1] = (pIn10BitYUVLine [inputCount] >> 10) & 0x3FF;
559 pOut16BitYUVLine [outputCount + 2] = (pIn10BitYUVLine [inputCount] >> 20) & 0x3FF;
566 NTV2_ASSERT (pIn16BitYUVLine && pOut10BitYUVLine &&
"PackLine_16BitYUVto10BitYUV -- NULL buffer pointer(s)");
567 NTV2_ASSERT (inNumPixels &&
"PackLine_16BitYUVto10BitYUV -- Zero pixel count");
569 for (
ULWord inputCount = 0, outputCount = 0;
570 inputCount < (inNumPixels * 2);
571 outputCount += 4, inputCount += 12)
573 pOut10BitYUVLine [outputCount ] =
ULWord (pIn16BitYUVLine [inputCount + 0]) + (
ULWord (pIn16BitYUVLine [inputCount + 1]) << 10) + (
ULWord (pIn16BitYUVLine [inputCount + 2]) << 20);
574 pOut10BitYUVLine [outputCount + 1] =
ULWord (pIn16BitYUVLine [inputCount + 3]) + (
ULWord (pIn16BitYUVLine [inputCount + 4]) << 10) + (
ULWord (pIn16BitYUVLine [inputCount + 5]) << 20);
575 pOut10BitYUVLine [outputCount + 2] =
ULWord (pIn16BitYUVLine [inputCount + 6]) + (
ULWord (pIn16BitYUVLine [inputCount + 7]) << 10) + (
ULWord (pIn16BitYUVLine [inputCount + 8]) << 20);
576 pOut10BitYUVLine [outputCount + 3] =
ULWord (pIn16BitYUVLine [inputCount + 9]) + (
ULWord (pIn16BitYUVLine [inputCount +10]) << 10) + (
ULWord (pIn16BitYUVLine [inputCount +11]) << 20);
583 if (!pOut10BitYUVLine)
587 if (
ULWord(in16BitYUVLine.size()) < inNumPixels*2)
590 for (
ULWord inputCount = 0, outputCount = 0;
591 inputCount < (inNumPixels * 2);
592 outputCount += 4, inputCount += 12)
594 pOut10BitYUVLine[outputCount ] =
ULWord(in16BitYUVLine[inputCount + 0]) + (
ULWord(in16BitYUVLine[inputCount + 1]) << 10) + (
ULWord(in16BitYUVLine[inputCount + 2]) << 20);
595 pOut10BitYUVLine[outputCount + 1] =
ULWord(in16BitYUVLine[inputCount + 3]) + (
ULWord(in16BitYUVLine[inputCount + 4]) << 10) + (
ULWord(in16BitYUVLine[inputCount + 5]) << 20);
596 pOut10BitYUVLine[outputCount + 2] =
ULWord(in16BitYUVLine[inputCount + 6]) + (
ULWord(in16BitYUVLine[inputCount + 7]) << 10) + (
ULWord(in16BitYUVLine[inputCount + 8]) << 20);
597 pOut10BitYUVLine[outputCount + 3] =
ULWord(in16BitYUVLine[inputCount + 9]) + (
ULWord(in16BitYUVLine[inputCount +10]) << 10) + (
ULWord(in16BitYUVLine[inputCount +11]) << 20);
606 if (inYCbCrLine.size() < 12)
608 if (inFrameBuffer.
IsNULL())
618 uint32_t * pOutPackedLine (
AJA_NULL);
626 for (uint32_t inputCount = 0, outputCount = 0; inputCount < pixPerLineX2; outputCount += 4, inputCount += 12)
628 if ((inputCount+11) >= uint32_t(inYCbCrLine.size()))
630 #if defined(_DEBUG) // 'at' throws upon bad index values 631 pOutPackedLine[outputCount] = uint32_t(inYCbCrLine.at(inputCount+0)) | uint32_t(inYCbCrLine.at(inputCount+ 1)<<10) | uint32_t(inYCbCrLine.at(inputCount+ 2)<<20);
632 pOutPackedLine[outputCount+1] = uint32_t(inYCbCrLine.at(inputCount+3)) | uint32_t(inYCbCrLine.at(inputCount+ 4)<<10) | uint32_t(inYCbCrLine.at(inputCount+ 5)<<20);
633 pOutPackedLine[outputCount+2] = uint32_t(inYCbCrLine.at(inputCount+6)) | uint32_t(inYCbCrLine.at(inputCount+ 7)<<10) | uint32_t(inYCbCrLine.at(inputCount+ 8)<<20);
634 pOutPackedLine[outputCount+3] = uint32_t(inYCbCrLine.at(inputCount+9)) | uint32_t(inYCbCrLine.at(inputCount+10)<<10) | uint32_t(inYCbCrLine.at(inputCount+11)<<20);
635 #else // 'operator[]' doesn't throw 636 pOutPackedLine[outputCount] = uint32_t(inYCbCrLine[inputCount+0]) | uint32_t(inYCbCrLine[inputCount+ 1]<<10) | uint32_t(inYCbCrLine[inputCount+ 2]<<20);
637 pOutPackedLine[outputCount+1] = uint32_t(inYCbCrLine[inputCount+3]) | uint32_t(inYCbCrLine[inputCount+ 4]<<10) | uint32_t(inYCbCrLine[inputCount+ 5]<<20);
638 pOutPackedLine[outputCount+2] = uint32_t(inYCbCrLine[inputCount+6]) | uint32_t(inYCbCrLine[inputCount+ 7]<<10) | uint32_t(inYCbCrLine[inputCount+ 8]<<20);
639 pOutPackedLine[outputCount+3] = uint32_t(inYCbCrLine[inputCount+9]) | uint32_t(inYCbCrLine[inputCount+10]<<10) | uint32_t(inYCbCrLine[inputCount+11]<<20);
649 outYCbCrLine.clear();
650 if (inFrameBuffer.
IsNULL())
662 outYCbCrLine.reserve (inDescriptor.
linePitch * 3);
663 for (
ULWord inputCount(0); inputCount < inDescriptor.
linePitch; inputCount++)
665 outYCbCrLine.push_back((pInputLine[inputCount] ) & 0x3FF);
666 outYCbCrLine.push_back((pInputLine[inputCount] >> 10) & 0x3FF);
667 outYCbCrLine.push_back((pInputLine[inputCount] >> 20) & 0x3FF);
676 for (
UWord count = 0; count < numULWords; count++)
678 ULWord value = (packedycbcrLine[count])<<2;
679 value = (value<<24) + ((value>>24)&0x000000FF) + ((value<<8)&0x00FF0000) + ((value>>8)&0x0000FF00);
681 packedycbcrLine[count] = value;
687 for (
ULWord pixel=0;pixel<numPixels;pixel++)
689 ULWord value = DPXLinebuffer[pixel];
692 rgba10BitBuffer[pixel].
Red =
UWord((value&0xC0)>>14) +
UWord((value&0xFF)<<2);
693 rgba10BitBuffer[pixel].
Green =
UWord((value&0x3F00)>>4) +
UWord((value&0xF00000)>>20);
694 rgba10BitBuffer[pixel].
Blue =
UWord((value&0xFC000000)>>26) +
UWord((value&0xF0000)>>12);
698 rgba10BitBuffer[pixel].
Red = (value>>22)&0x3FF;
699 rgba10BitBuffer[pixel].
Green = (value>>12)&0x3FF;
700 rgba10BitBuffer[pixel].
Blue = (value>>2)&0x3FF;
709 for (
ULWord pixel=0;pixel<numPixels;pixel++)
711 ULWord value = DPXLinebuffer[pixel];
712 rawrp215Buffer[pixel] = ((value&0x3F00)>>4) + ((value&0xF00000)>>20);
719 for (
ULWord pixel=0;pixel<numPixels;pixel++)
721 ULWord value = DPXLinebuffer[pixel];
722 rawrp215Buffer[pixel] = ((value&0x3F)>>4) + ((value&0xF00000)>>20);
733 switch ( signalMask )
736 for ( pixelCount = 0; pixelCount < (numPixels*2); pixelCount += 4 )
745 for ( pixelCount = 0; pixelCount < (numPixels*2); pixelCount += 4 )
753 for ( pixelCount = 0; pixelCount < (numPixels*2); pixelCount += 4 )
762 for ( pixelCount = 0; pixelCount < (numPixels*2); pixelCount += 4 )
770 for ( pixelCount = 0; pixelCount < (numPixels*2); pixelCount += 4 )
780 for ( pixelCount = 0; pixelCount < (numPixels*2); pixelCount += 4 )
788 for ( pixelCount = 0; pixelCount < (numPixels*2); pixelCount += 4 )
808 if (pOutLineData && inNumPixels)
809 for (
ULWord count(0); count < inNumPixels; count++)
821 if (pOutLineData && inNumPixels)
822 for (
ULWord count(0); count < inNumPixels; count++)
832 if (pOutLineData && inNumPixels)
833 for (
ULWord count(0); count < inNumPixels*2; count+=4)
835 pOutLineData[count] = Cb;
836 pOutLineData[count+1] = Y;
837 pOutLineData[count+2] = Cr;
838 pOutLineData[count+3] = Y;
848 if (!pBaseVideoAddress)
852 UWord lineBuffer[2048*2];
853 ULWord * pBaseAddress (reinterpret_cast<ULWord*>(pBaseVideoAddress));
870 for ( uint32_t count = 0; count < numPixels*2; count+=2 )
879 for ( uint32_t count = 0; count < numPixels*2; count+=2 )
893 for ( uint32_t count = 0; count < numPixels*2; count+=2 )
902 for ( uint32_t count = 0; count < numPixels*2; count+=2 )
916 for (
ULWord count = 0; count < numPixels*2; count += 4)
918 lineData[count] = Cb;
919 lineData[count+1] = Y;
920 lineData[count+2] = Cr;
921 lineData[count+3] = Y;
926 for (
ULWord count = 0; count < numPixels*2; count += 4)
929 lineData[count+1] = Cb;
930 lineData[count+2] = Y;
931 lineData[count+3] = Cr;
940 if (!pBaseVideoAddress)
944 UByte * pBaseAddress (reinterpret_cast<UByte*>(pBaseVideoAddress));
990 ULWord topPad = 0, bottomPad = 0, leftPad = 0, rightPad = 0;
993 ULWord* pSrc = pSrcBuffer;
994 ULWord* pDst = pDstBuffer;
996 if (dstHeight > srcHeight)
998 topPad = (dstHeight - srcHeight) / 2;
999 bottomPad = dstHeight - topPad - srcHeight;
1002 pSrc += ((srcHeight - dstHeight) / 2) * srcWidth;
1004 if (dstWidth > srcWidth)
1006 leftPad = (dstWidth - srcWidth) / 2;
1007 rightPad = dstWidth - srcWidth - leftPad;
1010 pSrc += (srcWidth - dstWidth) / 2;
1013 contentHeight = dstHeight - topPad - bottomPad;
1014 contentWidth = dstWidth - leftPad - rightPad;
1017 memset(pDst, 0, topPad * dstWidth * 4);
1018 pDst += topPad * dstWidth;
1021 while (contentHeight--)
1024 memset(pDst, 0, leftPad * 4);
1028 memcpy(pDst, pSrc, contentWidth * 4);
1029 pDst += contentWidth;
1033 memset(pDst, 0, rightPad * 4);
1038 memset(pDst, 0, bottomPad * dstWidth * 4);
1043 const ULWord inDstBytesPerLine,
1044 const UWord inDstTotalLines)
1046 const ULWord dstMaxPixelWidth (inDstBytesPerLine / 2);
1047 UByte * pLine (pDstBuffer);
1049 for (
UWord lineNum(0); lineNum < inDstTotalLines; lineNum++)
1052 pLine += inDstBytesPerLine;
1059 const ULWord inDstBytesPerLine,
1060 const UWord inDstTotalLines)
1066 NTV2Buffer dstBuffer (pDstBuffer,
ULWord(inDstTotalLines) * inDstBytesPerLine);
1067 const ULWord dstMaxPixelWidth (inDstBytesPerLine / 16 * 6);
1070 for (
UWord lineNum(1); lineNum < inDstTotalLines; lineNum++)
1071 if (!dstBuffer.
CopyFrom (dstBuffer,
1073 ULWord(lineNum) * inDstBytesPerLine,
1081 const ULWord inDstBytesPerLine,
1082 const UWord inDstTotalLines)
1084 const ULWord dstMaxPixelWidth (inDstBytesPerLine / 2);
1085 UByte * pLine (pDstBuffer);
1087 for (
UWord lineNum(0); lineNum < inDstTotalLines; lineNum++)
1090 pLine += inDstBytesPerLine;
1097 const ULWord inDstBytesPerLine,
1098 const UWord inDstTotalLines)
1104 NTV2Buffer dstBuffer (pDstBuffer,
ULWord(inDstTotalLines) * inDstBytesPerLine);
1105 const ULWord dstMaxPixelWidth (inDstBytesPerLine / 16 * 6);
1108 for (
UWord lineNum(1); lineNum < inDstTotalLines; lineNum++)
1109 if (!dstBuffer.
CopyFrom (dstBuffer,
1111 ULWord(lineNum) * inDstBytesPerLine,
1120 const ULWord inDstBytesPerLine,
1121 const UWord inDstTotalLines)
1125 if (inDstBytesPerLine == 0)
1127 if (inDstTotalLines == 0)
1130 switch (inPixelFormat)
1180 const ULWord inDstBytesPerLine,
1181 const UWord inDstTotalLines)
1185 if (inDstBytesPerLine == 0)
1187 if (inDstTotalLines == 0)
1190 switch (inPixelFormat)
1240 const UByte * pResult (pInFrameBuffer);
1243 pResult += inBytesPerVertLine *
ULWord(inVertLineOffset);
1244 pResult +=
ULWord(inBytesPerHorzPixel) *
ULWord(inHorzPixelOffset);
1251 UByte * pResult (pInFrameBuffer);
1254 pResult += inBytesPerVertLine *
ULWord(inVertLineOffset);
1255 pResult +=
ULWord(inBytesPerHorzPixel) *
ULWord(inHorzPixelOffset);
1262 const ULWord inDstBytesPerLine,
1263 const UWord inDstTotalLines,
1264 const UWord inDstVertLineOffset,
1265 const UWord inDstHorzPixelOffset,
1266 const UByte * pSrcBuffer,
1267 const ULWord inSrcBytesPerLine,
1268 const UWord inSrcTotalLines,
1269 const UWord inSrcVertLineOffset,
1270 const UWord inSrcVertLinesToCopy,
1271 const UWord inSrcHorzPixelOffset,
1272 const UWord inSrcHorzPixelsToCopy)
1274 if (inDstHorzPixelOffset & 1)
1276 if (inSrcHorzPixelOffset & 1)
1279 const ULWord TWO_BYTES_PER_PIXEL (2);
1280 const ULWord dstMaxPixelWidth (inDstBytesPerLine / TWO_BYTES_PER_PIXEL);
1281 const ULWord srcMaxPixelWidth (inSrcBytesPerLine / TWO_BYTES_PER_PIXEL);
1282 UWord numHorzPixelsToCopy (inSrcHorzPixelsToCopy);
1283 UWord numVertLinesToCopy (inSrcVertLinesToCopy);
1285 if (inDstHorzPixelOffset >= dstMaxPixelWidth)
1287 if (inSrcHorzPixelOffset >= srcMaxPixelWidth)
1289 if (
ULWord(inSrcHorzPixelOffset + inSrcHorzPixelsToCopy) > srcMaxPixelWidth)
1290 numHorzPixelsToCopy -= inSrcHorzPixelOffset + inSrcHorzPixelsToCopy - srcMaxPixelWidth;
1291 if (inSrcVertLineOffset + inSrcVertLinesToCopy > inSrcTotalLines)
1292 numVertLinesToCopy -= inSrcVertLineOffset + inSrcVertLinesToCopy - inSrcTotalLines;
1293 if (numVertLinesToCopy + inDstVertLineOffset >= inDstTotalLines)
1295 if (numVertLinesToCopy + inDstVertLineOffset > inDstTotalLines)
1296 numVertLinesToCopy -= numVertLinesToCopy + inDstVertLineOffset - inDstTotalLines;
1301 const UByte * pSrc (::
GetReadAddress_2vuy (pSrcBuffer, inSrcBytesPerLine, inSrcVertLineOffset, inSrcHorzPixelOffset, TWO_BYTES_PER_PIXEL));
1302 UByte * pDst (::
GetWriteAddress_2vuy (pDstBuffer, inDstBytesPerLine, inDstVertLineOffset, inDstHorzPixelOffset, TWO_BYTES_PER_PIXEL));
1304 for (
UWord srcLinesToCopy (numVertLinesToCopy); srcLinesToCopy > 0; srcLinesToCopy--)
1306 UWord dstPixelsCopied (0);
1307 const UByte * pSavedSrc (pSrc);
1308 UByte * pSavedDst (pDst);
1309 for (
UWord hPixelsToCopy (numHorzPixelsToCopy); hPixelsToCopy > 0; hPixelsToCopy--)
1314 if (dstPixelsCopied + inDstHorzPixelOffset >=
UWord(dstMaxPixelWidth))
1316 pDst += TWO_BYTES_PER_PIXEL;
1317 pSrc += TWO_BYTES_PER_PIXEL;
1321 pSrc += inSrcBytesPerLine;
1322 pDst += inDstBytesPerLine;
1331 const ULWord inDstBytesPerLine,
1332 const UWord inDstTotalLines,
1333 const UWord inDstVertLineOffset,
1334 const UWord inDstHorzPixelOffset,
1335 const UByte * pSrcBuffer,
1336 const ULWord inSrcBytesPerLine,
1337 const UWord inSrcTotalLines,
1338 const UWord inSrcVertLineOffset,
1339 const UWord inSrcVertLinesToCopy,
1340 const UWord inSrcHorzPixelOffset,
1341 const UWord inSrcHorzPixelsToCopy)
1343 if (inDstHorzPixelOffset % 6)
1345 if (inSrcHorzPixelOffset % 6)
1347 if (inDstBytesPerLine % 16)
1349 if (inSrcBytesPerLine % 16)
1351 if (inSrcHorzPixelsToCopy % 6)
1354 const ULWord dstMaxPixelWidth (inDstBytesPerLine / 16 * 6);
1355 const ULWord srcMaxPixelWidth (inSrcBytesPerLine / 16 * 6);
1356 ULWord numHorzPixelsToCopy (inSrcHorzPixelsToCopy);
1357 UWord numVertLinesToCopy (inSrcVertLinesToCopy);
1359 if (inDstHorzPixelOffset >= dstMaxPixelWidth)
1361 if (inSrcHorzPixelOffset >= srcMaxPixelWidth)
1363 if (inSrcHorzPixelOffset + inSrcHorzPixelsToCopy >
UWord(srcMaxPixelWidth))
1364 numHorzPixelsToCopy -= inSrcHorzPixelOffset + inSrcHorzPixelsToCopy - srcMaxPixelWidth;
1365 if (inDstHorzPixelOffset + numHorzPixelsToCopy > dstMaxPixelWidth)
1366 numHorzPixelsToCopy = inDstHorzPixelOffset + numHorzPixelsToCopy - dstMaxPixelWidth;
1368 if (inSrcVertLineOffset + inSrcVertLinesToCopy > inSrcTotalLines)
1369 numVertLinesToCopy -= inSrcVertLineOffset + inSrcVertLinesToCopy - inSrcTotalLines;
1370 if (numVertLinesToCopy + inDstVertLineOffset >= inDstTotalLines)
1372 if (numVertLinesToCopy + inDstVertLineOffset > inDstTotalLines)
1373 numVertLinesToCopy -= numVertLinesToCopy + inDstVertLineOffset - inDstTotalLines;
1378 for (
UWord lineNdx (0); lineNdx < numVertLinesToCopy; lineNdx++)
1380 const UByte * pSrcLine (pSrcBuffer + inSrcBytesPerLine * (inSrcVertLineOffset + lineNdx) + inSrcHorzPixelOffset * 16 / 6);
1381 UByte * pDstLine (pDstBuffer + inDstBytesPerLine * (inDstVertLineOffset + lineNdx) + inDstHorzPixelOffset * 16 / 6);
1382 ::memcpy (pDstLine, pSrcLine, numHorzPixelsToCopy * 16 / 6);
1392 const ULWord inDstBytesPerLine,
1393 const UWord inDstTotalLines,
1394 const UWord inDstVertLineOffset,
1395 const UWord inDstHorzPixelOffset,
1396 const UByte * pSrcBuffer,
1397 const ULWord inSrcBytesPerLine,
1398 const UWord inSrcTotalLines,
1399 const UWord inSrcVertLineOffset,
1400 const UWord inSrcVertLinesToCopy,
1401 const UWord inSrcHorzPixelOffset,
1402 const UWord inSrcHorzPixelsToCopy)
1404 if (inDstHorzPixelOffset % 16)
1406 if (inSrcHorzPixelOffset % 16)
1408 if (inDstBytesPerLine % 20)
1410 if (inSrcBytesPerLine % 20)
1412 if (inSrcHorzPixelsToCopy % 16)
1415 const ULWord dstMaxPixelWidth (inDstBytesPerLine / 20 * 16);
1416 const ULWord srcMaxPixelWidth (inSrcBytesPerLine / 20 * 16);
1417 ULWord numHorzPixelsToCopy (inSrcHorzPixelsToCopy);
1418 UWord numVertLinesToCopy (inSrcVertLinesToCopy);
1420 if (inDstHorzPixelOffset >= dstMaxPixelWidth)
1422 if (inSrcHorzPixelOffset >= srcMaxPixelWidth)
1424 if (inSrcHorzPixelOffset + inSrcHorzPixelsToCopy >
UWord(srcMaxPixelWidth))
1425 numHorzPixelsToCopy -= inSrcHorzPixelOffset + inSrcHorzPixelsToCopy - srcMaxPixelWidth;
1426 if (inDstHorzPixelOffset + numHorzPixelsToCopy > dstMaxPixelWidth)
1427 numHorzPixelsToCopy = inDstHorzPixelOffset + numHorzPixelsToCopy - dstMaxPixelWidth;
1429 if (inSrcVertLineOffset + inSrcVertLinesToCopy > inSrcTotalLines)
1430 numVertLinesToCopy -= inSrcVertLineOffset + inSrcVertLinesToCopy - inSrcTotalLines;
1431 if (numVertLinesToCopy + inDstVertLineOffset >= inDstTotalLines)
1433 if (numVertLinesToCopy + inDstVertLineOffset > inDstTotalLines)
1434 numVertLinesToCopy -= numVertLinesToCopy + inDstVertLineOffset - inDstTotalLines;
1439 for (
UWord lineNdx (0); lineNdx < numVertLinesToCopy; lineNdx++)
1441 const UByte * pSrcLine (pSrcBuffer + inSrcBytesPerLine * (inSrcVertLineOffset + lineNdx) + inSrcHorzPixelOffset * 20 / 16);
1442 UByte * pDstLine (pDstBuffer + inDstBytesPerLine * (inDstVertLineOffset + lineNdx) + inDstHorzPixelOffset * 20 / 16);
1443 ::memcpy (pDstLine, pSrcLine, numHorzPixelsToCopy * 20 / 16);
1452 const ULWord inDstBytesPerLine,
1453 const UWord inDstTotalLines,
1454 const UWord inDstVertLineOffset,
1455 const UWord inDstHorzPixelOffset,
1456 const UByte * pSrcBuffer,
1457 const ULWord inSrcBytesPerLine,
1458 const UWord inSrcTotalLines,
1459 const UWord inSrcVertLineOffset,
1460 const UWord inSrcVertLinesToCopy,
1461 const UWord inSrcHorzPixelOffset,
1462 const UWord inSrcHorzPixelsToCopy)
1464 if (inDstHorzPixelOffset % 8)
1466 if (inSrcHorzPixelOffset % 8)
1468 if (inDstBytesPerLine % 36)
1470 if (inSrcBytesPerLine % 36)
1472 if (inSrcHorzPixelsToCopy % 8)
1475 const ULWord dstMaxPixelWidth (inDstBytesPerLine / 36 * 8);
1476 const ULWord srcMaxPixelWidth (inSrcBytesPerLine / 36 * 8);
1477 ULWord numHorzPixelsToCopy (inSrcHorzPixelsToCopy);
1478 UWord numVertLinesToCopy (inSrcVertLinesToCopy);
1480 if (inDstHorzPixelOffset >= dstMaxPixelWidth)
1482 if (inSrcHorzPixelOffset >= srcMaxPixelWidth)
1484 if (inSrcHorzPixelOffset + inSrcHorzPixelsToCopy >
UWord(srcMaxPixelWidth))
1485 numHorzPixelsToCopy -= inSrcHorzPixelOffset + inSrcHorzPixelsToCopy - srcMaxPixelWidth;
1486 if (inDstHorzPixelOffset + numHorzPixelsToCopy > dstMaxPixelWidth)
1487 numHorzPixelsToCopy = inDstHorzPixelOffset + numHorzPixelsToCopy - dstMaxPixelWidth;
1489 if (inSrcVertLineOffset + inSrcVertLinesToCopy > inSrcTotalLines)
1490 numVertLinesToCopy -= inSrcVertLineOffset + inSrcVertLinesToCopy - inSrcTotalLines;
1491 if (numVertLinesToCopy + inDstVertLineOffset >= inDstTotalLines)
1493 if (numVertLinesToCopy + inDstVertLineOffset > inDstTotalLines)
1494 numVertLinesToCopy -= numVertLinesToCopy + inDstVertLineOffset - inDstTotalLines;
1499 for (
UWord lineNdx (0); lineNdx < numVertLinesToCopy; lineNdx++)
1501 const UByte * pSrcLine (pSrcBuffer + inSrcBytesPerLine * (inSrcVertLineOffset + lineNdx) + inSrcHorzPixelOffset * 36 / 8);
1502 UByte * pDstLine (pDstBuffer + inDstBytesPerLine * (inDstVertLineOffset + lineNdx) + inDstHorzPixelOffset * 36 / 8);
1503 ::memcpy (pDstLine, pSrcLine, numHorzPixelsToCopy * 36 / 8);
1513 const ULWord inDstBytesPerLine,
1514 const UWord inDstTotalLines,
1515 const UWord inDstVertLineOffset,
1516 const UWord inDstHorzPixelOffset,
1517 const UByte * pSrcBuffer,
1518 const ULWord inSrcBytesPerLine,
1519 const UWord inSrcTotalLines,
1520 const UWord inSrcVertLineOffset,
1521 const UWord inSrcVertLinesToCopy,
1522 const UWord inSrcHorzPixelOffset,
1523 const UWord inSrcHorzPixelsToCopy)
1525 const UWord FIVE_BYTES_PER_PIXEL (5);
1527 if (inDstBytesPerLine % FIVE_BYTES_PER_PIXEL)
1529 if (inSrcBytesPerLine % FIVE_BYTES_PER_PIXEL)
1532 const ULWord dstMaxPixelWidth (inDstBytesPerLine / FIVE_BYTES_PER_PIXEL);
1533 const ULWord srcMaxPixelWidth (inSrcBytesPerLine / FIVE_BYTES_PER_PIXEL);
1534 ULWord numHorzPixelsToCopy (inSrcHorzPixelsToCopy);
1535 UWord numVertLinesToCopy (inSrcVertLinesToCopy);
1537 if (inDstHorzPixelOffset >= dstMaxPixelWidth)
1539 if (inSrcHorzPixelOffset >= srcMaxPixelWidth)
1541 if (inSrcHorzPixelOffset + inSrcHorzPixelsToCopy >
UWord(srcMaxPixelWidth))
1542 numHorzPixelsToCopy -= inSrcHorzPixelOffset + inSrcHorzPixelsToCopy - srcMaxPixelWidth;
1543 if (inDstHorzPixelOffset + numHorzPixelsToCopy > dstMaxPixelWidth)
1544 numHorzPixelsToCopy = inDstHorzPixelOffset + numHorzPixelsToCopy - dstMaxPixelWidth;
1545 if (inSrcVertLineOffset + inSrcVertLinesToCopy > inSrcTotalLines)
1546 numVertLinesToCopy -= inSrcVertLineOffset + inSrcVertLinesToCopy - inSrcTotalLines;
1547 if (numVertLinesToCopy + inDstVertLineOffset >= inDstTotalLines)
1549 if (numVertLinesToCopy + inDstVertLineOffset > inDstTotalLines)
1550 numVertLinesToCopy -= numVertLinesToCopy + inDstVertLineOffset - inDstTotalLines;
1555 for (
UWord lineNdx (0); lineNdx < numVertLinesToCopy; lineNdx++)
1557 const UByte * pSrcLine (pSrcBuffer + inSrcBytesPerLine * (inSrcVertLineOffset + lineNdx) + inSrcHorzPixelOffset * FIVE_BYTES_PER_PIXEL);
1558 UByte * pDstLine (pDstBuffer + inDstBytesPerLine * (inDstVertLineOffset + lineNdx) + inDstHorzPixelOffset * FIVE_BYTES_PER_PIXEL);
1559 ::memcpy (pDstLine, pSrcLine, numHorzPixelsToCopy * FIVE_BYTES_PER_PIXEL);
1569 const ULWord inDstBytesPerLine,
1570 const UWord inDstTotalLines,
1571 const UWord inDstVertLineOffset,
1572 const UWord inDstHorzPixelOffset,
1573 const UByte * pSrcBuffer,
1574 const ULWord inSrcBytesPerLine,
1575 const UWord inSrcTotalLines,
1576 const UWord inSrcVertLineOffset,
1577 const UWord inSrcVertLinesToCopy,
1578 const UWord inSrcHorzPixelOffset,
1579 const UWord inSrcHorzPixelsToCopy)
1581 const UWord FOUR_BYTES_PER_PIXEL (4);
1583 if (inDstBytesPerLine % FOUR_BYTES_PER_PIXEL)
1585 if (inSrcBytesPerLine % FOUR_BYTES_PER_PIXEL)
1588 const ULWord dstMaxPixelWidth (inDstBytesPerLine / FOUR_BYTES_PER_PIXEL);
1589 const ULWord srcMaxPixelWidth (inSrcBytesPerLine / FOUR_BYTES_PER_PIXEL);
1590 ULWord numHorzPixelsToCopy (inSrcHorzPixelsToCopy);
1591 UWord numVertLinesToCopy (inSrcVertLinesToCopy);
1593 if (inDstHorzPixelOffset >= dstMaxPixelWidth)
1595 if (inSrcHorzPixelOffset >= srcMaxPixelWidth)
1597 if (inSrcHorzPixelOffset + inSrcHorzPixelsToCopy >
UWord(srcMaxPixelWidth))
1598 numHorzPixelsToCopy -= inSrcHorzPixelOffset + inSrcHorzPixelsToCopy - srcMaxPixelWidth;
1599 if (inDstHorzPixelOffset + numHorzPixelsToCopy > dstMaxPixelWidth)
1600 numHorzPixelsToCopy = inDstHorzPixelOffset + numHorzPixelsToCopy - dstMaxPixelWidth;
1601 if (inSrcVertLineOffset + inSrcVertLinesToCopy > inSrcTotalLines)
1602 numVertLinesToCopy -= inSrcVertLineOffset + inSrcVertLinesToCopy - inSrcTotalLines;
1603 if (numVertLinesToCopy + inDstVertLineOffset >= inDstTotalLines)
1605 if (numVertLinesToCopy + inDstVertLineOffset > inDstTotalLines)
1606 numVertLinesToCopy -= numVertLinesToCopy + inDstVertLineOffset - inDstTotalLines;
1611 for (
UWord lineNdx (0); lineNdx < numVertLinesToCopy; lineNdx++)
1613 const UByte * pSrcLine (pSrcBuffer + inSrcBytesPerLine * (inSrcVertLineOffset + lineNdx) + inSrcHorzPixelOffset * FOUR_BYTES_PER_PIXEL);
1614 UByte * pDstLine (pDstBuffer + inDstBytesPerLine * (inDstVertLineOffset + lineNdx) + inDstHorzPixelOffset * FOUR_BYTES_PER_PIXEL);
1615 ::memcpy (pDstLine, pSrcLine, numHorzPixelsToCopy * FOUR_BYTES_PER_PIXEL);
1625 const ULWord inDstBytesPerLine,
1626 const UWord inDstTotalLines,
1627 const UWord inDstVertLineOffset,
1628 const UWord inDstHorzPixelOffset,
1629 const UByte * pSrcBuffer,
1630 const ULWord inSrcBytesPerLine,
1631 const UWord inSrcTotalLines,
1632 const UWord inSrcVertLineOffset,
1633 const UWord inSrcVertLinesToCopy,
1634 const UWord inSrcHorzPixelOffset,
1635 const UWord inSrcHorzPixelsToCopy)
1637 const UWord THREE_BYTES_PER_PIXEL (3);
1639 if (inDstBytesPerLine % THREE_BYTES_PER_PIXEL)
1641 if (inSrcBytesPerLine % THREE_BYTES_PER_PIXEL)
1644 const ULWord dstMaxPixelWidth (inDstBytesPerLine / THREE_BYTES_PER_PIXEL);
1645 const ULWord srcMaxPixelWidth (inSrcBytesPerLine / THREE_BYTES_PER_PIXEL);
1646 ULWord numHorzPixelsToCopy (inSrcHorzPixelsToCopy);
1647 UWord numVertLinesToCopy (inSrcVertLinesToCopy);
1649 if (inDstHorzPixelOffset >= dstMaxPixelWidth)
1651 if (inSrcHorzPixelOffset >= srcMaxPixelWidth)
1653 if (inSrcHorzPixelOffset + inSrcHorzPixelsToCopy >
UWord(srcMaxPixelWidth))
1654 numHorzPixelsToCopy -= inSrcHorzPixelOffset + inSrcHorzPixelsToCopy - srcMaxPixelWidth;
1655 if (inDstHorzPixelOffset + numHorzPixelsToCopy > dstMaxPixelWidth)
1656 numHorzPixelsToCopy = inDstHorzPixelOffset + numHorzPixelsToCopy - dstMaxPixelWidth;
1657 if (inSrcVertLineOffset + inSrcVertLinesToCopy > inSrcTotalLines)
1658 numVertLinesToCopy -= inSrcVertLineOffset + inSrcVertLinesToCopy - inSrcTotalLines;
1659 if (numVertLinesToCopy + inDstVertLineOffset >= inDstTotalLines)
1661 if (numVertLinesToCopy + inDstVertLineOffset > inDstTotalLines)
1662 numVertLinesToCopy -= numVertLinesToCopy + inDstVertLineOffset - inDstTotalLines;
1667 for (
UWord lineNdx (0); lineNdx < numVertLinesToCopy; lineNdx++)
1669 const UByte * pSrcLine (pSrcBuffer + inSrcBytesPerLine * (inSrcVertLineOffset + lineNdx) + inSrcHorzPixelOffset * THREE_BYTES_PER_PIXEL);
1670 UByte * pDstLine (pDstBuffer + inDstBytesPerLine * (inDstVertLineOffset + lineNdx) + inDstHorzPixelOffset * THREE_BYTES_PER_PIXEL);
1671 ::memcpy (pDstLine, pSrcLine, numHorzPixelsToCopy * THREE_BYTES_PER_PIXEL);
1681 const ULWord inDstBytesPerLine,
1682 const UWord inDstTotalLines,
1683 const UWord inDstVertLineOffset,
1684 const UWord inDstHorzPixelOffset,
1685 const UByte * pSrcBuffer,
1686 const ULWord inSrcBytesPerLine,
1687 const UWord inSrcTotalLines,
1688 const UWord inSrcVertLineOffset,
1689 const UWord inSrcVertLinesToCopy,
1690 const UWord inSrcHorzPixelOffset,
1691 const UWord inSrcHorzPixelsToCopy)
1693 const UWord SIX_BYTES_PER_PIXEL (6);
1695 if (inDstBytesPerLine % SIX_BYTES_PER_PIXEL)
1697 if (inSrcBytesPerLine % SIX_BYTES_PER_PIXEL)
1700 const ULWord dstMaxPixelWidth (inDstBytesPerLine / SIX_BYTES_PER_PIXEL);
1701 const ULWord srcMaxPixelWidth (inSrcBytesPerLine / SIX_BYTES_PER_PIXEL);
1702 ULWord numHorzPixelsToCopy (inSrcHorzPixelsToCopy);
1703 UWord numVertLinesToCopy (inSrcVertLinesToCopy);
1705 if (inDstHorzPixelOffset >= dstMaxPixelWidth)
1707 if (inSrcHorzPixelOffset >= srcMaxPixelWidth)
1709 if (inSrcHorzPixelOffset + inSrcHorzPixelsToCopy >
UWord(srcMaxPixelWidth))
1710 numHorzPixelsToCopy -= inSrcHorzPixelOffset + inSrcHorzPixelsToCopy - srcMaxPixelWidth;
1711 if (inDstHorzPixelOffset + numHorzPixelsToCopy > dstMaxPixelWidth)
1712 numHorzPixelsToCopy = inDstHorzPixelOffset + numHorzPixelsToCopy - dstMaxPixelWidth;
1713 if (inSrcVertLineOffset + inSrcVertLinesToCopy > inSrcTotalLines)
1714 numVertLinesToCopy -= inSrcVertLineOffset + inSrcVertLinesToCopy - inSrcTotalLines;
1715 if (numVertLinesToCopy + inDstVertLineOffset >= inDstTotalLines)
1717 if (numVertLinesToCopy + inDstVertLineOffset > inDstTotalLines)
1718 numVertLinesToCopy -= numVertLinesToCopy + inDstVertLineOffset - inDstTotalLines;
1723 for (
UWord lineNdx (0); lineNdx < numVertLinesToCopy; lineNdx++)
1725 const UByte * pSrcLine (pSrcBuffer + inSrcBytesPerLine * (inSrcVertLineOffset + lineNdx) + inSrcHorzPixelOffset * SIX_BYTES_PER_PIXEL);
1726 UByte * pDstLine (pDstBuffer + inDstBytesPerLine * (inDstVertLineOffset + lineNdx) + inDstHorzPixelOffset * SIX_BYTES_PER_PIXEL);
1727 ::memcpy (pDstLine, pSrcLine, numHorzPixelsToCopy * SIX_BYTES_PER_PIXEL);
1737 const ULWord inDstBytesPerLine,
1738 const UWord inDstTotalLines,
1739 const UWord inDstVertLineOffset,
1740 const UWord inDstHorzPixelOffset,
1741 const UByte * pSrcBuffer,
1742 const ULWord inSrcBytesPerLine,
1743 const UWord inSrcTotalLines,
1744 const UWord inSrcVertLineOffset,
1745 const UWord inSrcVertLinesToCopy,
1746 const UWord inSrcHorzPixelOffset,
1747 const UWord inSrcHorzPixelsToCopy)
1753 if (pDstBuffer == pSrcBuffer)
1755 if (inDstBytesPerLine == 0)
1757 if (inSrcBytesPerLine == 0)
1759 if (inDstTotalLines == 0)
1761 if (inSrcTotalLines == 0)
1763 if (inDstVertLineOffset >= inDstTotalLines)
1765 if (inSrcVertLineOffset >= inSrcTotalLines)
1767 switch (inPixelFormat)
1771 pSrcBuffer, inSrcBytesPerLine, inSrcTotalLines, inSrcVertLineOffset, inSrcVertLinesToCopy,
1772 inSrcHorzPixelOffset, inSrcHorzPixelsToCopy);
1776 pSrcBuffer, inSrcBytesPerLine, inSrcTotalLines, inSrcVertLineOffset, inSrcVertLinesToCopy,
1777 inSrcHorzPixelOffset, inSrcHorzPixelsToCopy);
1785 pSrcBuffer, inSrcBytesPerLine, inSrcTotalLines, inSrcVertLineOffset, inSrcVertLinesToCopy,
1786 inSrcHorzPixelOffset, inSrcHorzPixelsToCopy);
1790 pSrcBuffer, inSrcBytesPerLine, inSrcTotalLines, inSrcVertLineOffset, inSrcVertLinesToCopy,
1791 inSrcHorzPixelOffset, inSrcHorzPixelsToCopy);
1794 pSrcBuffer, inSrcBytesPerLine, inSrcTotalLines, inSrcVertLineOffset, inSrcVertLinesToCopy,
1795 inSrcHorzPixelOffset, inSrcHorzPixelsToCopy);
1798 pSrcBuffer, inSrcBytesPerLine, inSrcTotalLines, inSrcVertLineOffset, inSrcVertLinesToCopy,
1799 inSrcHorzPixelOffset, inSrcHorzPixelsToCopy);
1801 pSrcBuffer, inSrcBytesPerLine, inSrcTotalLines, inSrcVertLineOffset, inSrcVertLinesToCopy,
1802 inSrcHorzPixelOffset, inSrcHorzPixelsToCopy);
1805 pSrcBuffer, inSrcBytesPerLine, inSrcTotalLines, inSrcVertLineOffset, inSrcVertLinesToCopy,
1806 inSrcHorzPixelOffset, inSrcHorzPixelsToCopy);
1835 switch (inFrameRate)
1851 #if !defined(NTV2_DEPRECATE_16_0) 1864 return 30.0 / 1.001;
1870 switch (inFrameRate)
1873 case NTV2_FRAMERATE_11988: outFractionNumerator = 120000; outFractionDenominator = 1001;
break;
1875 case NTV2_FRAMERATE_5994: outFractionNumerator = 60000; outFractionDenominator = 1001;
break;
1878 case NTV2_FRAMERATE_4795: outFractionNumerator = 48000; outFractionDenominator = 1001;
break;
1880 case NTV2_FRAMERATE_2997: outFractionNumerator = 30000; outFractionDenominator = 1001;
break;
1883 case NTV2_FRAMERATE_2398: outFractionNumerator = 24000; outFractionDenominator = 1001;
break;
1885 case NTV2_FRAMERATE_1498: outFractionNumerator = 15000; outFractionDenominator = 1001;
break;
1886 #if !defined(NTV2_DEPRECATE_16_0) 1888 case NTV2_FRAMERATE_1898: outFractionNumerator = 19000; outFractionDenominator = 1001;
break;
1890 case NTV2_FRAMERATE_1798: outFractionNumerator = 18000; outFractionDenominator = 1001;
break;
1891 #endif // !defined(NTV2_DEPRECATE_16_0) 1896 default: outFractionNumerator = 0; outFractionDenominator = 0;
return false;
1905 switch (inScanGeometry)
1922 const UWord inHeightLines,
1923 const UWord inWidthPixels,
1924 const bool inIsInterlaced,
1925 const bool inIsLevelB,
1933 if (inIsPSF == ::
IsPSF(fmt))
1944 switch (inVideoFormat)
2125 return quarterSizedFormat;
2131 switch (inVideoFormat)
2312 return inVideoFormat;
2323 default:
return inGeometry;
2336 default:
return inGeometry;
2352 default:
return inStandard;
2370 default:
return inStandard;
2379 switch (inVideoFormat)
2548 #if defined (_DEBUG) 2602 switch (inVideoFormat)
2634 default: result = inVideoFormat;
break;
2648 switch (inVideoFormat)
2835 #if defined (_DEBUG) 2879 ulSize = ((ulSize / 4096) + 1) * 4096;
2892 ULWord audioSamplesPerFrame(0);
2893 inCadenceFrame %= 5;
2895 if (inIsSMPTE372Enabled)
2899 switch (inFrameRate)
2916 audioSamplesPerFrame = 400;
2919 switch (inCadenceFrame)
2923 case 4: audioSamplesPerFrame = 400;
break;
2926 case 3: audioSamplesPerFrame = 401;
break;
2930 audioSamplesPerFrame = 800;
2933 switch (inCadenceFrame)
2935 case 0: audioSamplesPerFrame = 800;
break;
2940 case 4: audioSamplesPerFrame = 801;
break;
2949 switch (inCadenceFrame)
2953 case 4: audioSamplesPerFrame = 1602;
break;
2956 case 3: audioSamplesPerFrame = 1601;
break;
2965 switch (inCadenceFrame)
2967 case 0: audioSamplesPerFrame = 3204;
break;
2972 case 4: audioSamplesPerFrame = 3203;
break;
2975 #if !defined(NTV2_DEPRECATE_16_0) 2981 case NTV2_FRAMERATE_UNKNOWN: 2983 audioSamplesPerFrame = 0;
2992 audioSamplesPerFrame = 800;
2995 switch (inCadenceFrame)
3000 case 3: audioSamplesPerFrame = 801;
break;
3002 case 4: audioSamplesPerFrame = 800;
break;
3007 switch (inCadenceFrame)
3011 case 4: audioSamplesPerFrame = 1602;
break;
3014 case 3: audioSamplesPerFrame = 1601;
break;
3023 switch (inCadenceFrame)
3025 case 0: audioSamplesPerFrame = 3204;
break;
3030 case 4: audioSamplesPerFrame = 3203;
break;
3039 switch (inCadenceFrame)
3041 case 0: audioSamplesPerFrame = 3204*2;
break;
3046 case 4: audioSamplesPerFrame = 3203*2;
break;
3049 #if !defined(NTV2_DEPRECATE_16_0) 3055 case NTV2_FRAMERATE_UNKNOWN: 3057 audioSamplesPerFrame = 0*2;
3066 audioSamplesPerFrame = 1600;
3069 switch (inCadenceFrame)
3073 case 4: audioSamplesPerFrame = 1602;
break;
3076 case 3: audioSamplesPerFrame = 1601;
break;
3080 audioSamplesPerFrame = 3200;
3083 switch (inCadenceFrame)
3085 case 0: audioSamplesPerFrame = 3204;
break;
3090 case 4: audioSamplesPerFrame = 3203;
break;
3099 switch (inCadenceFrame)
3102 case 1: audioSamplesPerFrame = 6407;
break;
3106 case 4: audioSamplesPerFrame = 6406;
break;
3115 switch (inCadenceFrame)
3120 case 3: audioSamplesPerFrame = 12813;
break;
3122 case 4: audioSamplesPerFrame = 12812;
break;
3125 #if !defined(NTV2_DEPRECATE_16_0) 3131 case NTV2_FRAMERATE_UNKNOWN: 3133 audioSamplesPerFrame = 0*2;
3138 return audioSamplesPerFrame;
3149 LWord64 numAudioSamplesFromWholeGroups;
3151 ULWord numWholeGroupsOfFive;
3152 ULWord numAudioSamplesFromRemainder;
3155 numWholeGroupsOfFive = inFrameNumNonInclusive / 5;
3156 remainder = inFrameNumNonInclusive % 5;
3158 numTotalAudioSamples = 0;
3159 numAudioSamplesFromWholeGroups = 0;
3160 numAudioSamplesFromRemainder = 0;
3164 switch (inFrameRate)
3167 numTotalAudioSamples = 400 * inFrameNumNonInclusive;
3170 numAudioSamplesFromWholeGroups = ((2*401) + (3*400)) * numWholeGroupsOfFive;
3171 numAudioSamplesFromRemainder = (remainder == 0) ? 0 : ((400 * remainder) + remainder/2);
3172 numTotalAudioSamples = numAudioSamplesFromWholeGroups + numAudioSamplesFromRemainder;
3175 numTotalAudioSamples = 800 * inFrameNumNonInclusive;
3179 numAudioSamplesFromWholeGroups = ((1*800) + (4*801)) * numWholeGroupsOfFive;
3180 numAudioSamplesFromRemainder = (remainder == 0) ? 0 : ((801 * remainder) - 1);
3181 numTotalAudioSamples = numAudioSamplesFromWholeGroups + numAudioSamplesFromRemainder;
3184 numTotalAudioSamples = 1920/2 * inFrameNumNonInclusive;
3187 numTotalAudioSamples = 1000 * inFrameNumNonInclusive;
3190 numTotalAudioSamples = 1001 * inFrameNumNonInclusive;
3193 numTotalAudioSamples = 1600 * inFrameNumNonInclusive;
3197 numAudioSamplesFromWholeGroups = ((3*1602) + (2*1601)) * numWholeGroupsOfFive;
3198 numAudioSamplesFromRemainder = (remainder == 0) ? 0 : ((1602 * remainder) - remainder/2);
3199 numTotalAudioSamples = numAudioSamplesFromWholeGroups + numAudioSamplesFromRemainder;
3202 numTotalAudioSamples = 1920 * inFrameNumNonInclusive;
3205 numTotalAudioSamples = 2000 * inFrameNumNonInclusive;
3208 numTotalAudioSamples = 2002 * inFrameNumNonInclusive;
3211 numTotalAudioSamples = 3200 * inFrameNumNonInclusive;
3215 numAudioSamplesFromWholeGroups = ((1*3204) + (4*3203)) * numWholeGroupsOfFive;
3216 numAudioSamplesFromRemainder = (remainder == 0) ? 0 : ((3203 * remainder) + 1);
3217 numTotalAudioSamples = numAudioSamplesFromWholeGroups + numAudioSamplesFromRemainder;
3219 #if !defined(NTV2_DEPRECATE_16_0) 3225 case NTV2_FRAMERATE_UNKNOWN: 3227 numTotalAudioSamples = 0;
3233 switch (inFrameRate)
3236 numTotalAudioSamples = 800 * inFrameNumNonInclusive;
3239 numAudioSamplesFromWholeGroups = ((4*801) + (1*800)) * numWholeGroupsOfFive;
3240 numAudioSamplesFromRemainder = (remainder == 0) ? 0 : (801 * remainder);
3241 numTotalAudioSamples = numAudioSamplesFromWholeGroups + numAudioSamplesFromRemainder;
3244 numTotalAudioSamples = (800*2) * inFrameNumNonInclusive;
3247 numAudioSamplesFromWholeGroups = ((3*1602) + (2*1601)) * numWholeGroupsOfFive;
3248 numAudioSamplesFromRemainder = (remainder == 0) ? 0 : ((1602 * remainder) - remainder/2);
3249 numTotalAudioSamples = numAudioSamplesFromWholeGroups + numAudioSamplesFromRemainder;
3252 numTotalAudioSamples = 1920 * inFrameNumNonInclusive;
3255 numTotalAudioSamples = 2000 * inFrameNumNonInclusive;
3258 numTotalAudioSamples = 2002 * inFrameNumNonInclusive;
3261 numTotalAudioSamples = (1600*2) * inFrameNumNonInclusive;
3265 numAudioSamplesFromWholeGroups = ((1*3204) + (4*3203)) * numWholeGroupsOfFive;
3266 numAudioSamplesFromRemainder = (remainder == 0) ? 0 : ((3203 * remainder) + 1);
3267 numTotalAudioSamples = numAudioSamplesFromWholeGroups + numAudioSamplesFromRemainder;
3270 numTotalAudioSamples = (1920*2) * inFrameNumNonInclusive;
3273 numTotalAudioSamples = (2000*2) * inFrameNumNonInclusive;
3276 numTotalAudioSamples = (2002*2) * inFrameNumNonInclusive;
3279 numTotalAudioSamples = (3200*2) * inFrameNumNonInclusive;
3283 numAudioSamplesFromWholeGroups = ((1*3204*2) + (4*3203*2)) * numWholeGroupsOfFive;
3284 numAudioSamplesFromRemainder = (remainder == 0) ? 0 : (((3203*2) * remainder) + 2);
3285 numTotalAudioSamples = numAudioSamplesFromWholeGroups + numAudioSamplesFromRemainder;
3287 #if !defined(NTV2_DEPRECATE_16_0) 3293 case NTV2_FRAMERATE_UNKNOWN: 3295 numTotalAudioSamples = 0*2;
3300 return numTotalAudioSamples;
3305 static const ULWord sSamplesPerSecond [] = {48000, 96000, 192000, 0};
3308 return double(sSamplesPerSecond[inAudioRate]);
3322 switch (inSequenceRate)
3329 switch (inCadenceFrame % 2)
3341 switch (inCadenceFrame % 5)
3359 switch (inCadenceFrame % 4)
3373 switch (inCadenceFrame % 5)
3395 switch (inSequenceRate)
3402 switch (inCadenceFrame % 2)
3417 switch (inCadenceFrame % 4)
3438 switch (inSequenceRate)
3456 switch (inFrameRate)
3472 #if !defined(NTV2_DEPRECATE_16_0) 3478 case NTV2_FRAMERATE_UNKNOWN: break; 3497 if (duration == 100)
3517 else if (duration == 0)
3519 result = playFrameRate;
3523 float scaleFloat = scale / duration * float(100.0);
3524 long scaleInt = long(scaleFloat);
3533 switch (playFrameRate)
3543 if (scaleInt <= 1500 + 100)
3545 else if (scaleInt <= 2400 + 50)
3547 else if (scaleInt <= 2500 + 100)
3549 else if (scaleInt <= 3000 + 100)
3551 else if (scaleInt <= 4800 + 100)
3553 else if (scaleInt <= 5000 + 100)
3555 else if (scaleInt <= 6000 + 100)
3567 if (scaleInt <= 1498 + 100)
3569 else if (scaleInt <= 2398 + 100)
3571 else if (scaleInt <= 2997 + 100)
3573 else if (scaleInt <= 4795 + 100)
3575 else if (scaleInt <= 5994 + 100)
3590 if (inDenominator == 100)
3591 switch (inNumerator)
3611 const ULWord denominator(inDenominator == 1 ? inDenominator * 1000ULL : inDenominator);
3612 const ULWord numerator(inDenominator == 1 ? inNumerator * 1000ULL : inNumerator);
3633 switch (videoFormat)
3832 #if defined (_DEBUG) 3858 switch (inFrameGeometry)
3870 return inFrameGeometry;
3894 #if defined (_DEBUG) 3913 switch (inFrameGeometry)
3947 return inFrameGeometry;
3948 #if defined (_DEBUG) 3993 #if defined (_DEBUG) 4045 result.insert(inFG);
4047 #if defined (_DEBUG) 4095 #if defined (_DEBUG) 4148 #if defined (_DEBUG) 4179 if (fr == inFrameRate &&
std == inStandard && fg == geo)
4225 return firstFieldTop ? smpteFirstActiveLine : smpteSecondActiveLine;
4227 return firstFieldTop ? smpteSecondActiveLine : smpteFirstActiveLine;
4234 inOutStream <<
"INVALID ";
4235 inOutStream <<
"SMPTELineNumber(";
4237 inOutStream <<
"1st=" << smpteFirstActiveLine << (firstFieldTop ?
"(top)" :
"")
4238 <<
", 2nd=" << smpteSecondActiveLine << (firstFieldTop ?
"" :
"(top)")
4241 inOutStream <<
"INVALID)";
4250 oss <<
"F" << (inRasterFieldID == 0 ?
"1" :
"2") <<
" ";
4251 oss <<
"L" << dec << inLineOffset+GetFirstActiveLine(inRasterFieldID);
4260 return "Frame count/range not specified";
4261 const bool hasCount(inStr.find(
'@') != string::npos);
4262 const bool hasRange(inStr.find(
'-') != string::npos);
4264 if (hasCount && hasRange)
4265 return "'@' and '-' cannot both be specified";
4271 strs.push_back(inStr);
4273 return "No frame count/range values parsed";
4274 if (strs.size() > 2)
4275 return "More than 2 frame count/range values parsed";
4276 if (hasCount || hasRange)
4277 if (strs.size() != 2)
4278 return "Expected exactly 2 frame count/range values";
4281 for (
size_t strNdx(0); strNdx < strs.size(); strNdx++)
4282 {
string str(strs.at(strNdx));
4284 return "Expected unsigned decimal integer value";
4285 for (
size_t chNdx(0); chNdx < str.length(); chNdx++)
4286 if (!isdigit(str.at(chNdx)))
4287 return "Non-digit character encountered in '" + str +
"'";
4296 bool isValid(
false);
4298 isValid = setRangeWithCount(numbers[0], numbers[1]);
4300 isValid = setExactRange(numbers[0], numbers[1]);
4302 isValid = setCountOnly(numbers[0]);
4303 return isValid ?
"" :
"First frame past last frame";
4313 else if (isFrameRange())
4316 oss <<
DEC(count()) <<
"@" <<
DEC(firstFrame());
4318 oss <<
DEC(firstFrame()) <<
"-" <<
DEC(lastFrame());
4321 oss <<
DEC(count());
4327 else if (isFrameRange())
4328 oss <<
"Frames " <<
DEC(firstFrame()) <<
"-" <<
DEC(lastFrame()) <<
" (" <<
DEC(lastFrame()-firstFrame()+1) <<
"@" <<
DEC(firstFrame()) <<
")";
4330 oss <<
DEC(count()) <<
" frames (auto-allocated)";
4339 int iNumChans,
bool bKeepAudio24Bits)
4355 UWord * puwOut =
reinterpret_cast<UWord*
>(pSR);
4359 int iNumSamples = iNumBytes / SAMPLE_SIZE;
4360 int iMod = (iNumBytes % SAMPLE_SIZE) / 4;
4378 if (bKeepAudio24Bits)
4380 for (
int s = 0; s < iNumSamples; s++)
4382 for (
int c = iChan0; c < iChan0 + iNumChans; c++)
4392 for (
int s = 0; s < iNumSamples; s++)
4394 for (
int c = iChan0; c < iChan0 + iNumChans; c++)
4396 *puwOut++ =
UWord(pIn[c] >> 16);
4409 #define M_PI (3.14159265358979323846) 4415 ULWord & inOutCurrentSample,
4416 const ULWord inNumSamples,
4417 const double inSampleRate,
4418 const double inAmplitude,
4419 const double inFrequency,
4420 const ULWord inNumBitsPerSample,
4421 const bool inByteSwap,
4422 const ULWord inNumChannels)
4424 outNumBytesWritten = 0;
4425 if (inAudioBuffer.
IsNULL())
4428 const ULWord numBytes (4 * inNumSamples * inNumChannels);
4432 double j (inOutCurrentSample);
4433 const double cycleLength (inSampleRate / inFrequency);
4434 const double scale (
double(
ULWord(1 << (inNumBitsPerSample - 1))) - 1.0);
4435 ULWord * pAudioBuffer(inAudioBuffer);
4438 for (
ULWord i(0); i < inNumSamples; i++)
4440 const double nextFloat = double(::sin (j / cycleLength * (
M_PI * 2.0)) * inAmplitude);
4441 LWord value =
LWord((nextFloat * scale) +
double(0.5));
4446 for (
ULWord channel(0); channel < inNumChannels; channel++)
4447 *pAudioBuffer++ =
ULWord(value);
4450 if (j > cycleLength)
4452 inOutCurrentSample++;
4455 outNumBytesWritten = numBytes;
4462 ULWord & inOutCurrentSample,
4463 const ULWord inNumSamples,
4464 const double inSampleRate,
4465 const double inAmplitude,
4466 const double inFrequency,
4468 const bool inByteSwap,
4469 const ULWord inNumChannels)
4471 double j (inOutCurrentSample);
4472 const double cycleLength (inSampleRate / inFrequency);
4473 const double scale (
double (
ULWord (1 << (inNumBits - 1))) - 1.0);
4477 for (
ULWord i = 0; i < inNumSamples; i++)
4479 const double nextFloat = double(::sin (j / cycleLength * (
M_PI * 2.0)) * inAmplitude);
4480 LWord value =
LWord((nextFloat * scale) +
double(0.5));
4485 for (
ULWord channel = 0; channel < inNumChannels; channel++)
4486 *pAudioBuffer++ =
ULWord(value);
4489 if (j > cycleLength)
4491 inOutCurrentSample++;
4495 return inNumSamples * 4 * inNumChannels;
4501 ULWord & inOutCurrentSample,
4502 const ULWord inNumSamples,
4503 const double inSampleRate,
4504 const double inAmplitude,
4505 const double inFrequency,
4507 const bool inByteSwap,
4508 const ULWord inNumChannels)
4510 double j (inOutCurrentSample);
4511 const double cycleLength (inSampleRate / inFrequency);
4512 const double scale (
double (
ULWord (1 << (inNumBits - 1))) - 1.0);
4516 for (
ULWord i(0); i < inNumSamples; i++)
4518 const double nextFloat = double(::sin (j / cycleLength * (
M_PI * 2.0)) * inAmplitude);
4519 Word value =
Word((nextFloat * scale) +
double(0.5));
4524 for (
ULWord channel(0); channel < inNumChannels; channel++)
4525 *pAudioBuffer++ =
UWord(value);
4528 if (j > cycleLength)
4530 inOutCurrentSample++;
4534 return inNumSamples * 4 * inNumChannels;
4540 ULWord & inOutCurrentSample,
4541 const ULWord inNumSamples,
4542 const double inSampleRate,
4543 const double * pInAmplitudes,
4544 const double * pInFrequencies,
4546 const bool inByteSwap,
4547 const ULWord inNumChannels)
4551 const double scale (
double(
ULWord (1 << (inNumBits - 1))) - 1.0);
4553 for (
ULWord channel(0); channel < inNumChannels; channel++)
4555 cycleLength[channel] = inSampleRate / pInFrequencies[channel];
4556 j [channel] = inOutCurrentSample;
4559 if (pAudioBuffer && pInAmplitudes && pInFrequencies)
4561 for (
ULWord i(0); i < inNumSamples; i++)
4563 for (
ULWord channel(0); channel < inNumChannels; channel++)
4565 const double nextFloat = double(::sin(j[channel] / cycleLength[channel] * (
M_PI * 2.0)) * pInAmplitudes[channel]);
4566 LWord value =
LWord((nextFloat * scale) +
double(0.5));
4571 *pAudioBuffer++ =
ULWord(value);
4574 if (j[channel] > cycleLength[channel])
4575 j[channel] -= cycleLength[channel];
4578 inOutCurrentSample++;
4582 return inNumSamples * 4 * inNumChannels;
4588 ULWord & inOutCurrentSample,
4589 const ULWord inNumSamples,
4591 const bool inEndianConvert,
4592 const ULWord inNumChannels)
4595 for (
ULWord i(0); i < inNumSamples; i++)
4597 ULWord value ((inOutCurrentSample % inModulus) << 16);
4598 if (inEndianConvert)
4600 for (
ULWord channel(0); channel < inNumChannels; channel++)
4601 *pAudioBuffer++ = value;
4602 inOutCurrentSample++;
4604 return inNumSamples * 4 * inNumChannels;
4684 case DEVICE_ID_TTAP:
return inForRetailDisplay ?
"T-TAP" :
"TTap";
4693 return inForRetailDisplay ?
"Unknown" :
"???";
4710 switch (inCrosspointChannel)
4894 return gInputSourceToEmbeddedAudioInputs [inInputSource];
4920 return gChannelToInputChannelSpec [inChannel];
4931 return gChannelToOutputChannelSpec [inChannel];
5016 return gInputSourceToChannelSpec [inInputSource];
5040 return gInputSourceToReferenceSource [inInputSource];
5064 return gInputSourceToChannel [inInputSource];
5088 return gInputSourceToAudioSystem [inInputSource];
5126 return inEmbeddedLTC ? gInputSourceToLTCIndex [inInputSource] : gInputSourceToTCIndex [inInputSource];
5144 switch (inSourceType)
5163 return gOutputDestToChannel [inOutputDest];
5189 return gChannelToOutputDest [inChannel];
5198 return inTargetFormat;
5208 if (inFormat1 == inFormat2)
5219 default:
return false;
5234 return sSDIInputSources[inIndex0];
5238 return sHDMIInputSources[inIndex0];
5242 return sANLGInputSources[inIndex0];
5276 static const ULWord sInputSourcesIndexes [] = { 0,
5278 0, 1, 2, 3, 4, 5, 6, 7 };
5279 if (
size_t(inValue) <
sizeof(sInputSourcesIndexes) /
sizeof(
ULWord))
5280 return sInputSourcesIndexes [inValue];
5289 static const ULWord gFrameSizeToByteCount[] = { 2 , 4 , 8 , 16 ,
5295 return gFrameSizeToByteCount [inFrameSize] * 1024 * 1024;
5304 static const ULWord gBufferSizeToByteCount[] = { 1 * 1024*1024, 4 * 1024*1024, 2 * 1024*1024, 3 * 1024*1024, 0 };
5306 return gBufferSizeToByteCount[inBufferSize];
5350 if (iter != family.end())
5351 return *(family.begin());
5359 if (inFrameRate1 == inFrameRate2)
5371 return frFamily1 == frFamily2;
5627 switch( conversionMode )
5671 switch( conversionMode )
5711 return outputFormat;
5717 return inOutStream << inFrameDimensions.
width() <<
"Wx" << inFrameDimensions.
height() <<
"H";
5723 return inSmpteLineNumber.
Print (inOutStream);
5749 oss << (inCompactDisplay ?
"AudSys" :
"NTV2_AUDIOSYSTEM_") << (inValue + 1);
5751 oss << (inCompactDisplay ?
"NoAudio" :
"NTV2_AUDIOSYSTEM_INVALID");
5807 std::ostringstream oss;
6150 #if !defined(NTV2_DEPRECATE_16_0) 6154 #if !defined(_DEBUG) 6376 inOutStr <<
"[" << inObj.size () <<
" regs: ";
6380 if (++iter != inObj.end ())
6383 return inOutStr <<
"]";
6389 inOutSet.insert (inRegisterNumber);
6435 oss << (inCompactDisplay ?
"" :
"NTV2_AudioChannel")
6436 <<
DEC(inValue * 2 + 1) << (inCompactDisplay ?
"-" :
"_") <<
DEC(inValue * 2 + 2);
6437 else if (!inCompactDisplay)
6438 oss <<
"NTV2_AUDIO_CHANNEL_PAIR_INVALID";
6447 oss << (inCompactDisplay ?
"" :
"NTV2_AudioChannel")
6448 << (inValue * 4 + 1) << (inCompactDisplay ?
"-" :
"_") << (inValue * 4 + 4);
6449 else if (!inCompactDisplay)
6450 oss <<
"NTV2_AUDIO_CHANNEL_QUAD_INVALID";
6459 oss << (inCompactDisplay ?
"" :
"NTV2_AudioChannel")
6460 << (inValue * 8 + 1) << (inCompactDisplay ?
"-" :
"_") << (inValue * 8 + 8);
6461 else if (!inCompactDisplay)
6462 oss <<
"NTV2_AUDIO_CHANNEL_OCTET_INVALID";
6905 default:
return "Unknown";
6977 #if !defined(NTV2_DEPRECATE_17_6) 6981 "FILE 720x480 420 Planar 8 Bit 59.94i",
6982 "FILE 720x480 420 Planar 8 Bit 59.94p",
6983 "FILE 720x480 420 Planar 8 Bit 60i",
6984 "FILE 720x480 420 Planar 8 Bit 60p",
6985 "FILE 720x480 422 Planar 10 Bit 59.94i",
6986 "FILE 720x480 422 Planar 10 Bit 59.94p",
6987 "FILE 720x480 422 Planar 10 Bit 60i",
6988 "FILE 720x480 422 Planar 10 Bit 60p",
6990 "FILE 720x576 420 Planar 8 Bit 50i",
6991 "FILE 720x576 420 Planar 8 Bit 50p",
6992 "FILE 720x576 422 Planar 10 Bit 50i",
6993 "FILE 720x576 422 Planar 10 Bit 50p",
6995 "FILE 1280x720 420 Planar 8 Bit 2398p",
6996 "FILE 1280x720 420 Planar 8 Bit 24p",
6997 "FILE 1280x720 420 Planar 8 Bit 25p",
6998 "FILE 1280x720 420 Planar 8 Bit 29.97p",
6999 "FILE 1280x720 420 Planar 8 Bit 30p",
7000 "FILE 1280x720 420 Planar 8 Bit 50p",
7001 "FILE 1280x720 420 Planar 8 Bit 59.94p",
7002 "FILE 1280x720 420 Planar 8 Bit 60p",
7004 "FILE 1280x720 422 Planar 10 Bit 2398p",
7005 "FILE 1280x720 422 Planar 10 Bit 25p",
7006 "FILE 1280x720 422 Planar 10 Bit 25p",
7007 "FILE 1280x720 422 Planar 10 Bit 29.97p",
7008 "FILE 1280x720 422 Planar 10 Bit 30p",
7009 "FILE 1280x720 422 Planar 10 Bit 50p",
7010 "FILE 1280x720 422 Planar 10 Bit 59.94p",
7011 "FILE 1280x720 422 Planar 10 Bit 60p",
7013 "FILE 1920x1080 420 Planar 8 Bit 2398p",
7014 "FILE 1920x1080 420 Planar 8 Bit 24p",
7015 "FILE 1920x1080 420 Planar 8 Bit 25p",
7016 "FILE 1920x1080 420 Planar 8 Bit 29.97p",
7017 "FILE 1920x1080 420 Planar 8 Bit 30p",
7018 "FILE 1920x1080 420 Planar 8 Bit 50i",
7019 "FILE 1920x1080 420 Planar 8 Bit 50p",
7020 "FILE 1920x1080 420 Planar 8 Bit 59.94i",
7021 "FILE 1920x1080 420 Planar 8 Bit 59.94p",
7022 "FILE 1920x1080 420 Planar 8 Bit 60i",
7023 "FILE 1920x1080 420 Planar 8 Bit 60p",
7025 "FILE 1920x1080 422 Planar 10 Bit 2398p",
7026 "FILE 1920x1080 422 Planar 10 Bit 24p",
7027 "FILE 1920x1080 422 Planar 10 Bit 25p",
7028 "FILE 1920x1080 422 Planar 10 Bit 29.97p",
7029 "FILE 1920x1080 422 Planar 10 Bit 30p",
7030 "FILE 1920x1080 422 Planar 10 Bit 50i",
7031 "FILE 1920x1080 422 Planar 10 Bit 50p",
7032 "FILE 1920x1080 422 Planar 10 Bit 59.94i",
7033 "FILE 1920x1080 422 Planar 10 Bit 59.94p",
7034 "FILE 1920x1080 422 Planar 10 Bit 60i",
7035 "FILE 1920x1080 422 Planar 10 Bit 60p",
7037 "FILE 2048x1080 420 Planar 8 Bit 2398p",
7038 "FILE 2048x1080 420 Planar 8 Bit 24p",
7039 "FILE 2048x1080 420 Planar 8 Bit 25p",
7040 "FILE 2048x1080 420 Planar 8 Bit 29.97p",
7041 "FILE 2048x1080 420 Planar 8 Bit 30p",
7042 "FILE 2048x1080 420 Planar 8 Bit 50p",
7043 "FILE 2048x1080 420 Planar 8 Bit 59.94p",
7044 "FILE 2048x1080 420 Planar 8 Bit 60p",
7046 "FILE 2048x1080 422 Planar 10 Bit 2398p",
7047 "FILE 2048x1080 422 Planar 10 Bit 24p",
7048 "FILE 2048x1080 422 Planar 10 Bit 25p",
7049 "FILE 2048x1080 422 Planar 10 Bit 29.97p",
7050 "FILE 2048x1080 422 Planar 10 Bit 30p",
7051 "FILE 2048x1080 422 Planar 10 Bit 50p",
7052 "FILE 2048x1080 422 Planar 10 Bit 59.94p",
7053 "FILE 2048x1080 422 Planar 10 Bit 60p",
7055 "FILE 3840x2160 420 Planar 8 Bit 2398p",
7056 "FILE 3840x2160 420 Planar 8 Bit 24p",
7057 "FILE 3840x2160 420 Planar 8 Bit 25p",
7058 "FILE 3840x2160 420 Planar 8 Bit 29.97p",
7059 "FILE 3840x2160 420 Planar 8 Bit 30p",
7060 "FILE 3840x2160 420 Planar 8 Bit 50p",
7061 "FILE 3840x2160 420 Planar 8 Bit 59.94p",
7062 "FILE 3840x2160 420 Planar 8 Bit 60p",
7064 "FILE 3840x2160 420 Planar 10 Bit 50p",
7065 "FILE 3840x2160 420 Planar 10 Bit 59.94p",
7066 "FILE 3840x2160 420 Planar 10 Bit 60p",
7068 "FILE 3840x2160 422 Planar 8 Bit 2398p",
7069 "FILE 3840x2160 422 Planar 8 Bit 24p",
7070 "FILE 3840x2160 422 Planar 8 Bit 25p",
7071 "FILE 3840x2160 422 Planar 8 Bit 29.97p",
7072 "FILE 3840x2160 422 Planar 8 Bit 30p",
7073 "FILE 3840x2160 422 Planar 8 Bit 50p",
7074 "FILE 3840x2160 422 Planar 8 Bit 59.94p",
7075 "FILE 3840x2160 422 Planar 8 Bit 60p",
7077 "FILE 3840x2160 422 Planar 10 Bit 2398p",
7078 "FILE 3840x2160 422 Planar 10 Bit 24p",
7079 "FILE 3840x2160 422 Planar 10 Bit 25p",
7080 "FILE 3840x2160 422 Planar 10 Bit 29.97p",
7081 "FILE 3840x2160 422 Planar 10 Bit 30p",
7082 "FILE 3840x2160 422 Planar 10 Bit 50p",
7083 "FILE 3840x2160 422 Planar 10 Bit 59.94p",
7084 "FILE 3840x2160 422 Planar 10 Bit 60p",
7086 "FILE 4096x2160 420 Planar 10 Bit 5994p",
7087 "FILE 4096x2160 420 Planar 10 Bit 60p",
7088 "FILE 4096x2160 422 Planar 10 Bit 50p",
7089 "FILE 4096x2160 422 Planar 10 Bit 5994p IOnly",
7090 "FILE 4096x2160 422 Planar 10 Bit 60p IOnly",
7092 "VIF 720x480 420 Planar 8 Bit 59.94i",
7093 "VIF 720x480 420 Planar 8 Bit 59.94p",
7094 "VIF 720x480 420 Planar 8 Bit 60i",
7095 "VIF 720x480 420 Planar 8 Bit 60p",
7096 "VIF 720x480 422 Planar 10 Bit 59.94i",
7097 "VIF 720x480 422 Planar 10 Bit 59.94p",
7098 "VIF 720x480 422 Planar 10 Bit 60i",
7099 "VIF 720x480 422 Planar 10 Bit 60p",
7101 "VIF 720x576 420 Planar 8 Bit 50i",
7102 "VIF 720x576 420 Planar 8 Bit 50p",
7103 "VIF 720x576 422 Planar 10 Bit 50i",
7104 "VIF 720x576 422 Planar 10 Bit 50p",
7106 "VIF 1280x720 420 Planar 8 Bit 50p",
7107 "VIF 1280x720 420 Planar 8 Bit 59.94p",
7108 "VIF 1280x720 420 Planar 8 Bit 60p",
7109 "VIF 1280x720 422 Planar 10 Bit 50p",
7110 "VIF 1280x720 422 Planar 10 Bit 59.94p",
7111 "VIF 1280x720 422 Planar 10 Bit 60p",
7113 "VIF 1920x1080 420 Planar 8 Bit 50i",
7114 "VIF 1920x1080 420 Planar 8 Bit 50p",
7115 "VIF 1920x1080 420 Planar 8 Bit 59.94i",
7116 "VIF 1920x1080 420 Planar 8 Bit 59.94p",
7117 "VIF 1920x1080 420 Planar 8 Bit 60i",
7118 "VIF 1920x1080 420 Planar 8 Bit 60p",
7119 "VIF 1920x1080 420 Planar 10 Bit 50i",
7120 "VIF 1920x1080 420 Planar 10 Bit 50p",
7121 "VIF 1920x1080 420 Planar 10 Bit 59.94i",
7122 "VIF 1920x1080 420 Planar 10 Bit 59.94p",
7123 "VIF 1920x1080 420 Planar 10 Bit 60i",
7124 "VIF 1920x1080 420 Planar 10 Bit 60p",
7125 "VIF 1920x1080 422 Planar 10 Bit 59.94i",
7126 "VIF 1920x1080 422 Planar 10 Bit 59.94p",
7127 "VIF 1920x1080 422 Planar 10 Bit 60i",
7128 "VIF 1920x1080 422 Planar 10 Bit 60p",
7130 "VIF 3840x2160 420 Planar 8 Bit 30p",
7131 "VIF 3840x2160 420 Planar 8 Bit 50p",
7132 "VIF 3840x2160 420 Planar 8 Bit 59.94p",
7133 "VIF 3840x2160 420 Planar 8 Bit 60p",
7134 "VIF 3840x2160 420 Planar 10 Bit 50p",
7135 "VIF 3840x2160 420 Planar 10 Bit 59.94p",
7136 "VIF 3840x2160 420 Planar 10 Bit 60p",
7138 "VIF 3840x2160 422 Planar 10 Bit 30p",
7139 "VIF 3840x2160 422 Planar 10 Bit 50p",
7140 "VIF 3840x2160 422 Planar 10 Bit 59.94p",
7141 "VIF 3840x2160 422 Planar 10 Bit 60p",
7146 if (inForRetailDisplay)
7365 #if !defined(NTV2_DEPRECATE_16_0) 7371 case NTV2_NUM_FRAMERATES: return ""; //special case 7464 switch(inInterruptEnumValue)
7514 switch (inIpErrorEnumValue)
7554 default:
return "Unknown IP error";
7560 return inOutStream <<
"DBB=0x" << hex << setw (8) << setfill (
'0') << inObj.
DBB 7561 <<
"|HI=0x" << hex << setw (8) << setfill (
'0') << inObj.
High 7562 <<
"|LO=0x" << hex << setw (8) << setfill (
'0') << inObj.
Low 7650 if (inBitfileName == deviceBitfileName)
7673 typedef map<string, NTV2DeviceID> BitfileName2DevID;
7674 typedef BitfileName2DevID::const_iterator BitfileName2DevCI;
7675 static BitfileName2DevID sBitfileName2DevID;
7676 static AJALock sBFN2DevIDMutex;
7678 if (sBitfileName2DevID.empty())
7684 if (!bitFileName.empty())
7685 sBitfileName2DevID[bitFileName] = *it;
7688 BitfileName2DevCI it(sBitfileName2DevID.find(inBitfileName));
7698 const char c (fwPath.empty() ? 0 : fwPath.at(fwPath.length()-1));
7699 if (!inAddTrailingPathDelim)
7700 if (c ==
'/' || c ==
'\\')
7701 fwPath.erase(fwPath.length()-1, 1);
7710 const char c (fwPath.empty() ? 0 : fwPath.at(fwPath.length()-1));
7711 if (!inAddTrailingPathDelim)
7712 if (c ==
'/' || c ==
'\\')
7713 fwPath.erase(fwPath.length()-1, 1);
7722 const char c (fwPath.empty() ? 0 : fwPath.at(fwPath.length()-1));
7723 if (!inAddTrailingPathDelim)
7724 if (c ==
'/' || c ==
'\\')
7725 fwPath.erase(fwPath.length()-1, 1);
7815 for (
unsigned ndx(0); ndx <
sizeof(sValidDeviceIDs) /
sizeof(
NTV2DeviceID); ndx++)
7820 bool insertIt (
false);
7848 result.insert (deviceID);
7882 switch (inVersionComponent)
8005 return "(bad bitfile type)";
8010 static const NTV2StringList sScalesUTF8 = {
"\xE2\x84\x83",
"\xE2\x84\x89",
"\xC2\xB0""K",
"\xC2\xB0""R"};
8012 if (
size_t(inValue) < sScales.size())
8013 return inUseUTF8 ? sScalesUTF8.at(inValue) : sScales.at(inValue);
8017 #if !defined(NTV2_DEPRECATE_17_6) 8020 return inFloatValues.
toRegValues(outRegisterValues);
8037 #endif // !defined(NTV2_DEPRECATE_17_6) 8047 if (it != inList.end())
8075 if (++it != inData.end())
8076 inOutStream <<
", ";
8086 if (++it != inData.end())
8087 inOutStream <<
", ";
8105 result.insert (it->registerNumber);
8111 outGone.clear(); outSame.clear(); outNew.clear();
8112 set_difference (inBefore.begin(), inBefore.end(), inAfter.begin(), inAfter.end(), std::inserter(outGone, outGone.begin()));
8113 set_difference (inAfter.begin(), inAfter.end(), inBefore.begin(), inBefore.end(), std::inserter(outNew, outNew.begin()));
8114 set_intersection (inBefore.begin(), inBefore.end(), inAfter.begin(), inAfter.end(), std::inserter(outSame, outSame.begin()));
8121 if (&inBefore == &inAfter)
8123 if (inBefore.size() != inAfter.size())
8126 set_intersection (before.begin(), before.end(), after.begin(), after.end(),
8127 std::inserter(commonRegNums, commonRegNums.begin()));
8132 if (beforeIt != inBefore.end() && afterIt != inAfter.end() && beforeIt->registerValue != afterIt->registerValue)
8133 outChanged.insert(*it);
8136 else if (inBefore.at(0).registerNumber == inAfter.at(0).registerNumber
8137 && inBefore.at(inBefore.size()-1).registerNumber == inAfter.at(inAfter.size()-1).registerNumber)
8139 for (
size_t ndx(0); ndx < inBefore.size(); ndx++)
8140 if (inBefore[ndx].registerValue != inAfter[ndx].registerValue)
8141 outChanged.insert(inBefore[ndx].registerNumber);
8143 else for (
size_t ndx(0); ndx < inBefore.size(); ndx++)
8147 if (beforeInfo.registerNumber == afterInfo.registerNumber)
8149 if (beforeInfo.registerValue != afterInfo.registerValue)
8150 outChanged.insert(beforeInfo.registerNumber);
8155 if (it != inAfter.end())
8156 if (beforeInfo.registerValue != it->registerValue)
8157 outChanged.insert(beforeInfo.registerNumber);
8160 return !outChanged.empty();
8165 { ostringstream oss;
8166 for (
size_t ndx(0); ndx < inStr.size(); ndx++)
8168 const char chr(inStr.at(
size_t(ndx)));
8169 if (::isalnum(chr) || chr ==
'-' || chr ==
'_' || chr ==
'.' || chr ==
'~')
8172 oss <<
"%" <<
HEX0N(
unsigned(chr),2);
8178 { ostringstream oss;
8179 unsigned hexNum(0), state(0);
8180 for (
size_t ndx(0); ndx < inStr.size(); ndx++)
8182 const char chr(inStr.at(
size_t(ndx)));
8186 if (::isalnum(chr) || chr ==
'-' || chr ==
'_' || chr ==
'.' || chr ==
'~')
8192 if (chr >=
'A' && chr <=
'F')
8193 hexNum = unsigned(chr + 10 -
'A') << 4;
8194 else if (chr >=
'a' && chr <=
'f')
8195 hexNum = unsigned(chr + 10 -
'a') << 4;
8196 else if (chr >=
'0' && chr <=
'9')
8197 hexNum = unsigned(chr -
'0') << 4;
8203 if (chr >=
'A' && chr <=
'F')
8204 hexNum += unsigned(chr + 10 -
'A');
8205 else if (chr >=
'a' && chr <=
'f')
8206 hexNum += unsigned(chr + 10 -
'a');
8207 else if (chr >=
'0' && chr <=
'9')
8208 hexNum += unsigned(chr -
'0');
8209 oss << char(hexNum);
8222 if (inSerNumStr.length() < 8 || inSerNumStr.length() > 9)
8224 string serNumStr(inSerNumStr);
8225 if (inSerNumStr.length() == 9)
8226 serNumStr.erase(0,1);
8228 for (
size_t ndx(0); ndx < serNumStr.length(); ndx++)
8230 const char ch (serNumStr.at(ndx));
8232 if ( ! ( ( (ch >=
'0') && (ch <=
'9') ) ||
8233 ( (ch >=
'A') && (ch <=
'Z') ) ||
8234 ( (ch >=
'a') && (ch <=
'z') ) ||
8235 (ch ==
' ') || (ch ==
'-') ) )
8237 serNum |= uint64_t(ch) << (ndx*8);
8245 const ULWord serialNumHigh (inSerNum >> 32);
8246 const ULWord serialNumLow (inSerNum & 0x00000000FFFFFFFF);
8249 serialNum[0] = char((serialNumLow & 0x000000FF) );
8250 serialNum[1] = char((serialNumLow & 0x0000FF00) >> 8);
8251 serialNum[2] = char((serialNumLow & 0x00FF0000) >> 16);
8252 serialNum[3] = char((serialNumLow & 0xFF000000) >> 24);
8253 serialNum[4] = char((serialNumHigh & 0x000000FF) );
8254 serialNum[5] = char((serialNumHigh & 0x0000FF00) >> 8);
8255 serialNum[6] = char((serialNumHigh & 0x00FF0000) >> 16);
8256 serialNum[7] = char((serialNumHigh & 0xFF000000) >> 24);
8257 serialNum[8] =
'\0';
8259 for (
unsigned ndx(0); ndx < 8; ndx++)
8261 if (serialNum[ndx] == 0)
8269 if ( ! ( ( (serialNum[ndx] >=
'0') && (serialNum[ndx] <=
'9') ) ||
8270 ( (serialNum[ndx] >=
'A') && (serialNum[ndx] <=
'Z') ) ||
8271 ( (serialNum[ndx] >=
'a') && (serialNum[ndx] <=
'z') ) ||
8272 (serialNum[ndx] ==
' ') || (serialNum[ndx] ==
'-') ) )
8278 #if defined (AJAMac) 8288 outMaj = outMin = outPt = outBld = outType = 0;
8295 const string key(
"<key>CFBundleShortVersionString</key>");
8296 for (
string line; std::getline(ifs, line); )
8298 size_t keyPos(line.find(key));
8299 if (keyPos == string::npos)
8301 if (!std::getline(ifs, line))
8304 size_t startPos(line.find(
"<string>")), endPos(line.find(
"</string>"));
8305 if (startPos == string::npos || endPos == string::npos)
8308 if (endPos < startPos)
8310 string versStr(line.substr(startPos, endPos-startPos));
8313 if (versComps.size() < 3 || versComps.size() > 4)
8315 const string sBuildTypes(
"_bad");
8316 for (
size_t bt(1); bt < 4; bt++)
8317 if (versComps.at(2).find(sBuildTypes[bt]) != string::npos)
8319 aja::split(versComps.at(2), sBuildTypes[bt], lastComps);
8320 versComps.erase(versComps.begin()+2);
8321 versComps.push_back(lastComps.at(0));
8323 outType =
UWord(bt);
8326 for (
size_t ndx(0); ndx < versComps.size(); ndx++)
8328 if (versComps.at(ndx).empty())
8337 else if (ndx == 3 && outType == 0)
bool IsProgressivePicture(const NTV2VideoFormat format)
Fractional rate of 15,000 frames per 1,001 seconds.
string NTV2ScanMethodToString(const NTV2ScanMethod inValue, const bool inCompact)
Declares common video macros and structs used in the SDK.
void ConvertARGBYCbCrToRGBA(UByte *rgbaBuffer, ULWord numPixels)
Passes only foreground video + key to the Mixer output.
ULWord GetVideoActiveSize(const NTV2VideoFormat inVideoFormat, const NTV2FrameBufferFormat inFBFormat, const NTV2VANCMode inVancMode)
Levels are 0 - 255 (Full)
Everything needed to call CNTV2Card::ReadRegister or CNTV2Card::WriteRegister functions.
void MaskYCbCrLine(UWord *ycbcrLine, UWord signalMask, ULWord numPixels)
void Make10BitLine(UWord *pOutLineData, const UWord Y, const UWord Cb, const UWord Cr, const ULWord inNumPixels)
static const char * m31Presets[M31_NUMVIDEOPRESETS]
bool AddAudioTone(ULWord &outNumBytesWritten, NTV2Buffer &inAudioBuffer, ULWord &inOutCurrentSample, const ULWord inNumSamples, const double inSampleRate, const double inAmplitude, const double inFrequency, const ULWord inNumBitsPerSample, const bool inByteSwap, const ULWord inNumChannels)
Fills the given buffer with 32-bit (ULWord) audio tone samples.
#define NTV2_NUMAUDIO_CHANNELS
Specifies devices with SFP connectors.
string NTV2GetVDevFolderPath(const bool inAddTrailingPathDelim)
#define NTV2UTILS_ENUM_CASE_RETURN_STR(enum_name)
string NTV2FramesizeToString(const NTV2Framesize inValue, const bool inCompactDisplay)
Identifies the 4th HDMI video input.
Identifies the 5th SDI video input.
Specifies devices with HDMI connectors.
NTV2AudioSystem
Used to identify an Audio System on an NTV2 device. See Audio System Operation for more information...
#define AJA_NTV2_SDK_BUILD_NUMBER
The SDK build number, an unsigned decimal integer.
double GetAudioSamplesPerSecond(const NTV2AudioRate inAudioRate)
Returns the audio sample rate as a number of audio samples per second.
ULWord GetNTV2FrameGeometryHeight(const NTV2FrameGeometry inGeometry)
bool NTV2IsCompatibleBitfileName(const string &inBitfileName, const NTV2DeviceID inDeviceID)
NTV2AudioSystem NTV2ChannelToAudioSystem(const NTV2Channel inChannel)
Converts the given NTV2Channel value into its equivalent NTV2AudioSystem.
Declares a number of pixel format transcoder functions.
NTV2Standard GetNTV2StandardFromVideoFormat(const NTV2VideoFormat inVideoFormat)
Declares the AJALock class.
Specifies SDI input/output kinds.
std::set< NTV2TCIndex > NTV2TCIndexes
NTV2FrameRate GetNTV2FrameRateFromNumeratorDenominator(const ULWord inNumerator, const ULWord inDenominator)
bool CopyRaster(const NTV2PixelFormat inPixelFormat, UByte *pDstBuffer, const ULWord inDstBytesPerLine, const UWord inDstTotalLines, const UWord inDstVertLineOffset, const UWord inDstHorzPixelOffset, const UByte *pSrcBuffer, const ULWord inSrcBytesPerLine, const UWord inSrcTotalLines, const UWord inSrcVertLineOffset, const UWord inSrcVertLinesToCopy, const UWord inSrcHorzPixelOffset, const UWord inSrcHorzPixelsToCopy)
Copies all or part of a source raster image into a destination raster at a given position.
Specifies the SDI In 6 connector.
string NTV2HDMIColorSpaceToString(const NTV2HDMIColorSpace inValue, const bool inCompact)
Identifies SMPTE HD 1080p.
NTV2FrameGeometry GetGeometryFromStandard(const NTV2Standard inStandard)
Specifies devices with analog video connectors.
Specifies devices with SDI connectors.
bool UnpackLine_10BitYUVtoU16s(vector< uint16_t > &outYCbCrLine, const NTV2Buffer &inFrameBuffer, const NTV2FormatDescriptor &inDescriptor, const UWord inLineOffset)
Unpacks up to one raster line of an NTV2_FBF_10BIT_YCBCR frame buffer into an array of uint16_t value...
NTV2Crosspoint
Logically, these are an NTV2Channel combined with an NTV2Mode.
Specifies the device's internal clock.
#define NTV2_VIDEO_FORMAT_IS_B(__f__)
This identifies the invalid (unspecified, uninitialized) VANC mode.
void UnPack10BitDPXtoRGBAlpha10BitPixel(RGBAlpha10BitPixel *rgba10BitBuffer, const ULWord *DPXLinebuffer, ULWord numPixels, bool bigEndian)
string SerialNum64ToString(const uint64_t &inSerNum)
void StackQuadrants(uint8_t *pSrc, uint32_t srcWidth, uint32_t srcHeight, uint32_t srcRowBytes, uint8_t *pDst)
NTV2AudioBufferSize
Represents the size of the audio buffer used by a device audio system for storing captured samples or...
NTV2HDMIColorSpace
Indicates or specifies HDMI Color Space.
ULWordSet NTV2RegisterNumberSet
A set of distinct ULWord values.
string NTV2AncDataRgnToStr(const NTV2AncDataRgn inValue, const bool inCompactDisplay)
#define NTV2_IS_2K_VIDEO_FORMAT(__f__)
Specifies devices that have 12G SDI connectors.
Identifies the 2nd HDMI video input.
NTV2InputSource GetNTV2InputSourceForIndex(const ULWord inIndex0, const NTV2IOKinds inKinds)
1920x1080, for 1080i and 1080p, NTV2_VANCMODE_TALL
ostream & operator<<(ostream &inOutStream, const NTV2FrameSize &inFrameDimensions)
static bool SetRasterLinesBlack10BitYCbCr(UByte *pDstBuffer, const ULWord inDstBytesPerLine, const UWord inDstTotalLines)
NTV2FieldID
These values are used to identify fields for interlaced video. See Field/Frame Interrupts and CNTV2Ca...
NTV2FrameBufferFormat
Identifies a particular video frame buffer pixel format. See Device Frame Buffer Formats for details...
defined(NTV2_DEPRECATE_17_6)
NTV2TaskMode
Describes the task mode state. See also: Sharing AJA Devices With Other Applications.
Doesn't specify any kind of device.
#define NTV2_VIDEO_FORMAT_IS_A(__f__)
Obtain audio samples from the device AES inputs, if available.
std::string NTV2GetVersionString(const bool inDetailed)
Specifies the HDMI In 1 connector.
10-Bit 4:2:2 2-Plane YCbCr
NTV2OutputDestination
Identifies a specific video output destination.
NTV2DeviceIDSet NTV2GetSupportedDevices(const NTV2DeviceKinds inKinds)
Returns an NTV2DeviceIDSet of devices supported by the SDK.
bool CopyFrom(const void *pInSrcBuffer, const ULWord inByteCount)
Replaces my contents from the given memory buffer, resizing me to the new byte count.
720x576, for PAL 625i, NTV2_VANCMODE_TALL
Obtain audio samples from the device HDMI input, if available.
enum _NTV2ScanMethod NTV2ScanMethod
Identifies a particular scan method.
1280x720, for 720p, NTV2_VANCMODE_OFF
string NTV2EmbeddedAudioClockToString(const NTV2EmbeddedAudioClock inValue, const bool inForRetailDisplay)
enum _NTV2VideoFormat NTV2VideoFormat
Identifies a particular video format.
ULWord GetDisplayWidth(const NTV2VideoFormat inVideoFormat)
Used to describe Start of Active Video (SAV) location and field dominance for a given NTV2Standard...
#define NTV2_VIDEO_FORMAT_IS_J2K_SUPPORTED(__f__)
string NTV2RegisterWriteModeToString(const NTV2RegisterWriteMode inValue, const bool inForRetailDisplay)
#define NTV2_IS_TALLER_VANC_GEOMETRY(__g__)
std::string NTV2InterruptEnumToString(const INTERRUPT_ENUMS inInterruptEnumValue)
Identifies the 1st HDMI video input.
string NTV2ReferenceSourceToString(const NTV2ReferenceSource inValue, const bool inForRetailDisplay)
Fractional rate of 120,000 frames per 1,001 seconds.
static AJALock sFRFamMutex
NTV2GeometrySet GetRelatedGeometries(const NTV2FrameGeometry inFG)
#define NTV2_IS_VALID_AUDIO_RATE(_x_)
Identifies the "monitor" or "auxiliary" Field 2 ancillary data region.
Identifies SMPTE SD 525i.
void ConvertARGBYCbCrToABGR(UByte *rgbaBuffer, ULWord numPixels)
See 10-Bit Raw YCbCr (CION).
bool NTV2DeviceCanDo12GSDI(const NTV2DeviceID inDeviceID)
string NTV2CrosspointToString(const NTV2Crosspoint inChannel)
#define NTV2_IS_TALL_VANC_GEOMETRY(__g__)
#define NTV2_VIDEO_FORMAT_HAS_PROGRESSIVE_PICTURE(__f__)
static const NTV2TCIndex gChanVITC1[]
Identifies the AES/EBU audio breakout cable that has XLR connectors.
ULWord GetByteCount(void) const
bool GetRegNumChanges(const NTV2RegNumSet &inBefore, const NTV2RegNumSet &inAfter, NTV2RegNumSet &outGone, NTV2RegNumSet &outSame, NTV2RegNumSet &outNew)
string NTV2BitfileTypeToString(const NTV2BitfileType inValue, const bool inCompactDisplay)
NTV2FrameGeometry GetVANCFrameGeometry(const NTV2FrameGeometry inFrameGeometry, const NTV2VANCMode inVancMode)
Capture (input) mode, which writes into device SDRAM.
See Alternate 8-Bit YCbCr ('YUY2').
ULWord GetIndexForNTV2Crosspoint(const NTV2Crosspoint channel)
#define NTV2_IS_VALID_AUDIO_BUFFER_SIZE(_x_)
See 10-Bit YCbCr - DPX Format.
void PackRGB10BitFor10BitRGBPacked(RGBAlpha10BitPixel *pBuffer, const ULWord inNumPixels)
Identifies high frame-rate UHD.
NTV2AudioSystem NTV2InputSourceToAudioSystem(const NTV2InputSource inInputSource)
Converts a given NTV2InputSource to its equivalent NTV2AudioSystem value.
ULWordSetConstIter NTV2RegNumSetConstIter
A const iterator that iterates over a set of distinct NTV2RegisterNumbers.
void UnPack10BitYCbCrBuffer(uint32_t *packedBuffer, uint16_t *ycbcrBuffer, uint32_t numPixels)
NTV2InputSource GetNTV2HDMIInputSourceForIndex(const ULWord inIndex0)
NTV2FrameRates::const_iterator NTV2FrameRatesConstIter
Specifies devices that have 6G SDI connectors.
bool GetInstalledMacDriverVersion(UWord &outMaj, UWord &outMin, UWord &outPt, UWord &outBld, UWord &outType)
See 3-Plane 10-Bit YCbCr 4:2:2 ('I422_10LE' a.k.a. 'YUV-P-L10').
Specifies HDMI input/output kinds.
bool IsMultiFormatCompatible(const NTV2FrameRate inFrameRate1, const NTV2FrameRate inFrameRate2)
Compares two frame rates and returns true if they are "compatible" (with respect to a multiformat-cap...
void PackLine_16BitYUVto10BitYUV(const UWord *pIn16BitYUVLine, ULWord *pOut10BitYUVLine, const ULWord inNumPixels)
Packs a line of 16-bit-per-component YCbCr (NTV2_FBF_10BIT_YCBCR) video into 10-bit-per-component YCb...
Obtain audio samples from the audio that's embedded in the video HANC.
NTV2EmbeddedAudioClock
This enum value determines/states the device audio clock reference source. It was important to set th...
NTV2InputSource NTV2TimecodeIndexToInputSource(const NTV2TCIndex inTCIndex)
Converts the given NTV2TCIndex value into the appropriate NTV2InputSource value.
The ordinally first geometry (New in SDK 16.0)
string NTV2HDMIBitDepthToString(const NTV2HDMIBitDepth inValue, const bool inCompact)
NTV2Channel NTV2CrosspointToNTV2Channel(const NTV2Crosspoint inCrosspointChannel)
LWord64 GetTotalAudioSamplesFromFrameNbrZeroUpToFrameNbr(const NTV2FrameRate inFrameRate, const NTV2AudioRate inAudioRate, const ULWord inFrameNumNonInclusive)
void Convert8BitYCbCrToYUY2(UByte *ycbcrBuffer, ULWord numPixels)
Specifies any/all input/output kinds.
#define NTV2_IS_2K_1080_VIDEO_FORMAT(__f__)
#define NTV2_IS_VALID_OUTPUT_DEST(_dest_)
Defines a number of handy byte-swapping macros.
#define CCIR601_8BIT_BLACK
The "default" timecode (mostly used by the AJA "Retail" service and Control Panel) ...
std::string setFromString(const std::string &inStr)
void ConvertLineto10BitRGB(UWord *ycbcrBuffer, RGBAlpha10BitPixel *rgbaBuffer, ULWord numPixels, bool fUseSDMatrix, bool fUseSMPTERange=false, bool fAlphaFromLuma=false)
#define NTV2_IS_VALID_AUDIO_CHANNEL_OCTET(__p__)
This identifies the mode in which there are some + extra VANC lines in the frame buffer.
string NTV2AudioRateToString(const NTV2AudioRate inValue, const bool inForRetailDisplay)
See 3-Plane 8-Bit YCbCr 4:2:0 ('I420' a.k.a. 'YUV-P420').
#define NTV2_IS_VALID_TIMECODE_INDEX(__x__)
2048x1080, for 2Kx1080p, NTV2_VANCMODE_TALL
Output Cb if set, elso Output Cb to 0x200.
NTV2HDMIAudioChannels
Indicates or specifies the HDMI audio channel count.
This identifies the 3rd Audio System.
bool UnpackLine_10BitARGBtoUWordSequence(const void *pIn10BitARGBLine, const NTV2FormatDescriptor &inFormatDesc, UWordSequence &out16BitARGBLine)
Unpacks a line of NTV2_FBF_10BIT_ARGB video into 16-bit-per-component ARGB data.
Fractional rate of 60,000 frames per 1,001 seconds.
Declares common audio macros and structs used in the SDK.
static const UByte * GetReadAddress_2vuy(const UByte *pInFrameBuffer, const ULWord inBytesPerVertLine, const UWord inVertLineOffset, const UWord inHorzPixelOffset, const UWord inBytesPerHorzPixel)
bool IsYCbCrFormat(const NTV2FrameBufferFormat format)
UWord NTV2DeviceGetNumAnalogVideoInputs(const NTV2DeviceID inDeviceID)
string NTV2MixerKeyerModeToString(const NTV2MixerKeyerMode inValue, const bool inCompactDisplay)
#define AJA_NTV2_SDK_VERSION_POINT
The SDK "point" release version, an unsigned decimal integer.
NTV2HDMIRange
Indicates or specifies the HDMI RGB range.
static bool SetRasterLinesWhite10BitYCbCr(UByte *pDstBuffer, const ULWord inDstBytesPerLine, const UWord inDstTotalLines)
Embeds SDI input source audio into the data stream.
static const NTV2TCIndex gChanVITC2[]
ULWord GetVideoWriteSize(const NTV2VideoFormat inVideoFormat, const NTV2FrameBufferFormat inFBFormat, const NTV2VANCMode inVancMode)
Identical to the GetVideoActiveSize function, except rounds the result up to the nearest 4K page size...
NTV2Channel
These enum values are mostly used to identify a specific widget_framestore. They're also commonly use...
NTV2Standard Get4xSizedStandard(const NTV2Standard inStandard, const bool bIs4k)
string NTV2GetBitfileName(const NTV2DeviceID inBoardID)
string NTV2OutputCrosspointIDToString(const NTV2OutputCrosspointID inValue, const bool inForRetailDisplay)
Identifies the 8th SDI video input.
NTV2VideoFormat GetOutputForConversionMode(const NTV2ConversionMode conversionMode)
string NTV2AudioChannelPairToString(const NTV2AudioChannelPair inValue, const bool inCompactDisplay)
bool NTV2DeviceCanDoFormat(const NTV2DeviceID inDeviceID, const NTV2FrameRate inFrameRate, const NTV2FrameGeometry inFrameGeometry, const NTV2Standard inStandard)
3840x2160, for UHD, NTV2_VANCMODE_OFF
This identifies the 5th Audio System.
bool Is4KFormat(const NTV2VideoFormat format)
void PackRGB10BitFor10BitRGB(RGBAlpha10BitPixel *pBuffer, const ULWord inNumPixels)
Identifies the 2nd SDI video input.
bool IsRaw(const NTV2FrameBufferFormat frameBufferFormat)
NTV2VideoFormat GetQuadSizedVideoFormat(const NTV2VideoFormat inVideoFormat, const bool isSquareDivision)
#define NTV2_ASSERT(_expr_)
Identifies SMPTE HD 2K1080psf.
See 3-Plane 8-Bit YCbCr 4:2:2 (Weitek 'Y42B' a.k.a. 'YUV-P8').
Represents an unknown or invalid frame rate.
bool SetRasterLinesWhite(const NTV2PixelFormat inPixelFormat, UByte *pDstBuffer, const ULWord inDstBytesPerLine, const UWord inDstTotalLines)
Sets all or part of a destination raster image to legal white.
Obtain audio samples from the device analog input(s), if available.
string NTV2FrameGeometryToString(const NTV2FrameGeometry inValue, const bool inForRetailDisplay)
defined(NTV2_DEPRECATE_17_6)
NTV2VideoFormat GetInputForConversionMode(const NTV2ConversionMode conversionMode)
NTV2RegWritesConstIter NTV2RegisterReadsConstIter
ULWord height(void) const
unsigned long stoul(const std::string &str, std::size_t *idx, int base)
NTV2InputSource NTV2ChannelToInputSource(const NTV2Channel inChannel, const NTV2IOKinds inSourceType)
static UByte * GetWriteAddress_2vuy(UByte *pInFrameBuffer, const ULWord inBytesPerVertLine, const UWord inVertLineOffset, const UWord inHorzPixelOffset, const UWord inBytesPerHorzPixel)
Identifies SMPTE HD 720p.
void setHDRDefaultsForBT2020(HDRRegValues &outRegisterValues)
string PercentDecode(const string &inStr)
Specifies devices that output (playout).
2048x1556, for 2Kx1556psf film format, NTV2_VANCMODE_OFF
static bool CopyRaster36BytesPer8Pixels(UByte *pDstBuffer, const ULWord inDstBytesPerLine, const UWord inDstTotalLines, const UWord inDstVertLineOffset, const UWord inDstHorzPixelOffset, const UByte *pSrcBuffer, const ULWord inSrcBytesPerLine, const UWord inSrcTotalLines, const UWord inSrcVertLineOffset, const UWord inSrcVertLinesToCopy, const UWord inSrcHorzPixelOffset, const UWord inSrcHorzPixelsToCopy)
NTV2TCIndex
These enum values are indexes into the capture/playout AutoCirculate timecode arrays.
bool Fill(const T &inValue)
Fills me with the given scalar value.
Specifies the External Reference connector.
Fractional rate of 48,000 frames per 1,001 seconds.
string NTV2DieTempScaleToString(const NTV2DieTempScale inValue, const bool inUseUTF8)
Field Mode: Register changes take effect at the next field VBI.
#define NTV2_IS_VALID_AUDIO_CHANNEL_QUAD(__p__)
Specifies the SDI In 2 connector.
UWord NTV2DeviceGetNumHDMIVideoOutputs(const NTV2DeviceID inDeviceID)
NTV2FrameRate
Identifies a particular video frame rate.
7680x4320, for UHD2, NTV2_VANCMODE_OFF
2048x1080, NTV2_VANCMODE_TALLER
8-Bit 4:2:2 2-Plane YCbCr
0: Disabled (never recommended): device configured exclusively by client application(s).
NTV2Standard
Identifies a particular video standard.
string NTV2GetFirmwareFolderPath(const bool inAddTrailingPathDelim)
Playout (output) mode, which reads from device SDRAM.
bool IsProgressiveTransport(const NTV2VideoFormat format)
This identifies the 6th Audio System.
NTV2DeviceID
Identifies a specific AJA NTV2 device model number. The NTV2DeviceID is actually the PROM part number...
static const NTV2TCIndex gChanATCLTC[]
Specifies the HDMI In 3 connector.
bool NTV2DeviceCanDoVideoFormat(const NTV2DeviceID inDeviceID, const NTV2VideoFormat inVideoFormat)
static bool CopyRaster16BytesPer6Pixels(UByte *pDstBuffer, const ULWord inDstBytesPerLine, const UWord inDstTotalLines, const UWord inDstVertLineOffset, const UWord inDstHorzPixelOffset, const UByte *pSrcBuffer, const ULWord inSrcBytesPerLine, const UWord inSrcTotalLines, const UWord inSrcVertLineOffset, const UWord inSrcVertLinesToCopy, const UWord inSrcHorzPixelOffset, const UWord inSrcHorzPixelsToCopy)
ULWord GetIndexForNTV2Channel(const NTV2Channel inChannel)
1920x1080, for 1080i and 1080p, NTV2_VANCMODE_OFF
void ConvertLineTo8BitYCbCr(const uint16_t *ycbcr10BitBuffer, uint8_t *ycbcr8BitBuffer, const uint32_t numPixels)
string NTV2AudioSystemToString(const NTV2AudioSystem inValue, const bool inCompactDisplay)
void ConvertLineto16BitRGB(UWord *ycbcrBuffer, RGBAlpha16BitPixel *rgbaBuffer, ULWord numPixels, bool fUseSDMatrix, bool fUseSMPTERange=false)
#define CCIR601_10BIT_WHITE
string NTV2ChannelToString(const NTV2Channel inValue, const bool inForRetailDisplay)
NTV2Crosspoint GetNTV2CrosspointInputForIndex(const ULWord index)
static bool CopyRaster4BytesPerPixel(UByte *pDstBuffer, const ULWord inDstBytesPerLine, const UWord inDstTotalLines, const UWord inDstVertLineOffset, const UWord inDstHorzPixelOffset, const UByte *pSrcBuffer, const ULWord inSrcBytesPerLine, const UWord inSrcTotalLines, const UWord inSrcVertLineOffset, const UWord inSrcVertLinesToCopy, const UWord inSrcHorzPixelOffset, const UWord inSrcHorzPixelsToCopy)
void setHDRDefaultsForDCIP3(HDRRegValues &outRegisterValues)
NTV2VideoFormat GetSupportedNTV2VideoFormatFromInputVideoFormat(const NTV2VideoFormat inVideoFormat)
#define AJA_NTV2_SDK_VERSION_MAJOR
The SDK major version number, an unsigned decimal integer.
NTV2DeviceIDSet::const_iterator NTV2DeviceIDSetConstIter
A convenient const iterator for NTV2DeviceIDSet.
NTV2ReferenceSource
These enum values identify a specific source for the device's (output) reference clock.
NTV2BreakoutType
Identifies the Breakout Boxes and Cables that may be attached to an AJA NTV2 device.
Identifies "all" ancillary data regions.
#define NTV2_INPUT_SOURCE_IS_HDMI(_inpSrc_)
ULWord GetIndexForNTV2CrosspointChannel(const NTV2Crosspoint channel)
bool IsNTV2CrosspointInput(const NTV2Crosspoint inChannel)
Specifies analog input/output kinds.
Identifies Ultra-High-Definition (UHD) psf.
1280x720, for 720p, NTV2_VANCMODE_TALL
enum NTV2AncillaryDataRegion NTV2AncDataRgn
#define NTV2_IS_VALID_IOKINDS(_k_)
ULWord GetVaricamRepeatCount(const NTV2FrameRate inSequenceRate, const NTV2FrameRate inPlayRate, const ULWord inCadenceFrame)
NTV2StringSet::const_iterator NTV2StringSetConstIter
#define NTV2_IS_FBF_RGB(__fbf__)
NTV2Channel NTV2TimecodeIndexToChannel(const NTV2TCIndex inTCIndex)
Converts the given NTV2TCIndex value into the appropriate NTV2Channel value.
Identifies the 3rd SDI video input.
bool IsTransportCompatibleFormat(const NTV2VideoFormat inFormat1, const NTV2VideoFormat inFormat2)
NTV2FrameGeometry GetQuarterSizedGeometry(const NTV2FrameGeometry inGeometry)
Declares the most fundamental data types used by NTV2. Since Windows NT was the first principal devel...
NTV2AudioLoopBack
This enum value determines/states if an audio output embedder will embed silence (zeroes) or de-embed...
NTV2FrameGeometry GetNormalizedFrameGeometry(const NTV2FrameGeometry inFrameGeometry)
Disables normal FrameBuffer Y/C value read limiting (NOT RECOMMENDED).
bool YUVComponentsTo10BitYUVPackedBuffer(const vector< uint16_t > &inYCbCrLine, NTV2Buffer &inFrameBuffer, const NTV2FormatDescriptor &inDescriptor, const UWord inLineOffset)
Packs up to one raster line of uint16_t YUV components into an NTV2_FBF_10BIT_YCBCR frame buffer...
NTV2FrameRate GetFrameRateFromScale(long scale, long duration, NTV2FrameRate playFrameRate)
Defines for the NTV2 SDK version number, used by ajantv2/includes/ntv2enums.h. See the ajantv2/includ...
enum _INTERRUPT_ENUMS_ INTERRUPT_ENUMS
string NTV2OutputDestinationToString(const NTV2OutputDestination inValue, const bool inForRetailDisplay)
void Fill4k8BitYCbCrVideoFrame(PULWord _baseVideoAddress, NTV2FrameBufferFormat frameBufferFormat, YCbCrPixel color, bool vancEnabled, bool b4k, bool wideVANC)
void split(const std::string &str, const char delim, std::vector< std::string > &elems)
string NTV2InputSourceToString(const NTV2InputSource inValue, const bool inForRetailDisplay)
void PackRGB10BitFor10BitARGBPacked(RGBAlpha10BitPixel *pBuffer, const ULWord inNumPixels)
string NTV2AudioSourceToString(const NTV2AudioSource inValue, const bool inCompactDisplay)
void Make10BitBlackLine(UWord *pOutLineData, const ULWord inNumPixels)
Writes a line of unpacked, legal SMPTE 10-bit Y/C black values into the given buffer.
NTV2VideoFormat GetFirstMatchingVideoFormat(const NTV2FrameRate inFrameRate, const UWord inHeightLines, const UWord inWidthPixels, const bool inIsInterlaced, const bool inIsLevelB, const bool inIsPSF)
Specifies the SDI In 8 connector.
2: OEM (recommended): device configured by client application(s) with some driver involvement...
NTV2RegisterNumberSet NTV2RegNumSet
A set of distinct NTV2RegisterNumbers.
bool Is8BitFrameBufferFormat(const NTV2FrameBufferFormat format)
NTV2AudioChannelPair
Identifies a pair of audio channels.
NTV2FrameRateFamilies::const_iterator NTV2FrameRateFamiliesConstIter
bool UnpackLine_10BitYUVtoUWordSequence(const void *pIn10BitYUVLine, UWordSequence &out16BitYUVLine, ULWord inNumPixels)
Unpacks a line of NTV2_FBF_10BIT_YCBCR video into 16-bit-per-component YUV data.
std::vector< std::string > NTV2StringList
void Make8BitBlackLine(UByte *lineData, ULWord numPixels, NTV2FrameBufferFormat fbFormat)
bool SetRasterLinesBlack(const NTV2PixelFormat inPixelFormat, UByte *pDstBuffer, const ULWord inDstBytesPerLine, const UWord inDstTotalLines)
Sets all or part of a destination raster image to legal black.
Specifies any/all devices.
NTV2EmbeddedAudioInput NTV2ChannelToEmbeddedAudioInput(const NTV2Channel inChannel)
Converts the given NTV2Channel value into its equivalent NTV2EmbeddedAudioInput.
NTV2MixerKeyerInputControl
These enum values identify the Mixer/Keyer foreground and background input control values...
Software device that doesn't emulate one of the above devices.
NTV2Channel GetNTV2ChannelForIndex(const ULWord inIndex)
Automatic (not for OEM use)
#define NTV2_IS_PSF_VIDEO_FORMAT(__f__)
uint32_t CalcRowBytesForFormat(const NTV2FrameBufferFormat inPixelFormat, const uint32_t inPixelWidth)
NTV2RegWrites NTV2RegisterReads
string NTV2ModeToString(const NTV2Mode inValue, const bool inCompactDisplay)
std::vector< uint16_t > UWordSequence
An ordered sequence of UWord (uint16_t) values.
Specifies the SDI In 3 connector.
#define NTV2_IS_INPUT_CROSSPOINT(__x__)
std::set< NTV2FrameGeometry > NTV2GeometrySet
A set of distinct NTV2FrameGeometry values.
#define NTV2_IS_3Gb_FORMAT(__f__)
string NTV2MixerInputControlToString(const NTV2MixerKeyerInputControl inValue, const bool inCompactDisplay)
NTV2Crosspoint NTV2ChannelToInputCrosspoint(const NTV2Channel inChannel)
See 8-Bit ARGB, RGBA, ABGR Formats.
NTV2HDMIProtocol
Indicates or specifies the HDMI protocol.
See 8-Bit ARGB, RGBA, ABGR Formats.
void ConvertARGBToRGB(UByte *rgbaLineBuffer, UByte *rgbLineBuffer, ULWord numPixels)
Embeds silence (zeroes) into the data stream.
string AutoCircVidProcModeToString(const AutoCircVidProcMode inValue, const bool inCompactDisplay)
string NTV2HDMIAudioChannelsToString(const NTV2HDMIAudioChannels inValue, const bool inCompact)
Passes only background video + key to the Mixer output.
UWord NTV2DeviceGetNumAnalogVideoOutputs(const NTV2DeviceID inDeviceID)
NTV2Channel NTV2OutputDestinationToChannel(const NTV2OutputDestination inOutputDest)
Converts a given NTV2OutputDestination to its equivalent NTV2Channel value.
Specifies channel or FrameStore 8 (or the 8th item).
#define NTV2_IS_FBF_8BIT(__fbf__)
Identifies SMPTE HD 2K1080p.
Specifies the PTP source on SFP 1.
Register changes take effect immediately, without waiting for a field or frame VBI.
string NTV2IsoConvertModeToString(const NTV2IsoConvertMode inValue, const bool inCompact)
string NTV2RegisterNumberToString(const NTV2RegisterNumber inValue)
Specifies software devices (that don't model "real" ones).
bool NTV2DeviceCanDoPlayback(const NTV2DeviceID inDeviceID)
Specifies channel or FrameStore 2 (or the 2nd item).
bool NTV2DeviceHasSDIRelays(const NTV2DeviceID inDeviceID)
Specifies the SDI In 1 connector.
string NTV2FrameRateToString(const NTV2FrameRate inValue, const bool inForRetailDisplay)
This identifies the 7th Audio System.
Specifies the PCR source on SFP 1.
void PackTo10BitYCbCrBuffer(const uint16_t *ycbcrBuffer, uint32_t *packedBuffer, const uint32_t numPixels)
NTV2OutputDestination NTV2ChannelToOutputDestination(const NTV2Channel inChannel, const NTV2IOKinds inKinds)
Converts the given NTV2Channel value into its ordinary equivalent NTV2OutputDestination.
Register changes take effect after 10 lines after the next field VBI (not commonly used)...
string NTV2FrameBufferFormatToString(const NTV2FrameBufferFormat inValue, const bool inForRetailDisplay)
void Make8BitLine(UByte *lineData, UByte Y, UByte Cb, UByte Cr, ULWord numPixels, NTV2FrameBufferFormat fbFormat)
Output Cr if set, elso Output Cr to 0x200.
HDRRegValues & setDCIP3(void)
std::string NTV2DeviceIDToString(const NTV2DeviceID inValue, const bool inForRetailDisplay)
static bool CopyRaster3BytesPerPixel(UByte *pDstBuffer, const ULWord inDstBytesPerLine, const UWord inDstTotalLines, const UWord inDstVertLineOffset, const UWord inDstHorzPixelOffset, const UByte *pSrcBuffer, const ULWord inSrcBytesPerLine, const UWord inSrcTotalLines, const UWord inSrcVertLineOffset, const UWord inSrcVertLinesToCopy, const UWord inSrcHorzPixelOffset, const UWord inSrcHorzPixelsToCopy)
string NTV2DownConvertModeToString(const NTV2DownConvertMode inValue, const bool inCompact)
NTV2Crosspoint NTV2ChannelToOutputCrosspoint(const NTV2Channel inChannel)
NTV2VANCMode GetVANCModeForGeometry(const NTV2FrameGeometry inFG)
static const INTERRUPT_ENUMS gChannelToInputInterrupt[]
Specifies the HDMI In 2 connector.
ULWord GetNTV2FrameGeometryWidth(const NTV2FrameGeometry inGeometry)
1920x1080, NTV2_VANCMODE_TALLER
UWord NTV2DeviceGetNumVideoInputs(const NTV2DeviceID inDeviceID)
720x486, for NTSC 525i, NTV2_VANCMODE_TALL
INTERRUPT_ENUMS NTV2ChannelToInputInterrupt(const NTV2Channel inChannel)
Converts the given NTV2Channel value into the equivalent input INTERRUPT_ENUMS value.
See 3-Plane 10-Bit YCbCr 4:2:0 ('I420_10LE' a.k.a. 'YUV-P420-L10').
string NTV2VideoLimitingToString(const NTV2VideoLimiting inValue, const bool inCompactDisplay)
void ConvertARGBToBGR(const UByte *pInRGBALineBuffer, UByte *pOutRGBLineBuffer, const ULWord inNumPixels)
ULWord GetScaleFromFrameRate(const NTV2FrameRate inFrameRate)
NTV2Crosspoint NTV2InputSourceToChannelSpec(const NTV2InputSource inInputSource)
Converts a given NTV2InputSource to its equivalent NTV2Crosspoint value.
NTV2Crosspoint GetNTV2CrosspointForIndex(const ULWord index)
bool PackLine_UWordSequenceTo10BitYUV(const UWordSequence &in16BitYUVLine, ULWord *pOut10BitYUVLine, const ULWord inNumPixels)
Packs a line of 16-bit-per-component YCbCr (NTV2_FBF_10BIT_YCBCR) video into 10-bit-per-component YCb...
bool NTV2DeviceCanDo4KVideo(const NTV2DeviceID inDeviceID)
#define NTV2_IS_VANCMODE_ON(__v__)
Overlays foreground video on top of background video.
#define AJA_NTV2_SDK_BUILD_TYPE
The SDK build type, where "a"=alpha, "b"=beta, "d"=development, ""=release.
void MakeUnPacked10BitYCbCrBuffer(uint16_t *buffer, uint16_t Y, uint16_t Cb, uint16_t Cr, uint32_t numPixels)
4096x2160, for 4K, NTV2_VANCMODE_OFF
Identifies the 4th SDI video input.
NTV2Framesize
Kona2/Xena2 specific enums.
Specifies the PCR source on SFP 2.
static bool SetRasterLinesWhite8BitYCbCr(UByte *pDstBuffer, const ULWord inDstBytesPerLine, const UWord inDstTotalLines)
NTV2VideoFormat GetTransportCompatibleFormat(const NTV2VideoFormat inFormat, const NTV2VideoFormat inTargetFormat)
void Convert16BitARGBTo12BitRGBPacked(RGBAlpha16BitPixel *rgbaLineBuffer, UByte *rgbLineBuffer, ULWord numPixels)
8192x4320, for 8K, NTV2_VANCMODE_OFF
void Make8BitWhiteLine(UByte *lineData, ULWord numPixels, NTV2FrameBufferFormat fbFormat)
#define NTV2_IS_VALID_CHANNEL(__x__)
string NTV2AudioLoopBackToString(const NTV2AudioLoopBack inValue, const bool inForRetailDisplay)
bool Fill10BitYCbCrVideoFrame(void *pBaseVideoAddress, const NTV2Standard inStandard, const NTV2FrameBufferFormat inFBF, const YCbCr10BitPixel inPixelColor, const NTV2VANCMode inVancMode)
Describes a user-space buffer on the host computer. I have an address and a length, plus some optional attributes (allocated by SDK?, page-aligned? etc.).
string NTV2StandardToString(const NTV2Standard inValue, const bool inForRetailDisplay)
Identifies SMPTE HD 1080i or 1080psf.
Identifies Ultra-High-Definition (UHD)
NTV2Mode
Used to identify the mode of a widget_framestore, or the direction of an AutoCirculate stream: either...
std::string toString(const bool inNormalized=false) const
Fractional rate of 30,000 frames per 1,001 seconds.
10-Bit 4:2:0 2-Plane YCbCr
Identifies the "Legal SDI" mode (Ymax=0x3AC, Cmax=0x3C0)
string NTV2GetPluginsFolderPath(const bool inAddTrailingPathDelim)
NTV2InputSource
Identifies a specific video input source.
Identifies SMPTE SD 625i.
static bool CopyRaster20BytesPer16Pixels(UByte *pDstBuffer, const ULWord inDstBytesPerLine, const UWord inDstTotalLines, const UWord inDstVertLineOffset, const UWord inDstHorzPixelOffset, const UByte *pSrcBuffer, const ULWord inSrcBytesPerLine, const UWord inSrcTotalLines, const UWord inSrcVertLineOffset, const UWord inSrcVertLinesToCopy, const UWord inSrcHorzPixelOffset, const UWord inSrcHorzPixelsToCopy)
Identifies the 6th SDI video input.
std::string & strip(std::string &str, const std::string &ws)
double GetFramesPerSecond(const NTV2FrameRate inFrameRate)
UWord NTV2GetSDKVersionComponent(const int inVersionComponent)
Returns an SDK version component value.
NTV2TimecodeIndex NTV2InputSourceToTimecodeIndex(const NTV2InputSource inInputSource, const bool inEmbeddedLTC)
Converts a given NTV2InputSource to its equivalent NTV2TimecodeIndex value.
2048x1080, for 2Kx1080p, NTV2_VANCMODE_OFF
static bool CopyRaster5BytesPerPixel(UByte *pDstBuffer, const ULWord inDstBytesPerLine, const UWord inDstTotalLines, const UWord inDstVertLineOffset, const UWord inDstHorzPixelOffset, const UByte *pSrcBuffer, const ULWord inSrcBytesPerLine, const UWord inSrcTotalLines, const UWord inSrcVertLineOffset, const UWord inSrcVertLinesToCopy, const UWord inSrcHorzPixelOffset, const UWord inSrcHorzPixelsToCopy)
bool IsRGBFormat(const NTV2FrameBufferFormat format)
#define AJA_NTV2_SDK_BUILD_DATETIME
The date and time the SDK was built, in ISO-8601 format.
NTV2FrameGeometry
Identifies a particular video frame geometry.
ULWord GetIndexForNTV2CrosspointInput(const NTV2Crosspoint channel)
ULWord NTV2FramesizeToByteCount(const NTV2Framesize inFrameSize)
Converts the given NTV2Framesize value into an exact byte count.
720x576, for PAL 625i, NTV2_VANCMODE_OFF
NTV2FrameGeometry GetNTV2FrameGeometryFromVideoFormat(const NTV2VideoFormat inVideoFormat)
This identifies the first Audio System.
Progressive Segmented Frame.
std::string NTV2IpErrorEnumToString(const NTV2IpError inIpErrorEnumValue)
#define NTV2_IS_VALID_INPUT_SOURCE(_inpSrc_)
string NTV2UpConvertModeToString(const NTV2UpConvertMode inValue, const bool inCompact)
void UnPack10BitDPXtoForRP215(UWord *rawrp215Buffer, ULWord *DPXLinebuffer, ULWord numPixels)
Identifies the 7th SDI video input.
bool Is8KFormat(const NTV2VideoFormat format)
Declares numerous NTV2 utility functions.
static const INTERRUPT_ENUMS gChannelToOutputInterrupt[]
static bool CheckFrameRateFamiliesInitialized(void)
void ConvertLinetoRGB(UByte *ycbcrBuffer, RGBAlphaPixel *rgbaBuffer, ULWord numPixels, bool fUseSDMatrix, bool fUseSMPTERange=false)
static bool SetRasterLinesBlack8BitYCbCr(UByte *pDstBuffer, const ULWord inDstBytesPerLine, const UWord inDstTotalLines)
void RePackLineDataForYCbCrDPX(ULWord *packedycbcrLine, ULWord numULWords)
Describes the horizontal and vertical size dimensions of a raster, bitmap, frame or image...
#define CCIR601_8BIT_CHROMAOFFSET
Specifies the SDI In 7 connector.
NTV2OutputCrosspointID
Identifies a widget output, a signal source, that potentially can drive another widget's input (ident...
#define CCIR601_8BIT_WHITE
Declares the AJASystemInfo class.
NTV2InputCrosspointID
Identifies a widget input that potentially can accept a signal emitted from another widget's output (...
Identifies the "normal" Field 2 ancillary data region.
This identifies the 4th Audio System.
ULWord GetFirstActiveLine(const NTV2FieldID inRasterFieldID=NTV2_FIELD0) const
uint16_t NTV2DeviceKinds
A combination of NTV2DeviceKindFilter values.
#define NTV2_AUDIOSAMPLESIZE
static const string AJAMacDriverInfoPlistPath("/Library/Extensions/AJANTV2.kext/Contents/Info.plist")
Specifies devices that input (capture).
Specifies the Analog In 1 connector.
string NTV2HDMIProtocolToString(const NTV2HDMIProtocol inValue, const bool inCompact)
string NTV2BreakoutTypeToString(const NTV2BreakoutType inValue, const bool inCompactDisplay)
Specifies the PTP source on SFP 2.
#define NTV2_IS_QUAD_QUAD_FORMAT(__f__)
See 8-Bit ARGB, RGBA, ABGR Formats.
720x486, for NTSC 525i and 525p60, NTV2_VANCMODE_OFF
#define NTV2_IS_VANCMODE_TALL(__v__)
#define NTV2_IS_OUTPUT_CROSSPOINT(__x__)
Identifies high frame-rate 4K.
1: Standard/Retail: device configured by AJA ControlPanel, service/daemon, and driver.
Specifies channel or FrameStore 1 (or the first item).
string NTV2AudioBufferSizeToString(const NTV2AudioBufferSize inValue, const bool inForRetailDisplay)
Obtain audio samples from the device microphone input, if available.
NTV2VideoLimiting
These enum values identify the available SDI video output limiting modes.
string NTV2AudioFormatToString(const NTV2AudioFormat inValue, const bool inCompact)
bool Fill8BitYCbCrVideoFrame(void *pBaseVideoAddress, const NTV2Standard inStandard, const NTV2FrameBufferFormat inFBF, const YCbCrPixel inPixelColor, const NTV2VANCMode inVancMode)
NTV2DeviceID NTV2GetDeviceIDFromBitfileName(const string &inBitfileName)
NTV2FrameGeometry Get4xSizedGeometry(const NTV2FrameGeometry inGeometry)
std::set< NTV2FrameRate > NTV2FrameRates
void PackRGB10BitFor10BitDPX(RGBAlpha10BitPixel *pBuffer, const ULWord inNumPixels, const bool bigEndian=true)
bool NTV2DeviceIsExternalToHost(const NTV2DeviceID inDeviceID)
NTV2VANCMode
These enum values identify the available VANC modes.
NTV2TCIndexes GetTCIndexesForSDIConnector(const NTV2Channel inSDI)
NTV2EmbeddedAudioInput NTV2InputSourceToEmbeddedAudioInput(const NTV2InputSource inInputSource)
Converts a given NTV2InputSource to its equivalent NTV2EmbeddedAudioInput value.
Doesn't specify any kind of input/output.
static std::string GetDisplayName(const uint32_t inRegNum)
string NTV2ColorCorrectionModeToString(const NTV2ColorCorrectionMode inValue, const bool inCompactDisplay)
std::vector< NTV2OutputCrosspointID > NTV2OutputCrosspointIDs
An ordered sequence of NTV2OutputCrosspointID values.
NTV2Standard GetNTV2StandardFromScanGeometry(const UByte inScanGeometry, const bool inIsProgressiveTransport)
#define NTV2_IS_SUPPORTED_NTV2FrameRate(__r__)
string NTV2EmbeddedAudioInputToString(const NTV2EmbeddedAudioInput inValue, const bool inCompactDisplay)
Identifies the AES/EBU audio breakout cable that has BNC connectors.
#define NTV2_IS_VALID_AUDIO_SYSTEM(__x__)
Identifies the 3rd HDMI video input.
NTV2RegisterWriteMode
These values are used to determine when certain register writes actually take effect. See CNTV2Card::SetRegisterWriteMode or Field/Frame Interrupts.
string NTV2WidgetIDToString(const NTV2WidgetID inValue, const bool inCompactDisplay)
#define NTV2_INPUT_SOURCE_IS_ANALOG(_inpSrc_)
NTV2FrameRate GetFrameRateFamily(const NTV2FrameRate inFrameRate)
bool toRegValues(HDRRegValues &outVals) const
ULWord AddAudioTestPattern(ULWord *pAudioBuffer, ULWord &inOutCurrentSample, const ULWord inNumSamples, const ULWord inModulus, const bool inEndianConvert, const ULWord inNumChannels)
std::string PrintLineNumber(const ULWord inLineOffset=0, const NTV2FieldID inRasterFieldID=NTV2_FIELD0) const
NTV2ReferenceSource NTV2InputSourceToReferenceSource(const NTV2InputSource inInputSource)
Converts a given NTV2InputSource to its equivalent NTV2ReferenceSource value.
string NTV2WidgetTypeToString(const NTV2WidgetType inValue, const bool inCompactDisplay)
static bool CopyRaster4BytesPer2Pixels(UByte *pDstBuffer, const ULWord inDstBytesPerLine, const UWord inDstTotalLines, const UWord inDstVertLineOffset, const UWord inDstHorzPixelOffset, const UByte *pSrcBuffer, const ULWord inSrcBytesPerLine, const UWord inSrcTotalLines, const UWord inSrcVertLineOffset, const UWord inSrcVertLinesToCopy, const UWord inSrcHorzPixelOffset, const UWord inSrcHorzPixelsToCopy)
string NTV2TaskModeToString(const NTV2TaskMode inValue, const bool inCompactDisplay)
std::vector< NTV2FrameRates > NTV2FrameRateFamilies
string NTV2HDMIRangeToString(const NTV2HDMIRange inValue, const bool inCompact)
bool setFromRegValues(const HDRRegValues &inRegValues)
void CopyToQuadrant(uint8_t *srcBuffer, uint32_t srcHeight, uint32_t srcRowBytes, uint32_t dstQuadrant, uint8_t *dstBuffer, uint32_t quad13Offset)
string PercentEncode(const string &inStr)
NTV2AudioSource
This enum value determines/states where an audio system will obtain its audio samples.
bool convertHDRRegisterToFloatValues(const HDRRegValues &inRegisterValues, HDRFloatValues &outFloatValues)
Levels are 16 - 235 (SMPTE)
Identifies the "monitor" or "auxiliary" Field 1 ancillary data region.
NTV2FrameRate GetNTV2FrameRateFromVideoFormat(const NTV2VideoFormat videoFormat)
Specifies channel or FrameStore 4 (or the 4th item).
static bool CopyRaster6BytesPerPixel(UByte *pDstBuffer, const ULWord inDstBytesPerLine, const UWord inDstTotalLines, const UWord inDstVertLineOffset, const UWord inDstHorzPixelOffset, const UByte *pSrcBuffer, const ULWord inSrcBytesPerLine, const UWord inSrcTotalLines, const UWord inSrcVertLineOffset, const UWord inSrcVertLinesToCopy, const UWord inSrcHorzPixelOffset, const UWord inSrcHorzPixelsToCopy)
bool convertHDRFloatToRegisterValues(const HDRFloatValues &inFloatValues, HDRRegValues &outRegisterValues)
std::ostream & Print(std::ostream &inOutStream) const
Writes a human-readable description of me into the given output stream.
string NTV2TCIndexToString(const NTV2TCIndex inValue, const bool inCompactDisplay)
UWord NTV2DeviceGetNumVideoOutputs(const NTV2DeviceID inDeviceID)
#define NTV2_IS_VALID_FIELD(__x__)
NTV2OutputCrosspointIDs::const_iterator NTV2OutputCrosspointIDsConstIter
A convenient const iterator for NTV2OutputCrosspointIDs.
int RecordCopyAudio(PULWord pAja, PULWord pSR, int iStartSample, int iNumBytes, int iChan0, int iNumChans, bool bKeepAudio24Bits)
Specifies channel or FrameStore 5 (or the 5th item).
string NTV2VideoFormatToString(const NTV2VideoFormat inFormat, const bool inUseFrameRate)
Identifies the first analog video input.
Private include file for all ajabase sources.
See 10-Bit RGB - DPX Format.
bool NTV2DeviceCanDoCustomAnc(const NTV2DeviceID inDeviceID)
This identifies the 8th Audio System.
#define NTV2_IS_VALID_VIDEO_FORMAT(__f__)
Specifies the HDMI In 4 connector.
string NTV2M31VideoPresetToString(const M31VideoPreset inValue, const bool inForRetailDisplay)
static NTV2FrameRateFamilies sFRFamilies
Output Y if set, else Output Y=0x40.
bool IsVideoFormatA(const NTV2VideoFormat format)
virtual AJAStatus GetValue(const AJASystemInfoTag inTag, std::string &outValue) const
Answers with the host system info value string for the given AJASystemInfoTag.
No identifiable breakout hardware appears to be attached.
#define NTV2_FBF_HAS_ALPHA(__fbf__)
std::set< NTV2DeviceID > NTV2DeviceIDSet
A set of NTV2DeviceIDs.
void CopyRGBAImageToFrame(ULWord *pSrcBuffer, ULWord srcWidth, ULWord srcHeight, ULWord *pDstBuffer, ULWord dstWidth, ULWord dstHeight)
void * GetHostPointer(void) const
#define CCIR601_10BIT_CHROMAOFFSET
Identifies the first field in time for an interlaced video frame, or the first and only field in a pr...
NTV2FrameGeometry GetGeometryFromFrameDimensions(const NTV2FrameSize &inFD)
bool NTV2DeviceCanDoCapture(const NTV2DeviceID inDeviceID)
ULWord GetDisplayHeight(const NTV2VideoFormat inVideoFormat)
Specifies the SDI In 4 connector.
2048x1556, for 2Kx1556psf film format, NTV2_VANCMODE_TALL
Audio clock derived from the device reference.
bool NTV2DeviceCanDoIP(const NTV2DeviceID inDeviceID)
NTV2RegisterReads FromRegNumSet(const NTV2RegNumSet &inRegNumSet)
Identifies the "Legal Broadcast" mode (Ymax=0x340, Cmax=0x340)
This identifies the 2nd Audio System.
NTV2Audio4ChannelSelect
Identifies a contiguous, adjacent group of four audio channels.
NTV2ConversionMode GetConversionMode(const NTV2VideoFormat inFormat, const NTV2VideoFormat outFormat)
NTV2RegNumSet ToRegNumSet(const NTV2RegisterReads &inRegReads)
Specifies channel or FrameStore 6 (or the 6th item).
NTV2TCIndex NTV2ChannelToTimecodeIndex(const NTV2Channel inChannel, const bool inEmbeddedLTC, const bool inIsF2)
Converts the given NTV2Channel value into the equivalent NTV2TCIndex value.
#define HEX0N(__x__, __n__)
#define NTV2_IS_VALID_VANCMODE(__v__)
string NTV2AudioChannelQuadToString(const NTV2Audio4ChannelSelect inValue, const bool inCompactDisplay)
NTV2AudioSource NTV2InputSourceToAudioSource(const NTV2InputSource inInputSource)
bool StringToSerialNum64(const string &inSerNumStr, uint64_t &outSerNum)
#define NTV2_IS_4K_QUADHD_VIDEO_FORMAT(__f__)
Frame Mode: Register changes take effect at the next frame VBI (power-up default).
Specifies channel or FrameStore 7 (or the 7th item).
#define NTV2_INPUT_SOURCE_IS_SDI(_inpSrc_)
NTV2IOKinds GetNTV2InputSourceKind(const NTV2InputSource inSrc)
NTV2Crosspoint GetNTV2CrosspointChannelForIndex(const ULWord index)
void UnpackLine_10BitYUVto16BitYUV(const ULWord *pIn10BitYUVLine, UWord *pOut16BitYUVLine, const ULWord inNumPixels)
Unpacks a line of 10-bit-per-component YCbCr video into 16-bit-per-component YCbCr (NTV2_FBF_10BIT_YC...
Specifies devices that have Anc/Aux inserters/extractors.
void * GetHostAddress(const ULWord inByteOffset, const bool inFromEnd=false) const
string NTV2AudioChannelOctetToString(const NTV2Audio8ChannelSelect inValue, const bool inCompactDisplay)
bool IsVideoFormatB(const NTV2VideoFormat format)
Identifies the "normal" Field 1 ancillary data region.
#define NTV2EndianSwap16(__val__)
8-Bit 4:2:0 2-Plane YCbCr
720x576, for PAL 625i, NTV2_VANCMODE_TALLER
void MaskUnPacked10BitYCbCrBuffer(uint16_t *ycbcrUnPackedBuffer, uint16_t signalMask, uint32_t numPixels)
UWord NTV2DeviceGetNumHDMIVideoInputs(const NTV2DeviceID inDeviceID)
string NTV2VANCModeToString(const NTV2VANCMode inValue, const bool inCompactDisplay)
void ConvertUnpacked10BitYCbCrToPixelFormat(uint16_t *unPackedBuffer, uint32_t *packedBuffer, uint32_t numPixels, NTV2FrameBufferFormat pixelFormat, bool bUseSmpteRange, bool bAlphaFromLuma)
Specifies devices that have SDI bypass relays.
Identifies the 1st SDI video input.
ULWord GetIndexForNTV2InputSource(const NTV2InputSource inValue)
bool IsNTV2CrosspointOutput(const NTV2Crosspoint inChannel)
INTERRUPT_ENUMS NTV2ChannelToOutputInterrupt(const NTV2Channel inChannel)
Converts the given NTV2Channel value into the equivalent output INTERRUPT_ENUMS value.
void CopyFromQuadrant(uint8_t *srcBuffer, uint32_t srcHeight, uint32_t srcRowBytes, uint32_t srcQuadrant, uint8_t *dstBuffer, uint32_t quad13Offset)
NTV2Standard GetQuarterSizedStandard(const NTV2Standard inStandard)
Specifies external devices (e.g. Thunderbolt).
bool Is2KFormat(const NTV2VideoFormat format)
std::vector< NTV2DeviceID > NTV2DeviceIDList
An ordered list of NTV2DeviceIDs.
Specifies devices that can do 4K video.
NTV2Channel NTV2InputSourceToChannel(const NTV2InputSource inInputSource)
Converts a given NTV2InputSource to its equivalent NTV2Channel value.
bool IsAlphaChannelFormat(const NTV2FrameBufferFormat format)
#define NTV2_IS_PROGRESSIVE_STANDARD(__s__)
ULWord NTV2AudioBufferSizeToByteCount(const NTV2AudioBufferSize inBufferSize)
Converts the given NTV2BufferSize value into its exact byte count.
NTV2DeviceIDList::const_iterator NTV2DeviceIDListConstIter
A convenient const iterator for NTV2DeviceIDList.
#define NTV2_IS_VALID_NTV2FrameGeometry(__s__)
Specifies the SDI In 5 connector.
NTV2EmbeddedAudioInput
This enum value determines/states which SDI video input will be used to supply audio samples to an au...
bool IsVideoFormatJ2KSupported(const NTV2VideoFormat format)
ULWord GetAudioSamplesPerFrame(const NTV2FrameRate inFrameRate, const NTV2AudioRate inAudioRate, ULWord inCadenceFrame, const bool inIsSMPTE372Enabled)
Returns the number of audio samples for a given video frame rate, audio sample rate, and frame number. This is useful since AJA devices use fixed audio sample rates (typically 48KHz), and some video frame rates will necessarily result in some frames having more audio samples than others.
NTV2HDMIBitDepth
Indicates or specifies the HDMI video bit depth.
#define NTV2_IS_VALID_AUDIO_CHANNEL_PAIR(__p__)
#define NTV2EndianSwap32(__val__)
#define AJA_NTV2_SDK_VERSION_MINOR
The SDK minor version number, an unsigned decimal integer.
void Make10BitWhiteLine(UWord *pOutLineData, const ULWord inNumPixels)
Writes a line of unpacked, legal SMPTE 10-bit Y/C white values into the given buffer.
void UnPack10BitDPXtoForRP215withEndianSwap(UWord *rawrp215Buffer, ULWord *DPXLinebuffer, ULWord numPixels)
bool GetChangedRegisters(const NTV2RegisterReads &inBefore, const NTV2RegisterReads &inAfter, NTV2RegNumSet &outChanged)
Declares device capability functions.
This identifies the "tall" mode in which there are some VANC lines in the frame buffer.
HDRRegValues & setBT2020(void)
NTV2VideoFormat GetQuarterSizedVideoFormat(const NTV2VideoFormat inVideoFormat)
NTV2MixerKeyerMode
These enum values identify the mixer mode.
NTV2Audio8ChannelSelect
Identifies a contiguous, adjacent group of eight audio channels.
This identifies the mode in which there are no VANC lines in the frame buffer.
720x486, for NTSC 525i and 525p60, NTV2_VANCMODE_TALLER
Fractional rate of 24,000 frames per 1,001 seconds.
NTV2StringList::const_iterator NTV2StringListConstIter
bool IsPSF(const NTV2VideoFormat format)
Specifies channel or FrameStore 3 (or the 3rd item).
#define NTV2UTILS_ENUM_CASE_RETURN_VAL_OR_ENUM_STR(condition, retail_name, enum_name)
string NTV2InputCrosspointIDToString(const NTV2InputCrosspointID inValue, const bool inForRetailDisplay)
std::set< std::string > NTV2StringSet
enum NTV2TCIndex NTV2TimecodeIndex
void Convert16BitARGBTo16BitRGB(RGBAlpha16BitPixel *rgbaLineBuffer, UWord *rgbLineBuffer, ULWord numPixels)
bool HasVANCGeometries(const NTV2FrameGeometry inFG)
#define NTV2_FBF_IS_RAW(__fbf__)
Declares the CNTV2RegisterExpert class.
NTV2RegReadsConstIter FindFirstMatchingRegisterNumber(const uint32_t inRegNum, const NTV2RegReads &inRegInfos)
Returns a const iterator to the first entry in the NTV2RegInfo collection with a matching register nu...
#define NTV2_IS_4K_4096_VIDEO_FORMAT(__f__)
Audio clock derived from the video input.
NTV2Standard GetStandardFromGeometry(const NTV2FrameGeometry inGeometry, const bool inIsProgressive)
string NTV2RegNumSetToString(const NTV2RegisterNumberSet &inObj)
virtual bool IsValid(void) const
#define CCIR601_10BIT_BLACK