mirror of
https://git.mirrors.martin98.com/https://github.com/google/draco
synced 2025-04-21 21:30:01 +08:00
53 lines
1.4 KiB
Markdown
53 lines
1.4 KiB
Markdown
|
|
## Sequential Attributes Decoders Controller
|
|
|
|
### DecodeAttributesDecoderData()
|
|
|
|
~~~~~
|
|
DecodeAttributesDecoderData(buffer) {
|
|
AttributesDecoder_DecodeAttributesDecoderData(buffer)
|
|
sequential_decoders_.resize(num_attributes());
|
|
for (i = 0; i < num_attributes(); ++i) {
|
|
decoder_type UI8
|
|
sequential_decoders_[i] = CreateSequentialDecoder(decoder_type);
|
|
sequential_decoders_[i]->Initialize(decoder(), GetAttributeId(i))
|
|
}
|
|
~~~~~
|
|
|
|
|
|
### DecodeAttributes()
|
|
|
|
~~~~~
|
|
DecodeAttributes(buffer) {
|
|
sequencer_->GenerateSequence(&point_ids_)
|
|
for (i = 0; i < num_attributes(); ++i) {
|
|
pa = decoder()->point_cloud()->attribute(GetAttributeId(i));
|
|
sequencer_->UpdatePointToAttributeIndexMapping(pa)
|
|
}
|
|
for (i = 0; i < num_attributes(); ++i) {
|
|
sequential_decoders_[i]->Decode(point_ids_, buffer)
|
|
//SequentialAttributeDecoder_Decode()
|
|
}
|
|
}
|
|
~~~~~
|
|
|
|
|
|
|
|
### CreateSequentialDecoder()
|
|
|
|
~~~~~
|
|
CreateSequentialDecoder(type) {
|
|
switch (type) {
|
|
case SEQUENTIAL_ATTRIBUTE_ENCODER_GENERIC:
|
|
return new SequentialAttributeDecoder()
|
|
case SEQUENTIAL_ATTRIBUTE_ENCODER_INTEGER:
|
|
return new SequentialIntegerAttributeDecoder()
|
|
case SEQUENTIAL_ATTRIBUTE_ENCODER_QUANTIZATION:
|
|
return new SequentialQuantizationAttributeDecoder()
|
|
case SEQUENTIAL_ATTRIBUTE_ENCODER_NORMALS:
|
|
return new SequentialNormalAttributeDecoder()
|
|
}
|
|
}
|
|
~~~~~
|
|
|