in src/main/java/com/netflix/imflibrary/st2067_2/CompositionImageEssenceDescriptorModel.java [90:208]
public CompositionImageEssenceDescriptorModel(@Nonnull UUID imageEssencedescriptorID, @Nonnull DOMNodeObjectModel imageEssencedescriptorDOMNode, @Nonnull RegXMLLibDictionary regXMLLibDictionary)
{
this.imageEssencedescriptorDOMNode = imageEssencedescriptorDOMNode;
this.imageEssencedescriptorID = imageEssencedescriptorID;
this.regXMLLibDictionary = regXMLLibDictionary;
this.imfErrorLogger = new IMFErrorLoggerImpl();
if (imageEssencedescriptorDOMNode.getLocalName().equals(regXMLLibDictionary.getSymbolNameFromURN(rgbaDescriptorUL))) {
this.colorModel = ColorModel.RGB;
} else if (imageEssencedescriptorDOMNode.getLocalName().equals(regXMLLibDictionary.getSymbolNameFromURN(cdciDescriptorUL))) {
this.colorModel = ColorModel.YUV;
} else {
this.colorModel = ColorModel.Unknown;
}
this.frameLayoutType = FrameLayoutType.valueOf(regXMLLibDictionary.getEnumerationValueFromName(frameLayoutTypeUL, getFieldAsString(frameLayoutUL)));
Integer storedWidth = getFieldAsInteger(storedWidthUL);
storedWidth = storedWidth != null ? storedWidth : -1;
this.storedWidth = storedWidth;
Integer storedHeight = getFieldAsInteger(storedHeightUL);
storedHeight = storedHeight != null ? storedHeight : -1;
this.storedHeight = storedHeight;
Fraction sampleRate = getFieldAsFraction(sampleRateUL);
sampleRate = sampleRate != null ? sampleRate : new Fraction(0);
this.sampleRate = sampleRate;
this.storedOffset = getFieldAsInteger(storedF2OffsetUL);
this.sampleHeight = getFieldAsInteger(sampledHeightUL);
this.sampleWidth = getFieldAsInteger(sampledWidthUL);
this.componentDepth = getFieldAsInteger(componentDepthUL);
this.transferCharacteristic = Colorimetry.TransferCharacteristic.valueOf(imageEssencedescriptorDOMNode.getFieldAsUL(regXMLLibDictionary.getSymbolNameFromURN
(transferCharacteristicUL)));
this.colorPrimaries = Colorimetry.ColorPrimaries.valueOf(imageEssencedescriptorDOMNode.getFieldAsUL(regXMLLibDictionary.getSymbolNameFromURN(colorPrimariesUL)));
if(colorModel.equals(ColorModel.YUV)) {
this.codingEquation = Colorimetry.CodingEquation.valueOf(imageEssencedescriptorDOMNode.getFieldAsUL(regXMLLibDictionary.getSymbolNameFromURN(codingEquationsUL)));
}
else {
this.codingEquation = CodingEquation.None;
}
this.essenceContainerFormatUL = imageEssencedescriptorDOMNode.getFieldAsUL(regXMLLibDictionary.getSymbolNameFromURN(containerFormatUL));
this.pictureEssenceCodingUL = imageEssencedescriptorDOMNode.getFieldAsUL(regXMLLibDictionary.getSymbolNameFromURN(GenericPictureEssenceDescriptor.pictureEssenceCodingUL));
// begin Items constrained in ST2065-5
this.signalStandard = getFieldAsInteger(signalStandardUL);
this.sampledXOffset = getFieldAsInteger(sampledXOffsetUL);
this.sampledYOffset = getFieldAsInteger(sampledYOffsetUL);
Integer displayWidth = getFieldAsInteger(displayWidthUL);
this.displayWidth = displayWidth != null ? displayWidth : -1;
Integer displayHeight = getFieldAsInteger(displayHeightUL);
this.displayHeight = displayHeight != null ? displayHeight : -1;
this.displayXOffset = getFieldAsInteger(displayXOffsetUL);
this.displayYOffset = getFieldAsInteger(displayYOffsetUL);
this.displayF2Offset = getFieldAsInteger(displayF2OffsetUL);
this.imageAspectRatio = getFieldAsFraction(imageAspectRatioUL);
this.activeFormatDescriptor = getFieldAsInteger(activeFormatDescriptorUL);
this.alphaTransparency = getFieldAsInteger(alphaTransparencyUL);
this.imageAlignmentOffset = getFieldAsInteger(imageAlignmentOffsetUL);
this.imageStartOffset = getFieldAsInteger(imageStartOffsetUL);
this.imageEndOffset = getFieldAsInteger(imageEndOffsetUL);
this.fieldDominance = getFieldAsInteger(fieldDominanceUL);
this.codingEquations = imageEssencedescriptorDOMNode.getFieldAsUL(regXMLLibDictionary.getSymbolNameFromURN(codingEquationsUL));
this.componentMinRef = getFieldAsInteger(componentMinRefUL);
this.componentMaxRef = getFieldAsInteger(componentMaxRefUL);
this.alphaMinRef = getFieldAsInteger(alphaMinRefUL);
this.alphaMaxRef = getFieldAsInteger(alphaMaxRefUL);
this.scanningDirection = getFieldAsInteger(scanningDirectionUL);
this.palette = getFieldAsString(paletteUL);
this.paletteLayout = getFieldAsString(paletteLayoutUL);
// end Items constrained in ST2065-5
UL MXFGCFrameWrappedACESPictures = UL.fromULAsURNStringToUL("urn:smpte:ul:060e2b34.0401010d.0d010301.02190100"); // MXF-GC Frame-wrapped ACES Pictures per 2065-5
if(!this.colorModel.equals(ColorModel.Unknown)) {
if ((this.essenceContainerFormatUL != null) && getEssenceContainerFormatUL().equals(MXFGCFrameWrappedACESPictures) ) { // App #5
if(colorModel.equals(ColorModel.RGB)) {
this.pixelBitDepth = null;
this.quantization = Quantization.Unknown;
this.color = Colorimetry.valueOf(this.colorPrimaries, this.transferCharacteristic);
this.sampling = Sampling.Unknown;
parseApp5SubDescriptors();
parseApp5PixelLayout();
} else {
this.pixelBitDepth = null;
this.quantization = Quantization.Unknown;
this.color = Colorimetry.Unknown;
this.sampling = Sampling.Unknown;
}
} else { // App #2/#2E
this.pixelBitDepth = parsePixelBitDepth(this.colorModel);
this.quantization = parseQuantization(this.colorModel, this.pixelBitDepth);
Colorimetry color = Colorimetry.valueOf(this.colorPrimaries, this.transferCharacteristic);
if((colorModel.equals(ColorModel.YUV) && !color.getCodingEquation().equals(this.codingEquation))) {
color = Colorimetry.Unknown;
}
this.color = color;
this.sampling = parseSampling(this.colorModel);
}
parseVideoLineMap();
this.j2kParameters = J2KHeaderParameters.fromDOMNode(imageEssencedescriptorDOMNode);
}
else {
this.pixelBitDepth = null;
this.quantization = Quantization.Unknown;
this.color = Colorimetry.Unknown;
this.sampling = Sampling.Unknown;
}
}