class element_a { bit(1) has_id; if(has_id) { attr_custom_ID id; } bit(1) has_rare; if(has_rare) { attr_custom_rare rare; } bit(1) has_fill; if(has_fill) { attr_custom_paint fill; } bit(1) has_stroke; if(has_stroke) { attr_custom_paint stroke; } bit(1) externalResourcesRequired; bit(1) has_target; if(has_target) { attr_custom_byteAlignedString target; } bit(1) has_href; if(has_href) { attr_custom_anyURI href; } bit(1) has_attr_any; if(has_attr_any) { attr_any any; } object_content child0; } class object_content { bit(1) opt_group; if(opt_group) { privateAttributeContainer privateAttributes; } bit(1) opt_group1; if(opt_group1) { vluimsbf5 occ2; for(int t=0;t>3)] data; } class privateAttribute(index) { uint(log2sup(nbAttrNames[index])) attrIndex; attr_custom_byteAlignedString value; } class privateChildren { vluimsbf5 count; for (int i = 0; i < count; i++) { bit(1) isPrivate; if (isPrivate) { bit(1) isText; if (isText) { attr_custom_byteAlignedString textContent; } else { privateElement e; } } else { updatable_elements child[i]; } } } class privateElement { uint(tagIndexBits) tagIndex; bit(1) hasID; if (hasID) { attr_custom_ID ID; } vluimsbf5 alen; for (int i = 0; i < alen; i++ ) { bit(1) hasNS; if (hasNS) { privateAttribute(0) att[i]; } else { privateAttribute(tagIndex) att[i]; } } bit(1) hasChildren; if (hasChildren) { privateChildren ch; } } class attr_custom_anyXMLAttribute { vluimsbf5 skipLen; //length in bytes aligned vluimsbf5 count; for (int i = 0; i < count; i++) { privateAttribute(0) attr[i]; // private attribute stored in the first (0) bin, reserved for attr of LASeR elements } } class attr_custom_opaqueAttribute { vluimsbf5 len; //length in bytes aligned uint(privateDataIdentifierIndexBits) privateDataIdentifierIndex; aligned byte[len - ((privateDataIdentifierIndexBits+7)>>3)] data; } //*********************************************************************************************** // extensions //*********************************************************************************************** //for type codecs class attr_custom_extension { vluimsbf5 len; byte[len] privateData; } //for elements class element_any { uint(extensionIDBits) reserved; vluimsbf5 len; //length in bits bit[len] toSkip; } //for attributes class attr_any { do { uint(extensionIDBits) reserved; vluimsbf5 len; //length in bits bit[len] toSkip; bit(1) hasNextExtension; } while (hasNextExtension); } //*********************************************************************************************** // LASeRHeader //*********************************************************************************************** class LASeRHeader { uint(8) profile; uint(8) level; bit(3) reserved; bit(2) pointsCodec; byte pathComponents; bit(1) useFullRequestHost; bit(1) hasTimeResolution; if (hasTimeResolution) { uint(16) timeResolution; } bit(4) colorComponentBits_minus_1; colorComponentBits = colorComponentBits_minus_1 + 1; bit(4) resolution; bit(5) coordBits; bit(4) scaleBits_minus_coordBits; bit(1) append; bit(1) hasStringIds; bit(1) hasPrivateData; bit(1) hasExtendedAttributes; // extensionIDBits defines the number of bits of extension tags bit(4) extensionIDBits; bit(1) hasExtensionDescriptor; if (hasExtensionDescriptor) { vluimsbf5 len; byte[len] extensionDescriptor; //extensionDescriptor can be used by a BiM decoder has specified in Annex A. } bit(1) hasExtension; if (hasExtension) { attr_custom_extension ext; } } //*********************************************************************************************** // Initialisation codecs //*********************************************************************************************** int colorIndex = -1; class colorInitialisation { bit(1) hasColors; if (hasColors) { // a color table in front of each AU vluimsbf5 nbColors; for (int i = 0; i < nbColors; i++) { colorIndex = colorIndex + 1; uint(colorComponentBits) red[[colorIndex]]; uint(colorComponentBits) green[[colorIndex]]; uint(colorComponentBits) blue[[colorIndex]]; } colorIndexBits = log2sup(colorIndex); } } int fontIndex = -1; class fontInitialisation { bit(1) hasFonts; if (hasFonts) { // a font table in front of each AU vluimsbf5 nbFonts; for (int i = 0; i < nbFonts; i++) { fontIndex = fontIndex + 1; attr_custom_byteAlignedString font[[fontIndex]]; } fontIndexBits = log2sup(fontIndex); } } int privateDataIdentifierIndex = -1; class privateDataIdentifierInitialisation { bit(1) hasPrivateDataIdentifiers; if (hasPrivateDataIdentifiers) { // a privateDataIdentifiertable in front of each AU vluimsbf5 nbPrivateDataIdentifiers; for (int i = 0; i < nbPrivateDataIdentifiers; i++) { privateDataIdentifierIndex = privateDataIdentifierIndex + 1; // the purpose of these strings is to ensure non collision between different private data // examples are URNs, uuids, ... attr_custom_byteAlignedString privateDataIdentifier[[privateDataIdentifierIndex]]; } privateDataIdentifierIndexBits = log2sup(privateDataIdentifierIndex); } } int tagIndex = -1; class anyXMLInitialisation { bit(1) hasTags; if (hasTags) { // a tag table in front of each AU vluimsbf5 nbTags; for (int i = 0; i < nbTags; i++) { if (i == 0) { // tag 0 for use for priv. attrs on LASeR elements bit(1) hasAttrs; if (hasAttrs) { // the first bin is reserved for private attributes of LASeR elements // and to attributes with a privateDataIdentifier different from their parent element vluimsbf5 nbAttrNames[[0]]; for (int t = 0; t < nbAttrNames[[0]]; t++) { uint(privateDataIdentifierIndexBits) privateDataIdentifierIndex[[0]][[t]]; attr_custom_byteAlignedString attrName[[0]][[t]]; } } } else { tagIndex = tagIndex + 1; uint(privateDataIdentifierIndexBits) privateDataIdentifierIndex[[i]]; attr_custom_byteAlignedString tag[[i]]; bit(1) hasAttrs; if (hasAttrs) { // each private element tag has a bin for private attributes vluimsbf5 nbAttrNames[[tagIndex]]; for (int t = 0; t < nbAttrNames[[tagIndex]]; t++) { attr_custom_byteAlignedString attrName[[tagIndex]][[t]]; } } } } tagIndexBits = log2sup(tagIndex); } } class extendedInitialisation { bit(1) hasExtension; if (hasExtension) { attr_custom_extension c; } }